mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
revset: added __sub__ mehtod to _addset
This method is intended to duck-type baseset, so we will still have _addset as a private class but now will be able to return it without wrapping it into an orderedlazyset or a lazyset.
This commit is contained in:
parent
02e069f77d
commit
a79e6ad5a0
@ -2419,6 +2419,12 @@ class _addset(object):
|
||||
return orderedlazyset(self, filterfunc, ascending=self._ascending)
|
||||
return lazyset(self, filterfunc)
|
||||
|
||||
def __sub__(self, other):
|
||||
filterfunc = lambda r: r not in other
|
||||
if self._ascending is not None:
|
||||
return orderedlazyset(self, filterfunc, ascending=self._ascending)
|
||||
return lazyset(self, filterfunc)
|
||||
|
||||
def _iterator(self):
|
||||
"""Iterate over both collections without repeating elements
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user