diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-08 15:34:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-08 15:34:44 -0400 |
commit | 98612f75ffee93be2973fd444948314dd1b7f822 (patch) | |
tree | dc1a11d66122fb5f9f36ce6d3654d28168e0e196 /Command.hs | |
parent | c452c70ef88197b152c1552563daa6a79e88e91f (diff) |
drop --auto --from with preferred content
With --from, it needs to examine the preferred content of the repository
being dropped from, instead of the local repository.
Diffstat (limited to 'Command.hs')
-rw-r--r-- | Command.hs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Command.hs b/Command.hs index af38d01ed..55892225b 100644 --- a/Command.hs +++ b/Command.hs @@ -21,7 +21,7 @@ module Command ( isBareRepo, numCopies, autoCopies, - autoCopiesDrop, + autoCopiesWith, module ReExported ) where @@ -40,7 +40,6 @@ import Config import Annex.CheckAttr import Logs.PreferredContent import Git.FilePath -import Annex.UUID import qualified Data.Set as S @@ -135,13 +134,8 @@ autoCopies file key vs a = Annex.getState Annex.auto >>= go ( a, stop ) else stop -{- For dropping, supplies the number of known copies to the action. - - - - In auto mode, checks the number of known copies. - - Also, checks if the repo would prefer to retain the content. - -} -autoCopiesDrop :: FilePath -> Key -> (Int -> Int -> Bool) -> (Maybe Int -> CommandStart) -> CommandStart -autoCopiesDrop file key vs a = do +autoCopiesWith :: FilePath -> Key -> (Int -> Int -> Bool) -> (Maybe Int -> CommandStart) -> CommandStart +autoCopiesWith file key vs a = do numcopiesattr <- numCopies file Annex.getState Annex.auto >>= auto numcopiesattr where @@ -150,9 +144,5 @@ autoCopiesDrop file key vs a = do needed <- getNumCopies numcopiesattr (_, have) <- trustPartition UnTrusted =<< Remote.keyLocations key if length have `vs` needed - then do - fp <- inRepo $ toTopFilePath file - u <- getUUID - ifM (isPreferredContent (Just u) (S.singleton u) fp) - ( stop, a numcopiesattr ) + then a numcopiesattr else stop |