Added ways to configure rsync options to be used only when uploading or downloading from a remote. Useful to eg limit upload bandwidth.

This commit is contained in:
Joey Hess 2014-02-02 16:06:34 -04:00
parent 9e4675d3c8
commit 089c0109a2
7 changed files with 60 additions and 21 deletions

View file

@ -310,7 +310,7 @@ copyFromRemote r key file dest _p = copyFromRemote' r key file dest
copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> Annex Bool
copyFromRemote' r key file dest
| not $ Git.repoIsUrl (repo r) = guardUsable (repo r) False $ do
let params = Ssh.rsyncParams r
let params = Ssh.rsyncParams r Download
u <- getUUID
-- run copy from perspective of remote
liftIO $ onLocal (repo r) $ do
@ -409,7 +409,7 @@ copyToRemote r key file p
-- the remote's Annex, but it needs access to the current
-- Annex monad's state.
checksuccessio <- Annex.withCurrentState checksuccess
let params = Ssh.rsyncParams r
let params = Ssh.rsyncParams r Upload
u <- getUUID
-- run copy from perspective of remote
liftIO $ onLocal (repo r) $ ifM (Annex.Content.inAnnex key)