Patchwork [1,of,6] spanset: fix isascending and isdescending

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 17, 2014, 5:50 p.m.
Message ID <bb7965f00332db679263.1413568211@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6377/
State Deferred
Headers show

Comments

Pierre-Yves David - Oct. 17, 2014, 5:50 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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
         else: