diff options
author | 2012-09-19 16:08:37 -0400 | |
---|---|---|
committer | 2012-09-19 16:08:37 -0400 | |
commit | aff09a1f33be7b3df182a7c85b30a2d3e04833c7 (patch) | |
tree | 6d7cb4ed4e9483c14bdd832c9af848dc1b866789 /Remote/Hook.hs | |
parent | 3c81d70c1beccb50571281ef35c9123bac006b7c (diff) |
add a progress callback to storeKey, and threaded it all the way through
Transfer info files are updated when the callback is called, updating
the number of bytes transferred.
Left unused p variables at every place the callback should be used.
Which is rather a lot..
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r-- | Remote/Hook.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs index c73a8deb8..cf0425590 100644 --- a/Remote/Hook.hs +++ b/Remote/Hook.hs @@ -103,13 +103,13 @@ runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype h return False ) -store :: String -> Key -> AssociatedFile -> Annex Bool -store h k _f = do +store :: String -> Key -> AssociatedFile -> ProgressCallback -> Annex Bool +store h k _f _p = do src <- inRepo $ gitAnnexLocation k runHook h "store" k (Just src) $ return True -storeEncrypted :: String -> (Cipher, Key) -> Key -> Annex Bool -storeEncrypted h (cipher, enck) k = withTmp enck $ \tmp -> do +storeEncrypted :: String -> (Cipher, Key) -> Key -> ProgressCallback -> Annex Bool +storeEncrypted h (cipher, enck) k _p = withTmp enck $ \tmp -> do src <- inRepo $ gitAnnexLocation k liftIO $ withEncryptedContent cipher (L.readFile src) $ L.writeFile tmp runHook h "store" enck (Just tmp) $ return True |