views:

2518

answers:

5

I have added repository and at the time of commit I get error as error: abort: no username supplied (see "hg help config"). I am not getting Mercurial.ini file on my local as well. Does anyone know how I can resolve this error on Fedora?

+3  A: 

Simple answer - in your .hg folder, create a file named .hgrc in there, add the following content (check hg help config for the exact syntax)

[ui]
username = forname surname <[email protected]>
verbose = True

and save it. Should work now. Note that verbose = True is not required, but I included it since it is listed in the help content

(This is from memory, but hg help config will tell you the correct filename and syntax)

ZombieSheep
why the change to verbose ?
tonfa
as I said in the answer, it isn't required, but I put it in since that's what `hg help config` outputs. Just in the answer for consistency. :)
ZombieSheep
+5  A: 

Either put a .hgrc in the .hg directory in your repo or put a .hgrc file in your home dir (then it covers all your projects) In the file you should write

[ui]
username = Your Name <your@mail>
cjg
+1  A: 
On Windows, these configuration files are read:

- "<repo>\.hg\hgrc"
- "%USERPROFILE%\.hgrc"
- "%USERPROFILE%\Mercurial.ini"
- "%HOME%\.hgrc"
- "%HOME%\Mercurial.ini"
- "C:\Mercurial\Mercurial.ini"
- "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial"
- "<install-dir>\Mercurial.ini"

On Unix, these files are read:

- "<repo>/.hg/hgrc"
- "$HOME/.hgrc"
- "/etc/mercurial/hgrc"
- "/etc/mercurial/hgrc.d/*.rc"
- "<install-root>/etc/mercurial/hgrc"
- "<install-root>/etc/mercurial/hgrc.d/*.rc"

[ui] username = Your Name

cowboy
-1: This doesn't answer the question.
Phil
A: 

I have ubuntu 10.0.4 and mecurial 1.4.3 and the above doesn't work

i included the username in the local

.hg/hgrc
and in the
~/.hgrc
and it still asks for a username when i do a
hg  commit

A: 

I had the same problem as user469020. After a few hours of unsuccesfull experimentation I just looked again at .hgrc and found misstyping usename instead of username.

palanutsa