--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

@ -111,6 +111,8 @@ options = commonOptions ++
"skip files not present in a remote"
, Option ['C'] ["copies"] (ReqArg Limit.addCopies paramNumber)
"skip files with fewer copies"
, Option ['B'] ["inbackend"] (ReqArg Limit.addInBackend paramName)
"skip files not using a key-value backend"
] ++ matcherOptions
where
setto v = Annex.changeState $ \s -> s { Annex.toremote = Just v }

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)

2
debian/changelog vendored
View file

@ -8,6 +8,8 @@ git-annex (3.20111123) UNRELEASED; urgency=low
* Bugfix: dropunused did not drop keys with two spaces in their name.
* Support for storing .git/annex on a different device than the rest of the
git repository.
* --inbackend can be used to make git-annex only operate on files
whose content is stored using a specified key-value backend.
-- Joey Hess <joeyh@debian.org> Tue, 22 Nov 2011 17:53:42 -0400

View file

@ -446,6 +446,11 @@ file contents are present at either of two repositories.
Matches only files that git-annex believes to have the specified number
of copies, or more.
* --inbackend=name
Matches only files whose content is stored using the specified key-value
backend.
* --not
Inverts the next file matching option. For example, to only act on