# HG changeset patch # User Pierre-Yves David # Date 1412665976 25200 # Node ID 31a591c3feccaf57b7c7f3da47560a117b146bf9 # Parent 1fcd361efaf48159185478679f7fd410413e0ca7 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. diff -r 1fcd361efaf4 -r 31a591c3fecc hgext/mq.py --- 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)