From bea0ac0274861f639ef999b146a719f4300fbfe4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 Jul 2012 01:31:10 -0400 Subject: 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. --- Logs/Transfer.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Logs/Transfer.hs') 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. -- cgit v1.2.3