views:

53

answers:

3

Hi, 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/hgrc 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?

+2  A: 

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.

Ignacio Vazquez-Abrams
Thankx...But that still does not explain why "hg paths" does not show any output inside the clone repo. Any ideas on that?
zubin71
+1  A: 

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

vsh
A: 

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.
http://mercurial.selenic.com/wiki/Trust

Ethan