diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-19 16:08:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-19 16:08:37 -0400 |
commit | aff09a1f33be7b3df182a7c85b30a2d3e04833c7 (patch) | |
tree | 6d7cb4ed4e9483c14bdd832c9af848dc1b866789 /Remote/Git.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/Git.hs')
-rw-r--r-- | Remote/Git.hs | 10 |
1 files changed, 5 insertions, 5 deletions
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] |