# HG changeset patch # User Pierre-Yves David # Date 1417542380 28800 # Node ID 102f144f6e0247b587d0c35eb23c05ab3c5bebc1 # Parent fe4157d839ace2e9f525b3b063f798cc42df6a30 rebase: add a 'revtodo' constant The state mapping is using '-1' to mark revisions that have not been rebased yet. We introduce and use a constant for that purpose. This will help emphasize the fact the value means something other than nullrev. diff -r fe4157d839ac -r 102f144f6e02 hgext/rebase.py --- a/hgext/rebase.py Thu Dec 04 07:03:02 2014 -0800 +++ b/hgext/rebase.py Tue Dec 02 09:46:20 2014 -0800 @@ -23,6 +23,7 @@ from mercurial.i18n import _ import os, errno +revtodo = -1 nullmerge = -2 revignored = -3 @@ -367,7 +368,7 @@ pos = 0 for rev in sortedstate: pos += 1 - if state[rev] == -1: + if state[rev] == revtodo: ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])), _('changesets'), total) p1, p2, base = defineparents(repo, rev, target, state, @@ -790,7 +791,7 @@ if not collapse: seen = set([target]) for old, new in sorted(state.items()): - if new != nullrev and new in seen: + if new != revtodo and new in seen: skipped.add(old) seen.add(new) repo.ui.debug('computed skipped revs: %s\n' % @@ -882,7 +883,7 @@ return None repo.ui.debug('rebase onto %d starting from %s\n' % (dest, root)) - state.update(dict.fromkeys(rebaseset, nullrev)) + state.update(dict.fromkeys(rebaseset, revtodo)) # Rebase tries to turn into a parent of while # preserving the number of parents of rebased changesets: #