summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 17:03:34 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 17:03:34 -0400
commit88167b18de65eab818324de2e59a8879cce02a81 (patch)
tree79bf41bb1bb8b671d7c30be79724be73cd6592aa
parent712deee42b122f0ec07866e6bd7770343cee971c (diff)
Added new "anything" preferred content expression, which matches all versions of all files.
-rw-r--r--Annex/FileMatcher.hs1
-rw-r--r--Limit.hs4
-rw-r--r--debian/changelog4
-rw-r--r--doc/preferred_content.mdwn13
4 files changed, 18 insertions, 4 deletions
diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs
index 9677e65dd..8b0db60ad 100644
--- a/Annex/FileMatcher.hs
+++ b/Annex/FileMatcher.hs
@@ -74,6 +74,7 @@ parseToken matchstandard matchgroupwanted checkpresent checkpreferreddir groupma
| t == "present" = use checkpresent
| t == "inpreferreddir" = use checkpreferreddir
| t == "unused" = Right $ Operation limitUnused
+ | t == "anything" = Right $ Operation limitAnything
| otherwise = maybe (Left $ "near " ++ show t) use $ M.lookup k $
M.fromList
[ ("include", limitInclude)
diff --git a/Limit.hs b/Limit.hs
index c412637bb..da9b6a155 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -193,6 +193,10 @@ limitUnused :: MatchFiles Annex
limitUnused _ (MatchingFile _) = return False
limitUnused _ (MatchingKey k) = S.member k <$> unusedKeys
+{- Limit that matches any version of any file. -}
+limitAnything :: MatchFiles Annex
+limitAnything _ _ = return True
+
{- Adds a limit to skip files not believed to be present in all
- repositories in the specified group. -}
addInAllGroup :: String -> Annex ()
diff --git a/debian/changelog b/debian/changelog
index 3264bee9f..5bf1b4c96 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-git-annex (5.20150529) UNRELEASED; urgency=medium
+git-annex (5.20150616) UNRELEASED; urgency=medium
* fromkey, registerurl: Improve handling of urls that happen to also
be parsable as strange keys.
@@ -35,6 +35,8 @@ git-annex (5.20150529) UNRELEASED; urgency=medium
* info: Added json output for "backend usage", "numcopies stats",
"repositories containing these files", and "transfers in progress".
* sync: Add support for --all and --unused.
+ * Added new "anything" preferred content expression, which matches all
+ versions of all files.
-- Joey Hess <id@joeyh.name> Sat, 30 May 2015 02:07:18 -0400
diff --git a/doc/preferred_content.mdwn b/doc/preferred_content.mdwn
index 9b9b399a1..e285a6a7c 100644
--- a/doc/preferred_content.mdwn
+++ b/doc/preferred_content.mdwn
@@ -174,9 +174,10 @@ The --unused option makes git-annex operate on every key that `git annex
unused` has determined to be unused. The corresponding `unused` keyword
in a preferred content expression also matches those keys.
-However, the latter doesn't make git-annex consider those keys. So
-when git-annex is only checking preferred content expressions against files
-in the repository (which are obviously used), `unused` in a preferred
+However, using `unused` in a preferred content expression
+doesn't make git-annex consider those keys. So when git-annex is
+only checking preferred content expressions against files in the
+repository (which are obviously used), `unused` in a preferred
content expression won't match anything.
So when is `unused` useful in a preferred content expression?
@@ -189,6 +190,11 @@ So when is `unused` useful in a preferred content expression?
including unused ones, and take `unused` in preferred content expressions
into account.
+### difference: anything
+
+The "anything" keyword can be used in a preferred content expression
+to match any version of any file.
+
## upgrades
It's important that all clones of a repository can understand one-another's
@@ -205,6 +211,7 @@ it assumes all files that are currently present are preferred content.
Here are recent changes to preferred content expressions, and the version
they were added in.
+* "anything" 5.20150616
* "standard" 5.20140314
(only when used in a more complicated expression; "standard" by
itself has been supported for a long time)