revset: added basic operations to spanset
Added methods __add__, __sub__ and __and__ to duck type more methods in
baseset
--- a/mercurial/revset.py Wed Feb 12 10:16:21 2014 -0800
+++ b/mercurial/revset.py Wed Feb 12 10:22:43 2014 -0800
@@ -2149,5 +2149,15 @@
return (x <= self._start and x > self._end) or (x >= self._start and x<
self._end)
+ def __and__(self, x):
+ return lazyset(self, lambda r: r in x)
+
+ def __sub__(self, x):
+ return lazyset(self, lambda r: r not in x)
+
+ def __add__(self, x):
+ l = baseset(self)
+ return l + baseset(x)
+
# tell hggettext to extract docstrings from these functions:
i18nfunctions = symbols.values()