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 <firstname.lastname@example.net>

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

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
kamek
  • 2,390
  • 2
  • 19
  • 15
  • 2
    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. – tzot Nov 21 '11 at 09:28
  • 1
    @Adam Mercurial.ini is Windows only. – Paul S Nov 21 '11 at 11:11
  • @PaulS Yeah I suspected as much :-( – Adam Houldsworth Nov 21 '11 at 11:21
  • What is the output of `hg.exe showconfig | grep ui`? – daniel kullmann Nov 22 '11 at 18:46
  • 3
    Does `hg commit -u username -m "msg"` works? – César Nov 22 '11 at 18:48
  • 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). – kamek Nov 23 '11 at 08:08
  • 3
    @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. – Martin Geisler Dec 01 '11 at 12:31

1 Answers1

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.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229