Patchwork rebase: add a deprecated -i/--interactive flag

login
register
mail settings
Submitter David Soria Parra
Date Sept. 1, 2014, 10:02 a.m.
Message ID <f62d36b32d061d21fee2.1409565739@davidsp-mbp.guest.muc.mayflower.de>
Download mbox | patch
Permalink /patch/5672/
State Accepted
Headers show

Comments

David Soria Parra - Sept. 1, 2014, 10:02 a.m.
# HG changeset patch
# User David Soria Parra <davidsp@fb.com>
# Date 1409564935 -7200
#      Mon Sep 01 11:48:55 2014 +0200
# Node ID f62d36b32d061d21fee2786da787fdee4d5deffc
# Parent  188b8aa2120b03eead618ba150319074f4e3b42b
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.
Pierre-Yves David - Sept. 2, 2014, 7:09 p.m.
On 09/01/2014 12:02 PM, David Soria Parra wrote:
> # HG changeset patch
> # User David Soria Parra<davidsp@fb.com>
> # Date 1409564935 -7200
> #      Mon Sep 01 11:48:55 2014 +0200
> # Node ID f62d36b32d061d21fee2786da787fdee4d5deffc
> # Parent  188b8aa2120b03eead618ba150319074f4e3b42b
> rebase: add a deprecated -i/--interactive flag

As this was discussed during the sprint, I pushed that the Clowncopter 
(after some mesage wrapping fixes)

I'm not super happy about the message itself that I feel a bit too long. 
However I do not have much better idea and native speaker are going to 
bikeshed this much better than me.

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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'):
+            raise util.Abort(
+                _("interactive history editing is supported by the " +
+                "'histedit' extension (see 'hg help histedit')"))
+
         if collapsemsg and not collapsef:
             raise util.Abort(
                 _('message can only be specified with collapse'))
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -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 ..