graphmod: avoid sorting when already sorted
authorMartijn Pieters <mjpieters@fb.com>
Wed, 08 Jun 2016 16:18:43 +0100
changeset 29335 631617262e55
parent 29334 ecc9b788fd69
child 29336 9368ed12f3c0
graphmod: avoid sorting when already sorted This is somewhat redundant now, but allows us to add a toposort that should not be re-sorted either.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Tue Jun 07 20:29:54 2016 -0700
+++ b/mercurial/cmdutil.py	Wed Jun 08 16:18:43 2016 +0100
@@ -2147,7 +2147,8 @@
     if opts.get('rev'):
         # User-specified revs might be unsorted, but don't sort before
         # _makelogrevset because it might depend on the order of revs
-        revs.sort(reverse=True)
+        if not revs.isdescending():
+            revs.sort(reverse=True)
     if expr:
         # Revset matchers often operate faster on revisions in changelog
         # order, because most filters deal with the changelog.