changeset 19517:eab2ff59481e stable

rebase: continue abort without strip for immutable csets (issue3997) This causes us to simply discard the rebase state.
author Matt Mackall <mpm@selenic.com>
date Thu, 01 Aug 2013 17:45:13 -0500
parents fe78eb7bcca0
children 12843143663d
files hgext/rebase.py tests/test-rebase-interruptions.t
diffstat 2 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Aug 01 17:33:09 2013 -0500
+++ b/hgext/rebase.py	Thu Aug 01 17:45:13 2013 -0500
@@ -609,9 +609,9 @@
     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 @@
         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)
--- a/tests/test-rebase-interruptions.t	Thu Aug 01 17:33:09 2013 -0500
+++ b/tests/test-rebase-interruptions.t	Thu Aug 01 17:45:13 2013 -0500
@@ -248,9 +248,8 @@
 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'