mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
revset: added basic operations to lazyset
Added methods __add__, __sub__ and __and__ to duck type more methods in baseset
This commit is contained in:
parent
939eba25eb
commit
dd14a88eaa
@ -2090,5 +2090,15 @@ class lazyset(object):
|
|||||||
if cond(x):
|
if cond(x):
|
||||||
yield x
|
yield x
|
||||||
|
|
||||||
|
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([r for r in self])
|
||||||
|
return l + baseset(x)
|
||||||
|
|
||||||
# tell hggettext to extract docstrings from these functions:
|
# tell hggettext to extract docstrings from these functions:
|
||||||
i18nfunctions = symbols.values()
|
i18nfunctions = symbols.values()
|
||||||
|
Loading…
Reference in New Issue
Block a user