summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-02 01:31:10 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-02 01:31:10 -0400
commitbea0ac0274861f639ef999b146a719f4300fbfe4 (patch)
treebd1bf0d171f83667da918850e6b653c288031d30 /Logs
parentd1f49b0ad032f13adc39d963cc8ceca28215b1d5 (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.hs7
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.