Mercurial > hg-stable
changeset 22803:31a591c3fecc
mq: use `revs.sort()` to ensure the set is ascending
Sorting is super-cheap with the new smartset class, so we can use it to enforce
the order. Otherwise all smartset classes would have to allow direct indexing.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 07 Oct 2014 00:12:56 -0700 |
parents | 1fcd361efaf4 |
children | 5385314e0b14 |
files | hgext/mq.py |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Mon Oct 06 10:41:43 2014 -0700 +++ b/hgext/mq.py Tue Oct 07 00:12:56 2014 -0700 @@ -1002,8 +1002,7 @@ if not self.applied: raise util.Abort(_('no patches applied')) revs = scmutil.revrange(repo, opts.get('rev')) - if len(revs) > 1 and revs[0] > revs[1]: - revs.reverse() + revs.sort() revpatches = self._revpatches(repo, revs) realpatches += revpatches numrevs = len(revpatches)