aboutsummaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-14 16:27:39 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-14 16:40:49 -0400
commita38d1ae1fb3b3d1b42ee5b8ed878d574180c544f (patch)
tree29923061b31bf0a715af34c38cf304dc714f4d5a /Command
parent0298701d0018b0baa933761657751e0c26dc39d1 (diff)
Display progress meter when uploading a key without size information
Getting the size by statting the content file. This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Command')
-rw-r--r--Command/Export.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Command/Export.hs b/Command/Export.hs
index dfa452956..4e1880c13 100644
--- a/Command/Export.hs
+++ b/Command/Export.hs
@@ -215,20 +215,20 @@ performExport r ea db ek af contentsha loc = do
let storer = storeExport ea
sent <- case ek of
AnnexKey k -> ifM (inAnnex k)
- ( metered Nothing k $ \m -> do
- let rollback = void $
- performUnexport r ea db [ek] loc
- notifyTransfer Upload af $
- upload (uuid r) k af noRetry $ \pm -> do
- let m' = combineMeterUpdate pm m
- sendAnnex k rollback
- (\f -> storer f k loc m')
+ ( notifyTransfer Upload af $
+ upload (uuid r) k af noRetry $ \pm -> do
+ let rollback = void $
+ performUnexport r ea db [ek] loc
+ sendAnnex k rollback $ \f ->
+ metered Nothing k (return $ Just f) $ \m -> do
+ let m' = combineMeterUpdate pm m
+ storer f k loc m'
, do
showNote "not available"
return False
)
-- Sending a non-annexed file.
- GitKey sha1k -> metered Nothing sha1k $ \m ->
+ GitKey sha1k -> metered Nothing sha1k (return Nothing) $ \m ->
withTmpFile "export" $ \tmp h -> do
b <- catObject contentsha
liftIO $ L.hPut h b