summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 19:32:30 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 19:32:30 -0400
commit5e7fe9663d2ced9c62d1d9b1a5c704dcde3c0492 (patch)
tree87d1e08f9ac50b17f470d8f2d8ea72c8dfb151ef /Remote
parentaff42e84c3940a4968ed7e740bd1b1494ef63c45 (diff)
Display progress meter in -J mode when copying from a local git repo, to a local git repo, and from a remote git repo.
Had everything available, just didn't combine the progress meter with the other places progress is sent to update it. (And to a remote repo already did show progress.) Most special remotes should already display progress meters with -J, same as without it. One exception to this is the web, since it relies on wget/curl progress display without -J. Still todo..
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs21
1 files changed, 12 insertions, 9 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index c8ef1aee0..46b571a2e 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -440,10 +440,10 @@ copyFromRemote' r key file dest meterupdate
copier <- mkCopier hardlink params
runTransfer (Transfer Download u key)
file noRetry noObserver
- (\p -> copier object dest p checksuccess)
- | Git.repoIsSsh (repo r) = unVerified $ feedprogressback $ \feeder -> do
+ (\p -> copier object dest (combineMeterUpdate p meterupdate) checksuccess)
+ | Git.repoIsSsh (repo r) = unVerified $ feedprogressback $ \p -> do
direct <- isDirect
- Ssh.rsyncHelper (Just feeder)
+ Ssh.rsyncHelper (Just (combineMeterUpdate meterupdate p))
=<< Ssh.rsyncParamsRemote direct r Download key dest file
| Git.repoIsHttp (repo r) = unVerified $ Annex.Content.downloadUrl (keyUrls r key) dest
| otherwise = error "copying from non-ssh, non-http remote not supported"
@@ -533,17 +533,19 @@ copyFromRemoteCheap _ _ _ _ = return False
{- Tries to copy a key's content to a remote's annex. -}
copyToRemote :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
-copyToRemote r key file p = concurrentMetered (Just p) key file $ copyToRemote' r key file
+copyToRemote r key file meterupdate =
+ concurrentMetered (Just meterupdate) key file $
+ copyToRemote' r key file
copyToRemote' :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
-copyToRemote' r key file p
+copyToRemote' r key file meterupdate
| not $ Git.repoIsUrl (repo r) =
guardUsable (repo r) (return False) $ commitOnCleanup r $
copylocal =<< Annex.Content.prepSendAnnex key
| Git.repoIsSsh (repo r) = commitOnCleanup r $
Annex.Content.sendAnnex key noop $ \object -> do
direct <- isDirect
- Ssh.rsyncHelper (Just p)
+ Ssh.rsyncHelper (Just meterupdate)
=<< Ssh.rsyncParamsRemote direct r Upload key object file
| otherwise = error "copying to non-ssh repo not supported"
where
@@ -563,10 +565,11 @@ copyToRemote' r key file p
ensureInitialized
copier <- mkCopier hardlink params
let verify = Annex.Content.RemoteVerify r
- runTransfer (Transfer Download u key) file noRetry noObserver $ const $
- Annex.Content.saveState True `after`
+ runTransfer (Transfer Download u key) file noRetry noObserver $ \p ->
+ let p' = combineMeterUpdate meterupdate p
+ in Annex.Content.saveState True `after`
Annex.Content.getViaTmp verify key
- (\dest -> copier object dest p (liftIO checksuccessio))
+ (\dest -> copier object dest p' (liftIO checksuccessio))
)
fsckOnRemote :: Git.Repo -> [CommandParam] -> Annex (IO Bool)