##// END OF EJS Templates
revset: changed smartset methods to return ordered addsets...
Lucas Moscovicz -
r20734:4d27c30d default
parent child Browse files
Show More
@@ -2283,7 +2283,7 b' class lazyset(object):'
2283 2283 return lazyset(self, lambda r: r not in x)
2284 2284
2285 2285 def __add__(self, x):
2286 return lazyset(_addset(self, x))
2286 return _addset(self, x)
2287 2287
2288 2288 def __nonzero__(self):
2289 2289 for r in self:
@@ -2347,6 +2347,14 b' class orderedlazyset(lazyset):'
2347 2347 return orderedlazyset(self, lambda r: r not in x,
2348 2348 ascending=self._ascending)
2349 2349
2350 def __add__(self, x):
2351 kwargs = {}
2352 if self.isascending() and x.isascending():
2353 kwargs['ascending'] = True
2354 if self.isdescending() and x.isdescending():
2355 kwargs['ascending'] = False
2356 return _addset(self, x, **kwargs)
2357
2350 2358 def sort(self, reverse=False):
2351 2359 if reverse:
2352 2360 if self._ascending:
@@ -2694,7 +2702,12 b' class spanset(object):'
2694 2702 return orderedlazyset(self, lambda r: r not in x, ascending=False)
2695 2703
2696 2704 def __add__(self, x):
2697 return lazyset(_addset(self, x))
2705 kwargs = {}
2706 if self.isascending() and x.isascending():
2707 kwargs['ascending'] = True
2708 if self.isdescending() and x.isdescending():
2709 kwargs['ascending'] = False
2710 return _addset(self, x, **kwargs)
2698 2711
2699 2712 def __len__(self):
2700 2713 if not self._hiddenrevs:
General Comments 0
You need to be logged in to leave comments. Login now