make copy --to check preferred content of the remote

This commit is contained in:
Joey Hess 2012-10-08 16:06:56 -04:00
parent 17543f6e80
commit 1eedf495c3
5 changed files with 73 additions and 39 deletions

View file

@ -38,10 +38,6 @@ import Usage as ReExported
import Logs.Trust
import Config
import Annex.CheckAttr
import Logs.PreferredContent
import Git.FilePath
import qualified Data.Set as S
{- Generates a normal command -}
command :: String -> String -> [CommandSeek] -> String -> Command
@ -127,12 +123,7 @@ autoCopies file key vs a = Annex.getState Annex.auto >>= go
numcopiesattr <- numCopies file
needed <- getNumCopies numcopiesattr
(_, have) <- trustPartition UnTrusted =<< Remote.keyLocations key
if length have `vs` needed
then do
fp <- inRepo $ toTopFilePath file
ifM (isPreferredContent Nothing S.empty fp)
( a, stop )
else stop
if length have `vs` needed then a else stop
autoCopiesWith :: FilePath -> Key -> (Int -> Int -> Bool) -> (Maybe Int -> CommandStart) -> CommandStart
autoCopiesWith file key vs a = do