Comments
Patch
@@ -808,11 +808,11 @@ def inrebase(repo, originalwd, state):
return False
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:
repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
% ', '.join(str(repo[r]) for r in immutable),
@@ -831,11 +831,11 @@ def abort(repo, originalwd, target, stat
# Update away from the rebase if necessary
if inrebase(repo, originalwd, state):
merge.update(repo, repo[originalwd].rev(), 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
repair.strip(repo.ui, repo, strippoints)
@@ -1010,11 +1010,11 @@ def summaryhook(ui, repo):
except error.RepoLookupError:
# i18n: column positioning for "hg summary"
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,
ui.label(_('%d remaining'), 'rebase.remaining') %
(len(state) - numrebased)))