From aff09a1f33be7b3df182a7c85b30a2d3e04833c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Sep 2012 16:08:37 -0400 Subject: 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.. --- Remote/Git.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Remote/Git.hs') diff --git a/Remote/Git.hs b/Remote/Git.hs index 626476c18..46f65ac74 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -262,8 +262,8 @@ copyFromRemoteCheap r key file | otherwise = return False {- Tries to copy a key's content to a remote's annex. -} -copyToRemote :: Git.Repo -> Key -> AssociatedFile -> Annex Bool -copyToRemote r key file +copyToRemote :: Git.Repo -> Key -> AssociatedFile -> ProgressCallback -> Annex Bool +copyToRemote r key file p | not $ Git.repoIsUrl r = guardUsable r False $ commitOnCleanup r $ do keysrc <- inRepo $ gitAnnexLocation key params <- rsyncParams r @@ -276,7 +276,7 @@ copyToRemote r key file download u key file $ Annex.Content.saveState True `after` Annex.Content.getViaTmp key - (rsyncOrCopyFile params keysrc) + (\d -> rsyncOrCopyFile params keysrc d p) ) | Git.repoIsSsh r = commitOnCleanup r $ do keysrc <- inRepo $ gitAnnexLocation key @@ -295,8 +295,8 @@ rsyncHelper p = do {- Copys a file with rsync unless both locations are on the same - filesystem. Then cp could be faster. -} -rsyncOrCopyFile :: [CommandParam] -> FilePath -> FilePath -> Annex Bool -rsyncOrCopyFile rsyncparams src dest = +rsyncOrCopyFile :: [CommandParam] -> FilePath -> FilePath -> ProgressCallback -> Annex Bool +rsyncOrCopyFile rsyncparams src dest p = ifM (sameDeviceIds src dest) ( liftIO $ copyFileExternal src dest , rsyncHelper $ rsyncparams ++ [Param src, Param dest] -- cgit v1.2.3