rebase: add checkunfinished support (issue3955) stable
authorMatt Mackall <mpm@selenic.com>
Wed, 24 Jul 2013 23:51:44 -0500
branchstable
changeset 19478 e5a5790a3185
parent 19477 e9351f0d9a2a
child 19479 11664641fbad
rebase: add checkunfinished support (issue3955)
hgext/rebase.py
tests/test-rebase-interruptions.t
--- a/hgext/rebase.py	Wed Jul 24 23:51:44 2013 -0500
+++ b/hgext/rebase.py	Wed Jul 24 23:51:44 2013 -0500
@@ -174,6 +174,7 @@
                 raise util.Abort(_('cannot specify both a '
                                    'revision and a source'))
 
+            cmdutil.checkunfinished(repo)
             cmdutil.bailifchanged(repo)
 
             if not destf:
@@ -798,3 +799,6 @@
     entry[1].append(('t', 'tool', '',
                      _("specify merge tool for rebase")))
     cmdutil.summaryhooks.add('rebase', summaryhook)
+    cmdutil.unfinishedstates.append(
+        ['rebasestate', False, _('rebase in progress'),
+         _("use 'hg rebase --continue' or 'hg rebase --abort'")])
--- a/tests/test-rebase-interruptions.t	Wed Jul 24 23:51:44 2013 -0500
+++ b/tests/test-rebase-interruptions.t	Wed Jul 24 23:51:44 2013 -0500
@@ -66,11 +66,11 @@
 
 Force a commit on C during the interruption:
 
-  $ hg up -q -C 2
+  $ hg up -q -C 2 --config 'extensions.rebase=!'
 
   $ echo 'Extra' > Extra
   $ hg add Extra
-  $ hg ci -m 'Extra'
+  $ hg ci -m 'Extra' --config 'extensions.rebase=!'
 
 Force this commit onto secret phase
 
@@ -156,11 +156,11 @@
 
 Force a commit on B' during the interruption:
 
-  $ hg up -q -C 5
+  $ hg up -q -C 5 --config 'extensions.rebase=!'
 
   $ echo 'Extra' > Extra
   $ hg add Extra
-  $ hg ci -m 'Extra'
+  $ hg ci -m 'Extra' --config 'extensions.rebase=!'
 
   $ hg tglog
   @  6: 'Extra'
@@ -227,7 +227,7 @@
 
 Change phase on B and B'
 
-  $ hg up -q -C 5
+  $ hg up -q -C 5 --config 'extensions.rebase=!'
   $ hg phase --public 1
   $ hg phase --public 5
   $ hg phase --secret -f 2