我的理解:Mercurial 有三个级别的配置文件:一个由所有用户共享(安装级别),一个为每个用户覆盖一个(用户级别),一个为每个存储库覆盖一个(存储库级别)。
HGRCPATH 环境变量似乎覆盖了第二级,即 Windows 中 users/>
目录中的级别。
然而,在 TortoiseHG 的设置屏幕中,它引用(并允许直接编辑)users/>
目录中的用户级别配置文件,即使被覆盖HGRC 路径。快速实验表明,TortoiseHG 确实使用 HGRCPATH 设置的一组,而不是它指示的一组。
这是 Tortoise 的错误还是我对 HGRCPATH 的理解有缺陷?
My understanding: Mercurial has three levels of config files: one shared by all users (installation level), an overriding one for each user (user level) and an overriding one for each repository (repo level).
The HGRCPATH environment variable appears to override the second level, the one found in the users/<user
> directory in Windows.
However in TortoiseHG's settings screen, it refers to (and allows direct edit of) the user level config file in the users/<user
> directory, even when overridden by HGRCPATH. Quick experimentation has shown that TortoiseHG indeed uses the one set by HGRCPATH, not the one it indicates.
Is this a bug with Tortoise or is my understanding of HGRCPATH flawed?
发布评论
评论(2)
是的,这一定是TortoiseHg 的缺陷。
hg 帮助环境
帮助文本表示HGRCPATH
用于覆盖配置文件的默认搜索路径。这包括~/.hgrc
并让您快速禁用用户设置:您无法使 Mercurial 跳过读取
.hg/hgrc
。Yes, this must be a flaw in TortoiseHg. The
hg help environment
help text says thatHGRCPATH
is used to override the default search path for configuration files. This includes~/.hgrc
and lets you quickly disable your user settings:You cannot make Mercurial skip reading
.hg/hgrc
.Mercurial 手册页中的描述听起来好像如果设置了 HGRCPATH,那么系统范围的文件(Linux 上的
/etc/mercurial/hgrc
)和每个用户的文件都会被忽略,但是 <仍会查阅 code>$(hg root)/.hg/hgrc 文件。这是我在 tortoisehg 之外的经历。我不希望 tortoisehg GUI 不显示它不调用的 hgrc 命令,只是不接受它们的设置。这就是你所看到的吗?
http://www.selenic.com/mercurial/hg.1.html
The description in the Mercurial manpage makes it sound like if HGRCPATH is set then both the system-wide file (
/etc/mercurial/hgrc
on linux) and per-user file are ignored, but that the$(hg root)/.hg/hgrc
file is still consulted. That's been my experience outside of tortoisehg.I wouldn't expect the tortoisehg GUI to not-show the hgrc commands its not invoking, just to not take in their settings. Is that what you're seeing?
http://www.selenic.com/mercurial/hg.1.html