revset: fix spanset.isascending() to honor sort() or reverse() request
Because spanset.isascending() ignored the ascending flag, the result of
"fullreposet() & x" was always sorted in ascending order.
The test case is carefully chosen to call fullreposet.__and__.
--- a/mercurial/revset.py Mon Jan 05 22:18:55 2015 -0800
+++ b/mercurial/revset.py Sat Jan 10 21:31:59 2015 +0900
@@ -2913,10 +2913,10 @@
return abs(self._end - self._start) - count
def isascending(self):
- return self._start <= self._end
+ return self._ascending
def isdescending(self):
- return self._start >= self._end
+ return not self._ascending
def first(self):
if self._ascending:
--- a/tests/test-revset.t Mon Jan 05 22:18:55 2015 -0800
+++ b/tests/test-revset.t Sat Jan 10 21:31:59 2015 +0900
@@ -496,6 +496,9 @@
2
1
0
+ $ log 'reverse(all()) & filelog(b)'
+ 4
+ 1
$ log 'rev(5)'
5
$ log 'sort(limit(reverse(all()), 3))'