Mercurial > hg-stable
comparison mercurial/cmdutil.py @ 29335:631617262e55
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.
author | Martijn Pieters <mjpieters@fb.com> |
---|---|
date | Wed, 08 Jun 2016 16:18:43 +0100 |
parents | baab9ea4426c |
children | 38e0c83c7ee4 |
comparison
equal
deleted
inserted
replaced
29334:ecc9b788fd69 | 29335:631617262e55 |
---|---|
2145 return revset.baseset(), None, None | 2145 return revset.baseset(), None, None |
2146 expr, filematcher = _makelogrevset(repo, pats, opts, revs) | 2146 expr, filematcher = _makelogrevset(repo, pats, opts, revs) |
2147 if opts.get('rev'): | 2147 if opts.get('rev'): |
2148 # User-specified revs might be unsorted, but don't sort before | 2148 # User-specified revs might be unsorted, but don't sort before |
2149 # _makelogrevset because it might depend on the order of revs | 2149 # _makelogrevset because it might depend on the order of revs |
2150 revs.sort(reverse=True) | 2150 if not revs.isdescending(): |
2151 revs.sort(reverse=True) | |
2151 if expr: | 2152 if expr: |
2152 # Revset matchers often operate faster on revisions in changelog | 2153 # Revset matchers often operate faster on revisions in changelog |
2153 # order, because most filters deal with the changelog. | 2154 # order, because most filters deal with the changelog. |
2154 revs.reverse() | 2155 revs.reverse() |
2155 matcher = revset.match(repo.ui, expr) | 2156 matcher = revset.match(repo.ui, expr) |