revset: simplify fullreposet.__and__ to call sort() with boolean flag
authorYuya Nishihara <yuya@tcha.org>
Sat, 10 Jan 2015 21:36:42 +0900
changeset 23827 4982fade9733
parent 23825 b2358bc1407c
child 23828 8b79fdaa9f85
revset: simplify fullreposet.__and__ to call sort() with boolean flag Note that sort() takes a boolean flag, so other.sort(reverse) was wrong. It just worked fine because there is a top-level function, reverse().
mercurial/revset.py
--- a/mercurial/revset.py	Tue Jan 13 15:08:55 2015 -0500
+++ b/mercurial/revset.py	Sat Jan 10 21:36:42 2015 +0900
@@ -3102,10 +3102,7 @@
             # object.
             other = baseset(other - self._hiddenrevs)
 
-        if self.isascending():
-            other.sort()
-        else:
-            other.sort(reverse)
+        other.sort(reverse=self.isdescending())
         return other
 
 # tell hggettext to extract docstrings from these functions: