revset: fixed sorting issue with spanset
authorLucas Moscovicz <lmoscovicz@fb.com>
Thu, 13 Mar 2014 17:16:58 -0700
changeset 20718 d7b7ec0459c6
parent 20717 da3124178fbb
child 20719 cce8fbedc82a
revset: fixed sorting issue with spanset When a spanset was being sorted it didn't take into account it's current state (ascending or descending) and it reversed itself everytime the reverse parameter was True. This is not yet used but it will be as soon as the sort revset is changed to directly use the structures sort method.
mercurial/revset.py
--- a/mercurial/revset.py	Thu Mar 13 17:20:03 2014 -0700
+++ b/mercurial/revset.py	Thu Mar 13 17:16:58 2014 -0700
@@ -2530,8 +2530,7 @@
         return l[x]
 
     def sort(self, reverse=False):
-        # Basic implementation to be changed in future patches.
-        if reverse:
+        if bool(reverse) != (self._start > self._end):
             self.reverse()
 
     def reverse(self):