summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-21 14:54:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-21 14:54:24 -0400
commitff32ee515244976961ef0753a5291d212c6138e2 (patch)
tree45a11d75f86e6091fae36000cbb79b43ebc1e769 /Messages.hs
parent226781c047a50747f5c60a6cf4920a43cd3a3a73 (diff)
upload progress tracking for the directory special remote
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Messages.hs b/Messages.hs
index 7f61efb88..d8d84d1ec 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -63,8 +63,8 @@ showProgress = handle q $
{- Shows a progress meter while performing a transfer of a key.
- The action is passed a callback to use to update the meter. -}
-metered :: Key -> (MeterUpdate -> Annex a) -> Annex a
-metered key a = withOutputType $ go (keySize key)
+metered :: (Maybe MeterUpdate) -> Key -> (MeterUpdate -> Annex a) -> Annex a
+metered combinemeterupdate key a = withOutputType $ go (keySize key)
where
go (Just size) NormalOutput = do
progress <- liftIO $ newProgress "" size
@@ -74,6 +74,7 @@ metered key a = withOutputType $ go (keySize key)
r <- a $ \n -> liftIO $ do
incrP progress n
displayMeter stdout meter
+ maybe noop (\m -> m n) combinemeterupdate
liftIO $ clearMeter stdout meter
return r
go _ _ = a (const noop)