# HG changeset patch # User Augie Fackler # Date 2018-02-18 02:47:26 # Node ID 53be14874ee8fa08a9719c0b0a20c3c7d9530afd # Parent 2d513ab7ce940bfb912a2e73e68d1b21fa4ab019 rebase: sort roots by revision Previously we were sorting them by whatever implicit sort order we got between changectx instances. Sorting by rev at least makes some sense, so I chose that. Differential Revision: https://phab.mercurial-scm.org/D2301 diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1650,7 +1650,9 @@ def buildstate(repo, destmap, collapse): roots = list(repo.set('roots(%ld)', sortedsrc[0])) if not roots: raise error.Abort(_('no matching revisions')) - roots.sort() + def revof(r): + return r.rev() + roots = sorted(roots, key=revof) state = dict.fromkeys(rebaseset, revtodo) emptyrebase = (len(sortedsrc) == 1) for root in roots: