Patchwork [1,of,3] fetch: remove shorthand of --edit colliding against -e/-ssh in remoteopts (BC)

login
register
mail settings
Submitter Katsunori FUJIWARA
Date June 23, 2017, 5:48 p.m.
Message ID <5808466886a165460b52.1498240135@speaknoevil>
Download mbox | patch
Permalink /patch/21633/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - June 23, 2017, 5:48 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1498239553 -32400
#      Sat Jun 24 02:39:13 2017 +0900
# Node ID 5808466886a165460b52de226ab5d3c4c1379692
# Parent  ecf66206628763bce6becb87e283d3805114e958
fetch: remove shorthand of --edit colliding against -e/-ssh in remoteopts (BC)

Before this patch, -e/--edit and -e/--ssh of fetch command collide
against each other. This causes that -e is treated as shorthand of
--edit but doesn't work as same as --edit. Therefore, -e works as
neither --edit nor --ssh, in practice.

This issue was introduced at 595a69a01129 (or 1.0), which renamed
-f/--force-editor to -e/--edit. At that point, -e was already used as
shorthand of --ssh.

After this patch, -e is treated as shorthand of --ssh.

This patch is marked as "(BC)", because -e as shorthand of --edit in
existing scripts causes failure (or unexpected result) after this
patch. This impact should be less enough, because --edit mainly
focuses on interactive use.

BTW, test-duplicateoptions.py (since 7d171c05a631 or 1.9) can't detect
this kind of issues as expected, because direct invocation of
extensions.loadall() doesn't involve registration of commands defined
in extensions (this issue is fixed in subsequent patch).
Yuya Nishihara - June 24, 2017, 2:23 a.m.
On Sat, 24 Jun 2017 02:48:55 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1498239553 -32400
> #      Sat Jun 24 02:39:13 2017 +0900
> # Node ID 5808466886a165460b52de226ab5d3c4c1379692
> # Parent  ecf66206628763bce6becb87e283d3805114e958
> fetch: remove shorthand of --edit colliding against -e/-ssh in remoteopts (BC)

Nice catch. Queued this, thanks.

Patch

diff --git a/hgext/fetch.py b/hgext/fetch.py
--- a/hgext/fetch.py
+++ b/hgext/fetch.py
@@ -35,7 +35,7 @@  testedwith = 'ships-with-hg-core'
 @command('fetch',
     [('r', 'rev', [],
      _('a specific revision you would like to pull'), _('REV')),
-    ('e', 'edit', None, _('invoke editor on commit messages')),
+    ('', 'edit', None, _('invoke editor on commit messages')),
     ('', 'force-editor', None, _('edit commit message (DEPRECATED)')),
     ('', 'switch-parent', None, _('switch parents when merging')),
     ] + cmdutil.commitopts + cmdutil.commitopts2 + cmdutil.remoteopts,