[PATCH v2] commands: add editconfig command to edit repo/user hgrc

Brodie Rao brodie at bitheap.org
Wed Aug 25 22:59:23 CDT 2010


On Aug 25, 2010, at 12:16 PM, Mads Kiilerich wrote:

> On 08/25/2010 05:49 PM, Brodie Rao wrote:
>> On Aug 25, 2010, at 8:03 AM, Mads Kiilerich wrote:
>>> The documentation is unix-centric and not correct on windows.
>>
>> Are you referring to the use of "$HOME/.hgrc" in the command help? hg
>> paths uses it as well, so that's what I went with.
>
> That's a bug in the paths help, IMHO.

So, ~/.hgrc is referred to in the following ways right now:

1. .hgrc - "please specify your commit editor/username in your .hgrc  
file", bookmarks, color, hgk, pager, hg help environment

2. $HOME/.hgrc - hg help paths, hgrc(5), hg(1)

3. ~/.hgrc - hgrc(5)

Only hgrc(5) and hg help config mention Windows-specific paths.

Should we consolidate that to just one preferred term?

>> If you mean the "~/.hgrc" in the example config, I'm not sure what I
>> could put there without going into a long explanation of all the
>> possible locations.
>>
>> Do you have any suggestions on what to say instead?
>
> My best and primary answer is no. And if we can't describe clearly  
> what this command does then ... we have a problem.
>
> But incorrect help is worse than no help. A vague reference to the  
> long and correct explanations would perhaps be better.

I agree that the command help should probably mention Windows specific  
locations, but I think "~/.hgrc" is fine for the example config. I'll  
update my patch to be more descriptive.

>>> A refactoring introducing something like ui.editfile could perhaps  
>>> be
>>> nice.
>>
>> Sure. I didn't use ui.edit() because I thought it'd make more sense  
>> to
>> edit the file directly. It'd be confusing when the user thought they
>> opened up .hg/hgrc but there's a random filename in their editor  
>> instead.
>
> I meant something like the patch I just sent (http://www.selenic.com/pipermail/mercurial-devel/2010-August/024001.html 
> ). Something I needed for another unfinished patch.

Sounds reasonable to me.

>> On the other hand, writing the example config directly to .hg/hgrc  
>> means
>> it'll stay there even if the user didn't change anything in it.
>
> Yes - that is a disadvantage ;-)
>
> /Mads



More information about the Mercurial-devel mailing list