initial config options

Steve Borho steve at borho.org
Mon Sep 10 00:02:18 CDT 2007


On Sun, 2007-09-09 at 21:01 -0500, Steve Borho wrote:
> PS: I know there have been many discussions about a Quick Start app for
> configuring ~/.hgrc and possibly a repo .hg/hgrc.  I might pick up such
> a project.  If you have specific requirements, let me here them.

I just had a thought about this.  Rather than forcing the user to run an
app after install, we could do this with hooks instead.  In the
system-wide Mercurial.ini, we can add a couple lines like this:

[hooks]
precommit.username = test `hg debugconfig ui.username | wc -w` -gt 0

...only it would have to be some windows friendly python code instead of
this shell logic.  The idea being, before the user makes any commit we
first check if there's a username configured.  If the check failes, we
pop up a quick dialog window which asks for a username and allows the
user to chose between setting it globally (in their home directory) or
just in the repo they're currently working in.

In the specified hgrc file, we write the username and a blank hook to
override future checks.

[ui]
username = New Username 
[hooks]
precommit.username =

The username check and dialog window could be provided by a small
extension which also adds a new command so the user can launch it
manually.  I think that would be a good 80% solution to the initial
configuration problem.

If we had this kind of feature, I could see it being quickly extended to
edit the repo paths and maybe the web fields.

-- 
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C




More information about the Mercurial-devel mailing list