summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-29 17:17:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-29 17:18:49 -0400
commite55bc5640997362f1f77a5423f7556b307377f61 (patch)
tree84971796a95bfad3f2867e70ae83eb856d1bdaad /Annex/Content.hs
parent99e69a42d1afc02c381657e82547dfcc9f2a6ae2 (diff)
allow Retriever action to update the progress meter
Needed for eg, Remote.External. Generally, any Retriever that stores content in a file is responsible for updating the meter, while ones that procude a lazy bytestring cannot update the meter, so are not asked to.
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 8ad3d5e65..6975f322f 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -264,7 +264,10 @@ prepTmp key = do
createAnnexDirectory (parentDir tmp)
return tmp
-{- Creates a temp file, runs an action on it, and cleans up the temp file. -}
+{- Creates a temp file for a key, runs an action on it, and cleans up
+ - the temp file. If the action throws an exception, the temp file is
+ - left behind, which allows for resuming.
+ -}
withTmp :: Key -> (FilePath -> Annex a) -> Annex a
withTmp key action = do
tmp <- prepTmp key