summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 21:00:54 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 21:00:54 -0400
commit89e8441c62b985a6bcf37024fc051e99fbce8e37 (patch)
treeef9d04b7f73633a27c187b472efc5142fde62130 /Annex/Content.hs
parentd77b7936adc49a98172a16a3fea89fb2ad9fd642 (diff)
Display progress meter in -J mode when downloading from the web.
Including in addurl, and get --from web, but also in S3 and External special remotes when a web url is known for content in those remotes.
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 5990d194a..90486f912 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -56,6 +56,7 @@ import qualified Annex.Url as Url
import Types.Key
import Utility.DataUnits
import Utility.CopyFile
+import Utility.Metered
import Config
import Git.SharedRepository
import Annex.Perms
@@ -658,8 +659,11 @@ saveState nocommit = doSideAction $ do
Annex.Branch.commit "update"
{- Downloads content from any of a list of urls. -}
-downloadUrl :: [Url.URLString] -> FilePath -> Annex Bool
-downloadUrl urls file = go =<< annexWebDownloadCommand <$> Annex.getGitConfig
+downloadUrl :: Key -> MeterUpdate -> [Url.URLString] -> FilePath -> Annex Bool
+downloadUrl k p urls file =
+ concurrentMetered (Just p) k $ \p' ->
+ watchFileSize file p' $
+ go =<< annexWebDownloadCommand <$> Annex.getGitConfig
where
go Nothing = do
a <- ifM commandProgressDisabled