Setting username in Mercurial .hgrc file
Asked Answered
B

1

25

I have been browsing SO and Google for a solution to my basic problem, and so far I have had no luck.

I am brand new to Mercurial and have just installed it on my Mac. I am using it for personal version control and will not be communicating with a central server (yet).

When I try to commit files, I get abort: no username supplied (see "hg help config"). The common solution to this problem is putting the following in ~/.hgrc

[ui]
username = Firstname Lastname <[email protected]>

which I have done, but the error remains. It just won't read the file. Any suggestions?

Bermuda answered 21/11, 2011 at 9:4 Comment(7)
Could be some typo on your part. Please verify that cat ~/.hgrc (copy-paste that to a shell) produces the necessary config data. Update your question with the (appropriately anonimized) output.Claire
@Adam Mercurial.ini is Windows only.Nitrate
@PaulS Yeah I suspected as much :-(Remittent
What is the output of hg.exe showconfig | grep ui?Woodhouse
Does hg commit -u username -m "msg" works?Tartan
Sorry for the delay -- I currently have not internet access on the computer that I have been setting up Mercurial. Well the problem is "fixed", in that restarting my computer (for the first time in a month or so) seems to have fixed the problem (however, the reliability of this is unknown).Bermuda
@danielkullmann: just a small note: instead of using grep (which is normally not there on Windows), then just do hg showconfig ui to get the settings from the [ui] section.Gulp
G
31

For future reference: use

$ hg showconfig ui --debug

to see the settings from the [ui] section and to see the files Mercural reads for configuration settings. That should help you along if you ever have to debug such a case again.

Gulp answered 1/12, 2011 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.