##// END OF EJS Templates
revset: made addset a private class...
Lucas Moscovicz -
r20708:17c89e5a default
parent child Browse files
Show More
@@ -2236,7 +2236,7 b' class lazyset(object):'
2236 return lazyset(self, lambda r: r not in x)
2236 return lazyset(self, lambda r: r not in x)
2237
2237
2238 def __add__(self, x):
2238 def __add__(self, x):
2239 return lazyset(addset(self, x))
2239 return lazyset(_addset(self, x))
2240
2240
2241 def __nonzero__(self):
2241 def __nonzero__(self):
2242 for r in self:
2242 for r in self:
@@ -2307,9 +2307,14 b' class orderedlazyset(lazyset):'
2307 self._subset.reverse()
2307 self._subset.reverse()
2308 self._ascending = not self._ascending
2308 self._ascending = not self._ascending
2309
2309
2310 class addset(object):
2310 class _addset(object):
2311 """Wrapper structure for lazily adding two structures without losing much
2311 """Represent the addition of two sets
2312
2313 Wrapper structure for lazily adding two structures without losing much
2312 performance on the __contains__ method
2314 performance on the __contains__ method
2315
2316 This class does not duck-type baseset and it's only supposed to be used
2317 internally
2313 """
2318 """
2314 def __init__(self, revs1, revs2):
2319 def __init__(self, revs1, revs2):
2315 self._r1 = revs1
2320 self._r1 = revs1
@@ -2495,7 +2500,7 b' class spanset(object):'
2495 return orderedlazyset(self, lambda r: r not in x, ascending=False)
2500 return orderedlazyset(self, lambda r: r not in x, ascending=False)
2496
2501
2497 def __add__(self, x):
2502 def __add__(self, x):
2498 return lazyset(addset(self, x))
2503 return lazyset(_addset(self, x))
2499
2504
2500 def __len__(self):
2505 def __len__(self):
2501 if not self._hiddenrevs:
2506 if not self._hiddenrevs:
General Comments 0
You need to be logged in to leave comments. Login now