Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I\'m asking/answering the question myself
This problem still exists. The mercurial.ini
file is ignored no matter where you put it.
No mercurial.ini
file is created during installation. I created one in the Mercurial install directory, but it had no effect. I copied it to %USERPROFILE%
and then to %HOME%
, but neither one works.
Putting .hgrc
in the HOME directory works.
The documentation ("hg help config") needs to be fixed.
On Windows XP I do not see an ini file.
After creating the repository using the command hg init
,
I added a file with the name hgrc
to the folder .hg
With the following content:
[ui]
editor = notepad
username = zamboni@icemachine.com
Here is what worked like a charm for me on Windows XP:
C:\Program Files\Mercurial\hgrc.d
assuming you have installed Mercurial to C:\Program Files\Mercurial\
.Mercurial.RC
file in there.C:\Documents and Settings\ [USERNAME]\
Mercurial.RC
to Mercurial.ini
.Edit the [ui] section like so:
[ui]
; editor used to enter commit logs, etc. Most text editors will work.
editor = notepad
verbose = True
username = userEmail@domain.com
I'm sorry, but why do you call this a problem? Mercurial asks you to see hg help config
, and this help text explicitly tells you how to add a username -- I know since I wrote that help text :-)
How should we improve the error message to make this more clear?
Edit: Since I wrote this in 2010, we've managed to screw this up by making hg help config
include help for all config settings. So the nice little example of how to set the username:
[ui]
username = Your Name <your@email.com>
is now lost in the noise (add this to ~/.hgrc
, creating the file if necessary). I've opened an issue for this.
I had the same problem. What helped me was to put [ui]
and username = firstname lastname
on separate lines of the ~/.hgrc
file. Putting these two things on one line did not work and led to the error.
If you are using TortoiseHg, you can add [UI] settings easily
Right clicking in any folder Explorer to access the TortoiseHg menu.
From the flyout TortoiseHg menu choose Global Settings
From the interface click the Edit File
Add the [UI] settings to the end
[ui]
username = YourName
verbose = true