changeset 17363:5d9e2031c0b1 stable

fileset: actually implement 'minusset' $ hg debugfileset 'a* - a1' was tracing back because 'minus' symbol was not supported.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 15 Aug 2012 19:02:04 +0200
parents bd867a9ca510
children 0c41fb2d972a
files mercurial/fileset.py tests/test-fileset.t
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Wed Aug 15 17:39:03 2012 +0200
+++ b/mercurial/fileset.py	Wed Aug 15 19:02:04 2012 +0200
@@ -107,6 +107,11 @@
     s = set(getset(mctx, x))
     return [r for r in mctx.subset if r not in s]
 
+def minusset(mctx, x, y):
+    xl = getset(mctx, x)
+    yl = set(getset(mctx, y))
+    return [f for f in xl if f not in yl]
+
 def listset(mctx, a, b):
     raise error.ParseError(_("can't use a list in this context"))
 
@@ -406,6 +411,7 @@
     'symbol': stringset,
     'and': andset,
     'or': orset,
+    'minus': minusset,
     'list': listset,
     'group': getset,
     'not': notset,
--- a/tests/test-fileset.t	Wed Aug 15 17:39:03 2012 +0200
+++ b/tests/test-fileset.t	Wed Aug 15 19:02:04 2012 +0200
@@ -36,4 +36,6 @@
   b1
   $ fileset '! ("a*")'
   b1
+  $ fileset 'a* - a1'
+  a2