comparison mercurial/revset.py @ 23826:c90d195320c5 stable

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__.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 10 Jan 2015 21:31:59 +0900
parents aafeaba22826
children 9b1d3bac61a7
comparison
equal deleted inserted replaced
23734:f4e6475950f1 23826:c90d195320c5
2911 if (end < rev <= start) or (start <= rev < end): 2911 if (end < rev <= start) or (start <= rev < end):
2912 count += 1 2912 count += 1
2913 return abs(self._end - self._start) - count 2913 return abs(self._end - self._start) - count
2914 2914
2915 def isascending(self): 2915 def isascending(self):
2916 return self._start <= self._end 2916 return self._ascending
2917 2917
2918 def isdescending(self): 2918 def isdescending(self):
2919 return self._start >= self._end 2919 return not self._ascending
2920 2920
2921 def first(self): 2921 def first(self):
2922 if self._ascending: 2922 if self._ascending:
2923 it = self.fastasc 2923 it = self.fastasc
2924 else: 2924 else: