--inbackend can be used to make git-annex only operate on files whose content is stored using a specified key-value backend.

This commit is contained in:
Joey Hess 2011-11-28 17:37:15 -04:00
parent 16653132b7
commit e32ab766b0
4 changed files with 16 additions and 0 deletions

View file

@ -88,3 +88,10 @@ addCopies num =
handle n (Just (key, _)) = do
us <- keyLocations key
return $ length us >= n
{- Adds a limit to skip files not using a specified key-value backend. -}
addInBackend :: String -> Annex ()
addInBackend name = addLimit $ Backend.lookupFile >=> check
where
wanted = Backend.lookupBackendName name
check = return . maybe False ((==) wanted . snd)