revset: added basic operators to orderedlazyset
Now __and__ and __sub__ return orderedlazyset.
--- a/mercurial/revset.py Thu Feb 06 09:28:41 2014 -0800
+++ b/mercurial/revset.py Thu Feb 06 17:42:08 2014 -0800
@@ -2227,6 +2227,14 @@
def filter(self, l):
return orderedlazyset(self, l, ascending=self._ascending)
+ def __and__(self, x):
+ return orderedlazyset(self, lambda r: r in x,
+ ascending=self._ascending)
+
+ def __sub__(self, x):
+ return orderedlazyset(self, lambda r: r not in x,
+ ascending=self._ascending)
+
class generatorset(object):
"""Wrapper structure for generators that provides lazy membership and can
be iterated more than once.