--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:
parent
16653132b7
commit
e32ab766b0
4 changed files with 16 additions and 0 deletions
|
@ -111,6 +111,8 @@ options = commonOptions ++
|
||||||
"skip files not present in a remote"
|
"skip files not present in a remote"
|
||||||
, Option ['C'] ["copies"] (ReqArg Limit.addCopies paramNumber)
|
, Option ['C'] ["copies"] (ReqArg Limit.addCopies paramNumber)
|
||||||
"skip files with fewer copies"
|
"skip files with fewer copies"
|
||||||
|
, Option ['B'] ["inbackend"] (ReqArg Limit.addInBackend paramName)
|
||||||
|
"skip files not using a key-value backend"
|
||||||
] ++ matcherOptions
|
] ++ matcherOptions
|
||||||
where
|
where
|
||||||
setto v = Annex.changeState $ \s -> s { Annex.toremote = Just v }
|
setto v = Annex.changeState $ \s -> s { Annex.toremote = Just v }
|
||||||
|
|
7
Limit.hs
7
Limit.hs
|
@ -88,3 +88,10 @@ addCopies num =
|
||||||
handle n (Just (key, _)) = do
|
handle n (Just (key, _)) = do
|
||||||
us <- keyLocations key
|
us <- keyLocations key
|
||||||
return $ length us >= n
|
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
2
debian/changelog
vendored
|
@ -8,6 +8,8 @@ git-annex (3.20111123) UNRELEASED; urgency=low
|
||||||
* Bugfix: dropunused did not drop keys with two spaces in their name.
|
* 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
|
* Support for storing .git/annex on a different device than the rest of the
|
||||||
git repository.
|
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
|
-- Joey Hess <joeyh@debian.org> Tue, 22 Nov 2011 17:53:42 -0400
|
||||||
|
|
||||||
|
|
|
@ -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
|
Matches only files that git-annex believes to have the specified number
|
||||||
of copies, or more.
|
of copies, or more.
|
||||||
|
|
||||||
|
* --inbackend=name
|
||||||
|
|
||||||
|
Matches only files whose content is stored using the specified key-value
|
||||||
|
backend.
|
||||||
|
|
||||||
* --not
|
* --not
|
||||||
|
|
||||||
Inverts the next file matching option. For example, to only act on
|
Inverts the next file matching option. For example, to only act on
|
||||||
|
|
Loading…
Reference in a new issue