Not reading Mercurial.ini in Windows system
Bergquist, Jerome
Jerome.Bergquist at sage.com
Thu Oct 18 10:42:59 CDT 2007
Steve,
Thank you for providing a Windows install for Mercurial. This allows me to
have a clone on my WinXP laptop of the current project(s) I am working on
from my Linux server at work. I can then modify those projects at home and
push my changes back to the Linux server when I return.
Just a little info for you. I do not know what is typical of other
companies, but our corporate policies and startup maps a user directory on a
network server to U: and that is the default drive used. Below are the
environment variables you referenced as set (or not) by those policies and
startup.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
U:\>echo %HOMEPATH%
\
U:\>echo %HOMEDIR%
%HOMEDIR%
U:\>
I chose the %USERPROFILE%\Mercurial.ini file/location from the Mercurial
documentation after I kept getting prompted by commit for a user name. I
then populated that Mercurial.ini from my Linux .hgrc.
Setting a username
By default Mercurial uses a username of the form 'user at localhost' for
commits. This is often meaningless. It's best to configure a proper email
address in ~/.hgrc (or on a Win system %USERPROFILE%\Mercurial.ini) by
adding lines such as the following:
[ui]
username = Author Name <email at address>
- Jerome
-----Original Message-----
From: Steve Borho [mailto:steve at borho.org]
Sent: Thursday, October 18, 2007 11:14 AM
To: Bergquist, Jerome
Cc: mercurial at selenic.com
Subject: RE: Not reading Mercurial.ini in Windows system
On Thu, 2007-10-18 at 10:22 -0400, Bergquist, Jerome wrote:
> Steve,
>
> Yes, I did use your install script. I had emailed you then about the
> hg path not being added during the install so I was not able to run hg.
>
> I ran the commands you asked for (see below) and yes, the HGRCPATH was
> not set correctly. I must have missed the HGRCPATH part when reading
> the setup and configuration sections.
The installer should have setup HGRCPATH for you, so you didn't miss
anything.
> I updated the path and it is working now. What was throwing me off was
> that commit found that .ini, in the list of directories that HGRC(5)
> says it looks for, to write the username to even though it did not
> find it to read from. I had run commit with different user names and
> they were updated in the %USERPROFILE%\Mercurial.ini that I had created.
>
> Thank you Steve again for your help !!
No problem. Thanks for bringing this to my attention so I can get it fixed
before the next release.
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> U:\>c:
>
> C:\>hg version
> Mercurial Distributed SCM (version 0.9.4)
>
> Copyright (C) 2005-2007 Matt Mackall <mpm at selenic.com> and others
> This is free software; see the source for copying conditions. There
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> C:\>echo %HGRCPATH%
> C:\Python25\mercurial\hgrc.d;U:\\mercurial.ini
This is unexpected. The install script uses %HOMEPATH%%HOMEDIR% to get what
is usually "C:\Documents and Settings\USERNAME". At least on your computer
that was a very bad idea.
So at the least, I should change the script to use %USERPROFILE%.
--
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
mailing list