# HG changeset patch # User Matt Mackall # Date 2013-08-01 22:45:13 # Node ID eab2ff59481e419e515c20b544b0d1ed1ee3485c # Parent fe78eb7bcca046143e9f6e78da3621cbd2a19354 rebase: continue abort without strip for immutable csets (issue3997) This causes us to simply discard the rebase state. diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -609,9 +609,9 @@ def abort(repo, originalwd, target, stat dstates = [s for s in state.values() if s != nullrev] immutable = [d for d in dstates if not repo[d].mutable()] if immutable: - raise util.Abort(_("can't abort rebase due to immutable changesets %s") - % ', '.join(str(repo[r]) for r in immutable), - hint=_('see hg help phases for details')) + repo.ui.warn(_("warning: can't clean up immutable changesets %s\n") + % ', '.join(str(repo[r]) for r in immutable), + hint=_('see hg help phases for details')) descendants = set() if dstates: @@ -622,12 +622,12 @@ def abort(repo, originalwd, target, stat return -1 else: # Update away from the rebase if necessary - if inrebase(repo, originalwd, state): + if not immutable and 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()) - if rebased: + if rebased and not immutable: strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)] # no backup of rebased cset versions needed repair.strip(repo.ui, repo, strippoints) diff --git a/tests/test-rebase-interruptions.t b/tests/test-rebase-interruptions.t --- a/tests/test-rebase-interruptions.t +++ b/tests/test-rebase-interruptions.t @@ -248,9 +248,8 @@ Change phase on B and B' Abort the rebasing: $ hg rebase --abort - abort: can't abort rebase due to immutable changesets 45396c49d53b - (see hg help phases for details) - [255] + warning: can't clean up immutable changesets 45396c49d53b + rebase aborted $ hg tglogp @ 5:public 'B'