make --json-progress update meter when getting from git remote with rsync
This commit is contained in:
parent
a108235565
commit
312ef4dfae
2 changed files with 13 additions and 9 deletions
|
@ -74,13 +74,17 @@ metered othermeter key a = case keySize key of
|
||||||
Nothing -> m
|
Nothing -> m
|
||||||
Just om -> combineMeterUpdate m om
|
Just om -> combineMeterUpdate m om
|
||||||
|
|
||||||
{- Use when the progress meter is only desired for concurrent
|
{- Use when the command's own progress output is preferred.
|
||||||
- output; as when a command's own progress output is preferred. -}
|
- The command's output will be suppressed and git-annex's progress output
|
||||||
concurrentMetered :: Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
|
- used for concurrent output, and json progress. -}
|
||||||
concurrentMetered combinemeterupdate key a =
|
commandMetered :: Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
|
||||||
withMessageState $ \s -> if concurrentOutputEnabled s
|
commandMetered combinemeterupdate key a =
|
||||||
then metered combinemeterupdate key a
|
withMessageState $ \s -> case outputType s of
|
||||||
else a (fromMaybe nullMeterUpdate combinemeterupdate)
|
JSONOutput True -> usemeter
|
||||||
|
NormalOutput | concurrentOutputEnabled s -> usemeter
|
||||||
|
_ -> a (fromMaybe nullMeterUpdate combinemeterupdate)
|
||||||
|
where
|
||||||
|
usemeter = metered combinemeterupdate key a
|
||||||
|
|
||||||
{- Poll file size to display meter, but only for concurrent output. -}
|
{- Poll file size to display meter, but only for concurrent output. -}
|
||||||
concurrentMeteredFile :: FilePath -> Maybe MeterUpdate -> Key -> Annex a -> Annex a
|
concurrentMeteredFile :: FilePath -> Maybe MeterUpdate -> Key -> Annex a -> Annex a
|
||||||
|
|
|
@ -421,7 +421,7 @@ copyFromRemote :: Remote -> Key -> AssociatedFile -> FilePath -> MeterUpdate ->
|
||||||
copyFromRemote r key file dest p
|
copyFromRemote r key file dest p
|
||||||
| Git.repoIsHttp (repo r) = unVerified $
|
| Git.repoIsHttp (repo r) = unVerified $
|
||||||
Annex.Content.downloadUrl key p (keyUrls r key) dest
|
Annex.Content.downloadUrl key p (keyUrls r key) dest
|
||||||
| otherwise = concurrentMetered (Just p) key $
|
| otherwise = commandMetered (Just p) key $
|
||||||
copyFromRemote' r key file dest
|
copyFromRemote' r key file dest
|
||||||
|
|
||||||
copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex (Bool, Verification)
|
copyFromRemote' :: Remote -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex (Bool, Verification)
|
||||||
|
@ -531,7 +531,7 @@ 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 meterupdate =
|
copyToRemote r key file meterupdate =
|
||||||
concurrentMetered (Just meterupdate) key $
|
commandMetered (Just meterupdate) key $
|
||||||
copyToRemote' r key file
|
copyToRemote' r key file
|
||||||
|
|
||||||
copyToRemote' :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
copyToRemote' :: Remote -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue