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.
--- 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.