changeset 22382:d5b04ee8ecf7

rebase: add a deprecated -i/--interactive flag A common mistake can be to type 'hg rebase -i' to discover interactive history editing. We add a -i/--interactive flag as discussed in the sprint and deprecate it right away, but hint people using it to use histedit instead.
author David Soria Parra <davidsp@fb.com>
date Mon, 01 Sep 2014 11:48:55 +0200
parents 392ae5cb8d62
children f58b41f6708b
files hgext/rebase.py tests/test-rebase-parameters.t
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Tue Aug 19 01:13:10 2014 +0200
+++ b/hgext/rebase.py	Mon Sep 01 11:48:55 2014 +0200
@@ -69,6 +69,7 @@
     ('', 'keep', False, _('keep original changesets')),
     ('', 'keepbranches', False, _('keep original branch names')),
     ('D', 'detach', False, _('(DEPRECATED)')),
+    ('i', 'interactive', False, _('(DEPRECATED)')),
     ('t', 'tool', '', _('specify merge tool')),
     ('c', 'continue', False, _('continue an interrupted rebase')),
     ('a', 'abort', False, _('abort an interrupted rebase'))] +
@@ -163,6 +164,11 @@
         # other extensions
         keepopen = opts.get('keepopen', False)
 
+        if opts.get('interactive'):
+            msg = _("interactive history editing is supported by the "
+                    "'histedit' extension (see 'hg help histedit')")
+            raise util.Abort(msg)
+
         if collapsemsg and not collapsef:
             raise util.Abort(
                 _('message can only be specified with collapse'))
--- a/tests/test-rebase-parameters.t	Tue Aug 19 01:13:10 2014 +0200
+++ b/tests/test-rebase-parameters.t	Mon Sep 01 11:48:55 2014 +0200
@@ -459,4 +459,12 @@
   tool option will be ignored
   saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob)
 
+  $ hg rebase -i
+  abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
+  [255]
+
+  $ hg rebase --interactive
+  abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
+  [255]
+
   $ cd ..