Comments
Patch
@@ -2092,6 +2092,9 @@
l = [r for r in x if r not in s]
return baseset(list(self) + l)
+ def filter(self, l):
+ return lazyset(self, l)
+
class lazyset(object):
"""Duck type for baseset class which iterates lazily over the revisions in
the subset and contains a function which tests for membership in the
@@ -2147,11 +2150,16 @@
def set(self):
return set([r for r in self])
+ def filter(self, l):
+ return lazyset(self, l)
+
class asclazyset(lazyset):
- pass
+ def filter(self, l):
+ return asclazyset(self, l)
class desclazyset(lazyset):
- pass
+ def filter(self, l):
+ return desclazyset(self, l)
class generatorset(object):
def __init__(self, gen):
@@ -2298,5 +2306,11 @@
def set(self):
return self
+ def filter(self, l):
+ if self._start <= self._end:
+ return asclazyset(self, l)
+ else:
+ return desclazyset(self, l)
+
# tell hggettext to extract docstrings from these functions:
i18nfunctions = symbols.values()