# HG changeset patch # User Pierre-Yves David # Date 2014-12-04 15:03:02 # Node ID fe4157d839ace2e9f525b3b063f798cc42df6a30 # Parent 11b215731e74a63b3136ad1a901f811c53925adb rebase: use '>= 0' to know is a revision was rebased The fact that the state for "not yet rebased" is -1 is an implementation details. So we change the comparisons to some semantically more correct. diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -817,7 +817,7 @@ def inrebase(repo, originalwd, state): def abort(repo, originalwd, target, state): 'Restore the repository to its original state' - dstates = [s for s in state.values() if s > nullrev] + dstates = [s for s in state.values() if s >= 0] immutable = [d for d in dstates if not repo[d].mutable()] cleanup = True if immutable: @@ -840,7 +840,7 @@ def abort(repo, originalwd, target, stat merge.update(repo, originalwd, False, True, False) # Strip from the first rebased revision - rebased = filter(lambda x: x > -1 and x != target, state.values()) + rebased = filter(lambda x: x >= 0 and x != target, state.values()) if rebased: strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)] # no backup of rebased cset versions needed @@ -1019,7 +1019,7 @@ def summaryhook(ui, repo): msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n') ui.write(msg) return - numrebased = len([i for i in state.itervalues() if i != -1]) + numrebased = len([i for i in state.itervalues() if i >= 0]) # i18n: column positioning for "hg summary" ui.write(_('rebase: %s, %s (rebase --continue)\n') % (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,