summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-02 12:53:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-02 12:53:39 -0400
commit9293b49b13847df885953aac690f661d88d34dff (patch)
treeed9865353aa316890093745269601d606269cfcc /Remote
parent1a78145e72eeb5abf58e3fee63088ca755a61e50 (diff)
rsync special remote: Fix fallback mode for rsync remotes that use hashDirMixed. Closes: #731142
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Rsync.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 91638de98..627690d2b 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -257,22 +257,25 @@ withRsyncScratchDir a = do
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
rsyncRetrieve o k dest callback =
- untilTrue (rsyncUrls o k) $ \u -> rsyncRemote o callback
+ showResumable $ untilTrue (rsyncUrls o k) $ \u -> rsyncRemote o callback
-- use inplace when retrieving to support resuming
[ Param "--inplace"
, Param u
, File dest
]
+showResumable :: Annex Bool -> Annex Bool
+showResumable a = ifM a
+ ( return True
+ , do
+ showLongNote "rsync failed -- run git annex again to resume file transfer"
+ return False
+ )
+
rsyncRemote :: RsyncOpts -> Maybe MeterUpdate -> [CommandParam] -> Annex Bool
rsyncRemote o callback params = do
showOutput -- make way for progress bar
- ifM (liftIO $ (maybe rsync rsyncProgress callback) ps)
- ( return True
- , do
- showLongNote "rsync failed -- run git annex again to resume file transfer"
- return False
- )
+ liftIO $ (maybe rsync rsyncProgress callback) ps
where
defaultParams = [Params "--progress"]
ps = rsyncOptions o ++ defaultParams ++ params
@@ -298,7 +301,7 @@ rsyncSend o callback k canrename src = withRsyncScratchDir $ \tmp -> do
else createLinkOrCopy src dest
ps <- sendParams
if ok
- then rsyncRemote o (Just callback) $ ps ++
+ then showResumable $ rsyncRemote o (Just callback) $ ps ++
[ Param "--recursive"
, partialParams
-- tmp/ to send contents of tmp dir