[PATCH 0 of 2] mq: rename strip --nobackup option to --no-backup (issue2377)
Christian Ebert
blacktrash at gmx.net
Wed Sep 15 05:06:00 CDT 2010
* Martin Geisler on Wednesday, September 15, 2010 at 09:04:55 +0200
> Matt Mackall <mpm at selenic.com> writes:
>> On Tue, 2010-09-14 at 22:16 +0200, Christian Ebert wrote:
>>> These patches address feature request 2377 and deprecate hg strip
>>> --nobackup in favour of hg strip --no-backup, long option name
>>> analogous to hg revert --no-backup.
>>>
>>> Although revert has no corresponding short option and does not
>>> exactly the same thing (but at least something similar), I deem the
>>> sort of fake consistency better for practical reasons: the user is
>>> less prone to mistype the option he is used to from the core command.
>>>
>>> For this option name change it was necessary to use
>>> opts.get('no-backup') instead of opts['no-backup'] to avoid a
>>> KeyError. The first patch prepares for this by consistently using
>>> opts.get() which is supposed to be better practice anyway. Unless we
>>> decide that this is too radical and special rules apply for mq
>>> (speed?).
>>
>> Queued, thanks.
>
> We discussed this problem a couple of days ago on IRC and I suggested
> that we remove all '-' from the command line options while parsing them.
Doesn't do fancyopts already something like that?
# convert opts to getopt format
oname = name
name = name.replace('-', '_')
> I could also imagine a system where we explicitly put in aliases that
> map '--noupdate' to '--no-update' while issueing a deprecation warning
> at parse time.
>
> But maybe that is too much effort to put into fixing a couple of option
> names?
I think it would be better to come to an agreement on how the
non-deprecated options should look first.
> The code would know the options as 'noupdate', 'nobackup', etc, but we
> can update the help texts to show a nicer and more uniform set of names.
So you want to change clone --noupdate to --no-update? I see some
bikeshedding coming ;-) --updaterev (2 words) should become
--update-rev then?
Or we go the other way round and disallow dashes in option names
...
c
--
Es ist ganz, was es ist, und darum ist es so schön.
Der Zwang des Gesetzes und des Schicksals betastet es nicht;
im Kind ist Freiheit allein.
_HÖLDERLIN: HYPERION_ --->> http://www.blacktrash.org/hyperion
More information about the Mercurial-devel
mailing list