Mercurial default repository
I'm facing a rather queer problem. I use an Ubuntu(Lucid Lynx-64 bit, to be specific) machine. I have a repository hg1/ which I cloned to hg2 as follows
$ hg clone hg1 hg2
However, on issuing an "hg incoming" inside the hg folder I get the following message -
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/h开发者_运维问答grc from untrusted user root, group root
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/hgrc from untrusted user root, group root
abort: repository default not found!
I check the contents of the .hg/hgrc file inside hg2 and find the following contents :-
[paths]
default = /media/disk/myWorks/mercurial/hg1
On issuing "hg paths" inside hg2 i get :-
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/hgrc from untrusted user root, group root
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/hgrc from untrusted user root, group root
Please notice that for every "hg" command i execute inside the hg2/ repository, i get the following lines
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/hgrc from untrusted user root, group root
Not trusting file /media/disk/myWorks/mercurial/hg2/.hg/hgrc from untrusted user root, group root
Could someone help me, on as to why this is happening?
hg reads configuration from installation, system, user and repository config files in that order. it will not read any config files it cannot trust. hg paths will display all paths from [path] section in all the config files it reads. this can be seen in hg showconfig paths
. since only trusted files are read and hg2/.hg/hgrc is not trusted (according to error its owned by root user/group, possible since its on external disk owned by same) it is not being read. see hgrc trusted section for adding users/groups to be trusted.
for a list of config files being read for current repository hg showconfig --debug
The file is modifiable by someone other than the current user, and as such mercurial is unwilling to use the contents since it cannot be sure that they haven't been tampered with.
If you want to add global 'root trust' for hgrc files, you can add trusted.users=root
in the /etc/mercurial/hgrc file, and then users of that machine should be able to trust root-owned hgrc files without having each user edit their .hgrc file.
https://www.mercurial-scm.org/wiki/Trust
精彩评论