From 6c31e3a8c3c5ab92ca2e84b4c166f32d02a50f4f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Oct 2011 17:26:38 -0400 Subject: drop --from is now supported to remove file content from a remote. --- Remote.hs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Remote.hs') diff --git a/Remote.hs b/Remote.hs index 49fa63cf9..6ce4fe018 100644 --- a/Remote.hs +++ b/Remote.hs @@ -25,7 +25,8 @@ module Remote ( nameToUUID, showTriedRemotes, showLocations, - forceTrust + forceTrust, + remoteHasKey ) where import qualified Data.Map as M @@ -225,3 +226,15 @@ forceTrust level remotename = do r <- nameToUUID remotename Annex.changeState $ \s -> s { Annex.forcetrust = (r, level):Annex.forcetrust s } + +{- Used to log a change in a remote's having a key. The change is logged + - in the local repo, not on the remote. The process of transferring the + - key to the remote, or removing the key from it *may* log the change + - on the remote, but this cannot always be relied on. -} +remoteHasKey :: Remote Annex -> Key -> Bool -> Annex () +remoteHasKey remote key present = do + let remoteuuid = uuid remote + g <- gitRepo + logChange g key remoteuuid status + where + status = if present then InfoPresent else InfoMissing -- cgit v1.2.3