summaryrefslogtreecommitdiff
path: root/Remote/Rsync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-04 15:01:00 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-04 15:01:00 -0400
commitb855580614852c7558fb2aad387609d15c4b0c6b (patch)
tree9f523cdb70e17cfa3d8bdb6a5d51364557572869 /Remote/Rsync.hs
parent7cd9433dab89e1e007cef783d8b18e5eeac987f1 (diff)
parent8815f95d1ad0413ca35e6873f4b7b272bac629db (diff)
Merge branch 'concurrentprogress'
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r--Remote/Rsync.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index f39081299..a882e081d 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -31,6 +31,7 @@ import Remote.Rsync.RsyncUrl
import Crypto
import Utility.Rsync
import Utility.CopyFile
+import Messages.Progress
import Utility.Metered
import Utility.PID
import Annex.Perms
@@ -281,11 +282,15 @@ showResumable a = ifM a
)
rsyncRemote :: Direction -> RsyncOpts -> Maybe MeterUpdate -> [CommandParam] -> Annex Bool
-rsyncRemote direction o callback params = do
+rsyncRemote direction o m params = do
showOutput -- make way for progress bar
- liftIO $ (maybe rsync rsyncProgress callback) $
- opts ++ [Params "--progress"] ++ params
+ case m of
+ Nothing -> liftIO $ rsync ps
+ Just meter -> do
+ oh <- mkOutputHandler
+ liftIO $ rsyncProgress oh meter ps
where
+ ps = opts ++ [Params "--progress"] ++ params
opts
| direction == Download = rsyncDownloadOptions o
| otherwise = rsyncUploadOptions o