[PATCH] commands: add 'setup' command to allow automatic hgrc configuration

Gregory Szorc gregory.szorc at gmail.com
Sat Mar 14 22:54:15 CDT 2015


On Thu, Mar 12, 2015 at 10:07 AM, Mathias De Maré <mathias.demare at gmail.com>
wrote:

> # HG changeset patch
> # User Mathias De Maré <mathias.demare at gmail.com>
> # Date 1426162870 -3600
> #      Thu Mar 12 13:21:10 2015 +0100
> # Node ID 0de0fc66a20a5f0658a6c6f1f5de20d4705f3de1
> # Parent  7cf9a9e0cf893e7ae82dc576a03c843fd6640438
> commands: add 'setup' command to allow automatic hgrc configuration
>
> This is a proposal meant to easily set up new users with
> a good hgrc file. It's very basic (a combination of
> 'release early' and 'I don't have a lot of time').
> Comments are very much welcome.
>
> I wasn't too sure about using the first path
> listed in the userhgrc, not sure if that's the best approach.
>
> Some other ideas to throw out there:
> - Running 'setup' by default if a user does not have a .hgrc
>       and is using the terminal (possibly falls under moot?)
> - Perhaps having a global 'do you want to have a lot of sensible defaults
> set'
>   question could be useful as well.
> - Popping up a merge window in case a user already has a .hgrc.
>   This could allow the user to do the merge,
>   and avoids us having to mess with editing configs
>   (this was a very good idea by smf).
>

At Mozilla, I wrote a "mercurial-setup" command that essentially runs an
interactive wizard where people can select what options to enable and it
writes an updated hgrc at the end (`mach mercurial-setup` for people with a
mozilla-central checkout around). It also does stuff like ensure Mercurial
extensions are up-to-date from their upstream repos and discourages people
from using MQ. Unlike some corporate Mercurial users, we don't have the
luxury of centralized machine configuration and we can't just "push out" an
optimized/ideal config/environment to our developers automatically.

I've received considerable feedback that this tool is useful. As easy as
hgrc files are to many on this list, many people don't want to be bothered
by them. They want things to "just work."

I also believe many people try Mercurial, see the defaults are sub-par on
numerous fronts, and then give up. I think "hg setup" could be part of the
all-important first use user experience.

If this lands, I'd love to see a hook point so extensions could add their
own prompts. This would play into my idea for servers to advertise
recommended settings and "best practices" for interacting with it. I have a
very old proof-of-concept at
https://bugzilla.mozilla.org/show_bug.cgi?id=941856. I'd love to find time
to polish that off and somehow integrate it into Mercurial core...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150314/4953a962/attachment.html>


More information about the Mercurial-devel mailing list