summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-10 15:15:01 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-10 15:15:21 -0400
commit112ca28651e4e799ffe0d61933746f7f208dd140 (patch)
tree34e4696a4d773f536a1491761497f816aab367a1 /Remote
parentbc43b03e9d8b55c1edf2e89f072c53ebec06c1ca (diff)
use built-in progress meters for git when in parallel mode
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index abefc113e..b04d381a8 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -52,6 +52,7 @@ import qualified Remote.GCrypt
import Annex.Path
import Creds
import Annex.CatFile
+import Messages.Progress
import Control.Concurrent
import Control.Concurrent.MSampleVar
@@ -354,9 +355,11 @@ dropKey r key
{- Tries to copy a key's content from a remote's annex to a file. -}
copyFromRemote :: Remote -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex Bool
-copyFromRemote r key file dest _p = copyFromRemote' r key file dest
-copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> Annex Bool
-copyFromRemote' r key file dest
+copyFromRemote r key file dest p = metered (Just p) key $
+ copyFromRemote' r key file dest
+
+copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex Bool
+copyFromRemote' r key file dest meterupdate
| not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ do
params <- Ssh.rsyncParams r Download
u <- getUUID
@@ -434,7 +437,9 @@ copyFromRemote' r key file dest
send bytes
forever $
send =<< readSV v
- let feeder = writeSV v . fromBytesProcessed
+ let feeder = \n -> do
+ meterupdate n
+ writeSV v (fromBytesProcessed n)
let cleanup = do
void $ tryIO $ killThread tid
tryNonAsync $
@@ -451,7 +456,7 @@ copyFromRemoteCheap r key file
liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
| Git.repoIsSsh (repo r) =
ifM (Annex.Content.preseedTmp key file)
- ( copyFromRemote' r key Nothing file
+ ( metered Nothing key $ copyFromRemote' r key Nothing file
, return False
)
| otherwise = return False