[PATCH 0 of 2 v3] commands: add editconfig

Brodie Rao brodie at bitheap.org
Sun Sep 26 17:14:09 CDT 2010


On Sun, Sep 26, 2010 at 6:02 PM, Martin Geisler <mg at lazybytes.net> wrote:
> Brodie Rao <brodie at bitheap.org> writes:
>
>> This series adds "hg editconfig".
>>
>> I've incorporated feedback on my previous patch submission:
>>
>> - "hg help showconfig" now mentions editconfig.
>
> I like these patches, but it just occured to me that instead of having
> two commands (editconfig and showconfig) to do different aspects of the
> same thing, maybe we could have
>
>  hg config        -> showconfig
>  hg config --edit -> editconfig

showconfig already has -u, so --user couldn't have a short option.

Another thing to consider: showconfig takes positional arguments,
while editconfig takes none.

What do you do in this case?

  $ hg config --edit ui.username

Does it silently ignore ui.username? Does it open up the file that
it's defined in? What if you specify two settings that are in
different files?

What if the setting isn't set anywhere? Do you give an error?

And what would this do?

  $ hg config --edit --user ui.username

Should it always open the user config? What if it's not defined in the
user config? If it's not defined at all, does it still open the user
config?

> I know this overlaps with the help topic of the same name, but we could
> rename that 'hg help configuration' or something like that.
>
> It's just that we don't have any other commands of this compound form.
>
> Maybe we could even make
>
>  hg config --set ui.username='Martin Geisler'
>
> work, provided we have a good library for editing the .ini files.
>
> My TortoiseHg used to complain a lot about me missing an 'iniparse'
> module which it said would allow me to edit the settings... so I guess
> we should start by looking at that :)
>
> --
> Martin Geisler
>
> Mercurial links: http://mercurial.ch/
>


More information about the Mercurial-devel mailing list