diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-02 01:31:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-02 01:31:10 -0400 |
commit | bea0ac0274861f639ef999b146a719f4300fbfe4 (patch) | |
tree | bd1bf0d171f83667da918850e6b653c288031d30 /Logs | |
parent | d1f49b0ad032f13adc39d963cc8ceca28215b1d5 (diff) |
record transfers for git-annex-shell
Not yet tested and places git-annex-shell is run need to be modified to
pass the new field settings.
Note that rsyncServerSend was changed to fork, rather than directly exec
rsync, because it needs to keep the transfer lock held, and clean up the
transfer log when done.
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/Transfer.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs index 526241f93..658e18b5d 100644 --- a/Logs/Transfer.hs +++ b/Logs/Transfer.hs @@ -10,6 +10,7 @@ module Logs.Transfer where import Common.Annex import Annex.Perms import Annex.Exception +import qualified Annex import qualified Git import Types.Remote @@ -54,6 +55,12 @@ upload u key file a = transfer (Transfer Upload u key) file a download :: UUID -> Key -> AssociatedFile -> Annex a -> Annex a download u key file a = transfer (Transfer Download u key) file a +fieldTransfer :: Direction -> Key -> Annex a -> Annex a +fieldTransfer direction key a = do + afile <- Annex.getField "associatedfile" + maybe a (\u -> transfer (Transfer direction (toUUID u) key) afile a) + =<< Annex.getField "remoteuuid" + {- Runs a transfer action. Creates and locks the transfer information file - while the action is running. Will throw an error if the transfer is - already in progress. |