diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-28 17:26:38 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-28 17:26:38 -0400 |
commit | 6c31e3a8c3c5ab92ca2e84b4c166f32d02a50f4f (patch) | |
tree | 8f0b857728feca852c7907c2dcb552ff87e8c582 /Remote.hs | |
parent | 33e18d3d02865ac0677fc1f22de2352b92f184a8 (diff) |
drop --from is now supported to remove file content from a remote.
Diffstat (limited to 'Remote.hs')
-rw-r--r-- | Remote.hs | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 |