[PATCH 1 of 6] spanset: fix isascending and isdescending

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Oct 17 12:50:11 CDT 2014

# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1413536326 25200
#      Fri Oct 17 01:58:46 2014 -0700
# Node ID bb7965f00332db6792635e6c860bce4fad7c52b2
# Parent  840be5ca03e1db16ba994e55597771c418166c97
spanset: fix isascending and isdescending

Those methods are still based on the order between `start` and `end`. For quite
some time now, we `start <= end` in all case and we rely on an internal boolean
for the requested iteration order. This changeset fixes the methods.

This would trigger test failure later on.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2905,14 +2905,14 @@ class _spanset(abstractsmartset):
         # Basic implementation to be changed in future patches.
         l = baseset([r for r in self])
         return l[x]
     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:
             it = self.fastasc

More information about the Mercurial-devel mailing list