Mercurial 默认存储库
我面临着一个相当奇怪的问题。我使用 Ubuntu(具体来说是 Lucid Lynx-64 位)机器。我有一个存储库 hg1/,我将其克隆到 hg2,如下所示
$ hg clone hg1 hg2
但是,在 hg 文件夹内发出“hgcoming”时,我收到以下消息 -
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
中止:未找到默认存储库!
我检查 hg2 内的 .hg/hgrc 文件的内容并找到以下内容:-
[路径]
默认 = /media/disk/myWorks/mercurial/hg1
在 hg2 内发出“hg paths”时,我得到:-
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
请注意,对于我在 hg2/ 存储库中执行的每个“hg”命令,我得到以下几行
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
不信任文件 /media/disk/myWorks/mercurial/hg2/.hg/hgrc 来自不受信任的用户 root、组 root
有人可以帮助我,解释为什么会发生这种情况吗?
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 rootNot trusting file
/media/disk/myWorks/mercurial/hg2/.hg/hgrc
from untrusted user root, group rootabort: 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 rootNot 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 rootNot 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
hg 按顺序从安装、系统、用户和存储库配置文件中读取配置。它不会读取任何它无法信任的配置文件。 hg paths 将显示它读取的所有配置文件中 [path] 部分的所有路径。这可以在
hg showconfig paths
中看到。由于只读取受信任的文件,而 hg2/.hg/hgrc 不受信任(根据错误,它由 root 用户/组拥有,可能是因为它位于相同拥有的外部磁盘上),因此不会被读取。请参阅 hgrc 可信部分 添加用户/值得信任的团体。查看当前存储库正在读取的配置文件列表
hg showconfig --debug
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
该文件可由当前用户以外的其他人修改,因此 Mercurial 不愿意使用这些内容,因为它无法确定它们没有被篡改。
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.
如果要为 hgrc 文件添加全局“root 信任”,可以在 /etc/mercurial/hgrc 文件中添加
trusted.users=root
,然后该计算机的用户应该能够信任root 拥有的 hgrc 文件,无需每个用户编辑其 .hgrc 文件。https://www.mercurial-scm.org/wiki/Trust
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