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

Adrian Buehlmann adrian at cadifra.com
Wed Aug 25 07:36:34 CDT 2010


On 22.08.2010 22:33, Brodie Rao wrote:
> # HG changeset patch
> # User Brodie Rao <brodie at bitheap.org>
> # Date 1282508457 14400
> # Node ID ca81962217fac8ff2cf9d2e2264a37450f02235b
> # Parent  6b04f1e1aa8a81a87ac75e35377e3266f75eaf0c
> commands: add editconfig command to edit repo/user hgrc
> 
> "hg editconfig" provides a happy medium between making the user edit
> their hgrc manually and providing a command to edit specific settings.
> 
> Without any arguments, the command will load the repo's hgrc in an
> editor if the user is inside a repo. Otherwise, it loads the user's hgrc.
>
> A -u/--user option is provided if the user wishes to edit the user hgrc
> while inside a repo.

I would prefer to abort with

  abort: There is no Mercurial repository here (.hg not found)!

iff "without arguments" and "outside a repo" -- instead of silently
switching to the user's hgrc.

As a side note, I'd expect 'hg -R repoX editconfig' to edit the hgrc of
repoX. So I assume this to be equivalent for "being inside a repo".

-u/--user should always be needed if the user wants to edit the 'user hgrc'.

People could then for example do:

[alias]
repocfg = editconfig
usercfg = editconfig --user

> This also has the added benefit of working the same across platforms,
> instead of requiring the user to hunt down their user hgrc in different
> places depending on whether they're on win32 or posix.

Other than that, I think this is a nice idea.


More information about the Mercurial-devel mailing list