revset: changed methods in spanset to return ordered sets
Now __sub__ and __and__ can smartly return ordered lazysets.
--- a/mercurial/revset.py Tue Feb 25 10:36:23 2014 -0800
+++ b/mercurial/revset.py Tue Feb 18 13:07:08 2014 -0800
@@ -2409,12 +2409,18 @@
def __and__(self, x):
if isinstance(x, baseset):
x = x.set()
- return lazyset(self, lambda r: r in x)
+ if self._start <= self._end:
+ return orderedlazyset(self, lambda r: r in x)
+ else:
+ return orderedlazyset(self, lambda r: r in x, ascending=False)
def __sub__(self, x):
if isinstance(x, baseset):
x = x.set()
- return lazyset(self, lambda r: r not in x)
+ if self._start <= self._end:
+ return orderedlazyset(self, lambda r: r not in x)
+ else:
+ return orderedlazyset(self, lambda r: r not in x, ascending=False)
def __add__(self, x):
def iterates():