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..
This commit is contained in:
parent
1ac36f1933
commit
7943442dff
3 changed files with 17 additions and 9 deletions
|
@ -440,10 +440,10 @@ copyFromRemote' r key file dest meterupdate
|
||||||
copier <- mkCopier hardlink params
|
copier <- mkCopier hardlink params
|
||||||
runTransfer (Transfer Download u key)
|
runTransfer (Transfer Download u key)
|
||||||
file noRetry noObserver
|
file noRetry noObserver
|
||||||
(\p -> copier object dest p checksuccess)
|
(\p -> copier object dest (combineMeterUpdate p meterupdate) checksuccess)
|
||||||
| Git.repoIsSsh (repo r) = unVerified $ feedprogressback $ \feeder -> do
|
| Git.repoIsSsh (repo r) = unVerified $ feedprogressback $ \p -> do
|
||||||
direct <- isDirect
|
direct <- isDirect
|
||||||
Ssh.rsyncHelper (Just feeder)
|
Ssh.rsyncHelper (Just (combineMeterUpdate meterupdate p))
|
||||||
=<< Ssh.rsyncParamsRemote direct r Download key dest file
|
=<< Ssh.rsyncParamsRemote direct r Download key dest file
|
||||||
| Git.repoIsHttp (repo r) = unVerified $ Annex.Content.downloadUrl (keyUrls r key) dest
|
| Git.repoIsHttp (repo r) = unVerified $ Annex.Content.downloadUrl (keyUrls r key) dest
|
||||||
| otherwise = error "copying from non-ssh, non-http remote not supported"
|
| 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. -}
|
{- Tries to copy a key's content to a remote's annex. -}
|
||||||
copyToRemote :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
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' :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
||||||
copyToRemote' r key file p
|
copyToRemote' r key file meterupdate
|
||||||
| not $ Git.repoIsUrl (repo r) =
|
| not $ Git.repoIsUrl (repo r) =
|
||||||
guardUsable (repo r) (return False) $ commitOnCleanup r $
|
guardUsable (repo r) (return False) $ commitOnCleanup r $
|
||||||
copylocal =<< Annex.Content.prepSendAnnex key
|
copylocal =<< Annex.Content.prepSendAnnex key
|
||||||
| Git.repoIsSsh (repo r) = commitOnCleanup r $
|
| Git.repoIsSsh (repo r) = commitOnCleanup r $
|
||||||
Annex.Content.sendAnnex key noop $ \object -> do
|
Annex.Content.sendAnnex key noop $ \object -> do
|
||||||
direct <- isDirect
|
direct <- isDirect
|
||||||
Ssh.rsyncHelper (Just p)
|
Ssh.rsyncHelper (Just meterupdate)
|
||||||
=<< Ssh.rsyncParamsRemote direct r Upload key object file
|
=<< Ssh.rsyncParamsRemote direct r Upload key object file
|
||||||
| otherwise = error "copying to non-ssh repo not supported"
|
| otherwise = error "copying to non-ssh repo not supported"
|
||||||
where
|
where
|
||||||
|
@ -563,10 +565,11 @@ copyToRemote' r key file p
|
||||||
ensureInitialized
|
ensureInitialized
|
||||||
copier <- mkCopier hardlink params
|
copier <- mkCopier hardlink params
|
||||||
let verify = Annex.Content.RemoteVerify r
|
let verify = Annex.Content.RemoteVerify r
|
||||||
runTransfer (Transfer Download u key) file noRetry noObserver $ const $
|
runTransfer (Transfer Download u key) file noRetry noObserver $ \p ->
|
||||||
Annex.Content.saveState True `after`
|
let p' = combineMeterUpdate meterupdate p
|
||||||
|
in Annex.Content.saveState True `after`
|
||||||
Annex.Content.getViaTmp verify key
|
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)
|
fsckOnRemote :: Git.Repo -> [CommandParam] -> Annex (IO Bool)
|
||||||
|
|
|
@ -29,6 +29,9 @@ type MeterUpdate = (BytesProcessed -> IO ())
|
||||||
nullMeterUpdate :: MeterUpdate
|
nullMeterUpdate :: MeterUpdate
|
||||||
nullMeterUpdate _ = return ()
|
nullMeterUpdate _ = return ()
|
||||||
|
|
||||||
|
combineMeterUpdate :: MeterUpdate -> MeterUpdate -> MeterUpdate
|
||||||
|
combineMeterUpdate a b = \n -> a n >> b n
|
||||||
|
|
||||||
{- Total number of bytes processed so far. -}
|
{- Total number of bytes processed so far. -}
|
||||||
newtype BytesProcessed = BytesProcessed Integer
|
newtype BytesProcessed = BytesProcessed Integer
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -1,6 +1,8 @@
|
||||||
git-annex (5.20151117) UNRELEASED; urgency=medium
|
git-annex (5.20151117) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Build with -j1 again to get reproducible build.
|
* Build with -j1 again to get reproducible build.
|
||||||
|
* Display progress meter in -J mode when copying from a local git repo,
|
||||||
|
to a local git repo, and from a remote git repo.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Mon, 16 Nov 2015 16:49:34 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 16 Nov 2015 16:49:34 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue