stop displaying rsync progress, and use git-annex's own progress display for local-to-local repo transfers

Reasons to do this include:

1. I've gotten pretty used to git-annex's own progress display, which is
   used for all transfers over ssh (except to old git-annex-shell),
   and for most special remote transfers. It's getting to seem weird to see
   the rsync progress display instead.
2. When -J was used, the rsync output could not be shown, and so there was
   no progress display. Now there will be.

Progress will also be displayed now when cp CoW is used. But I'd expect a CoW
copy to typically run so fast that the progress display will barely be
noticable.

This commit was sponsored by Peter on Patreon.
This commit is contained in:
Joey Hess 2019-11-15 12:01:30 -04:00
parent 85c5e51c53
commit cee14f147a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 17 additions and 9 deletions

View file

@ -1,3 +1,10 @@
git-annex (7.20191115) UNRELEASED; urgency=medium
* Stop displaying rsync progress, and use git-annex's own progress display
for local-to-local repo transfers.
-- Joey Hess <id@joeyh.name> Fri, 15 Nov 2019 11:57:19 -0400
git-annex (7.20191114) upstream; urgency=medium
* Added annex.allowsign option.

View file

@ -497,8 +497,9 @@ copyFromRemote'' repo forcersync r st@(State connpool _ _ _) key file dest meter
Just (object, checksuccess) -> do
copier <- mkCopier hardlink st params
runTransfer (Transfer Download u key)
file stdRetry
(\p -> copier object dest (combineMeterUpdate p meterupdate) checksuccess)
file stdRetry $ \p ->
metered (Just (combineMeterUpdate p meterupdate)) key $ \_ p' ->
copier object dest p' checksuccess
| Git.repoIsSsh repo = if forcersync
then fallback meterupdate
else P2PHelper.retrieve
@ -631,15 +632,15 @@ copyToRemote' repo r st@(State connpool duc _ _) key file meterupdate
-- run copy from perspective of remote
onLocalFast repo r $ ifM (Annex.Content.inAnnex key)
( return True
, do
, runTransfer (Transfer Download u key) file stdRetry $ \p -> do
copier <- mkCopier hardlink st params
let verify = Annex.Content.RemoteVerify r
let rsp = RetrievalAllKeysSecure
runTransfer (Transfer Download u key) file stdRetry $ \p ->
let p' = combineMeterUpdate meterupdate p
in Annex.Content.saveState True `after`
Annex.Content.getViaTmp rsp verify key
(\dest -> copier object dest p' (liftIO checksuccessio))
res <- Annex.Content.getViaTmp rsp verify key $ \dest ->
metered (Just (combineMeterUpdate meterupdate p)) key $ \_ p' ->
copier object dest p' (liftIO checksuccessio)
Annex.Content.saveState True
return res
)
copyremotefallback p = Annex.Content.sendAnnex key noop $ \object -> do
-- This is too broad really, but recvkey normally
@ -749,7 +750,7 @@ rsyncOrCopyFile st rsyncparams src dest p =
dorsync = do
-- dest may already exist, so make sure rsync can write to it
void $ liftIO $ tryIO $ allowWrite dest
oh <- mkOutputHandler
oh <- mkOutputHandlerQuiet
Ssh.rsyncHelper oh (Just p) $
rsyncparams ++ [File src, File dest]
docopycow = docopywith copyCoW