changeset 22481:8488955127b0

revset: wider definition of ascending and descending for spanset Before this patches, empty spanset were seen as neither ascending nor descending. This is mathematically wrong and create some edges case. We put `isascending` and `isdescending` back on track so we can use them to simplify some of the spanset code. Benchmarks show no performances harmed in the process.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 16 Sep 2014 23:34:18 -0700
parents dff638170c48
children 2e40cda4b2c5
files mercurial/revset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Sep 17 23:21:20 2014 +0900
+++ b/mercurial/revset.py	Tue Sep 16 23:34:18 2014 -0700
@@ -2835,10 +2835,10 @@
         return self
 
     def isascending(self):
-        return self._start < self._end
+        return self._start <= self._end
 
     def isdescending(self):
-        return self._start > self._end
+        return self._start >= self._end
 
     def filter(self, l):
         if self._start <= self._end: