[PATCH] importeret rettelse missing-alias

Steve Borho steve at borho.org
Thu Apr 9 14:05:00 CDT 2009


On Thu, Apr 9, 2009 at 1:55 PM, Martin Geisler <mg at lazybytes.net> wrote:
> Martin Geisler <mg at daimi.au.dk> writes:
>
>> # HG changeset patch
>> # User Martin Geisler <mg at lazybytes.net>
>> # Date 1239301200 -7200
>> # Node ID 9e4fe7a59488c52104ec546801f61b0f1d1d6650
>> # Parent  545fb915fe1672834bb569e54651d596258ad05b
>> importeret rettelse missing-alias
>
> Yeah -- I forgot to give this one a proper commit message, so you got
> the Danish one put in by MQ.
>
> But it doesn't matter -- I just wanted to see if people think it's a
> good idea to have aliases for the command line switches. We discussed
> this on the user list:
>
>  http://markmail.org/thread/gvytwp5myibthxnh
>
> At first I thought it would complicate the code, but it turned out to be
> trivial to support. So now I would be okay with it.
>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -2754,6 +2754,8 @@
>>        = the previous added file was copied from here
>>      """
>>
>> +    # make --missing an alias for --deleted
>> +    opts['deleted'] = opts.get('deleted') or opts.get('missing')
>>      node1, node2 = cmdutil.revpair(repo, opts.get('rev'))
>>      cwd = (pats and repo.getcwd()) or ''
>>      end = opts.get('print0') and '\0' or '\n'
>> @@ -3416,6 +3418,7 @@
>>            ('a', 'added', None, _('show only added files')),
>>            ('r', 'removed', None, _('show only removed files')),
>>            ('d', 'deleted', None, _('show only deleted (but tracked) files')),
>> +          ('', 'missing', None, _('alias for --deleted')),
>>            ('c', 'clean', None, _('show only files without changes')),
>>            ('u', 'unknown', None, _('show only unknown (not tracked) files')),
>>            ('i', 'ignored', None, _('show only ignored files')),
>> diff --git a/tests/test-help.out b/tests/test-help.out
>> --- a/tests/test-help.out
>> +++ b/tests/test-help.out
>> @@ -281,6 +281,7 @@
>>   -a --added      show only added files
>>   -r --removed    show only removed files
>>   -d --deleted    show only deleted (but tracked) files
>> +    --missing    alias for --deleted
>>   -c --clean      show only files without changes
>>   -u --unknown    show only unknown (not tracked) files
>>   -i --ignored    show only ignored files
>
> I don't like putting the option in there -- it breaks the flow of all
> the 'show only...' options. But it logically belongs there -- any
> suggestions?

Perhaps if deleted and missing were moved to the end, it wouldn't
be so noticeable.  But I'm ambivalent about the overall change.

--
Steve Borho



More information about the Mercurial-devel mailing list