有没有一种方法可以使用命令行开关/环境变量在没有任何外部扩展的情况下运行 Mercurial?
例如,在这种情况下:
$ hg version --debug
Mercurial Distributed SCM (version 4.3.3)
[...]
Enabled extensions:
hggit external
hgremotebranches external
mq internal
rebase internal
shelve internal
我怎样才能实现:
$ hg --disable-all-extensions version --debug
Mercurial Distributed SCM (version 4.3.3)
[...]
Enabled extensions:
<empty>
我知道我可以通过 --config extensions.name=!
禁用各个扩展,但我需要立即删除所有内容。
最佳答案
来自hg帮助环境
:
HGRCPATH
A list of files or directories to search for configuration files. Item
separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
platform default search path is used. If empty, only the .hg/hgrc from
the current repository is read.
所以你可以这样做:
HGRCPATH= hg version --debug
mercurial 开发人员鼓励每个人在脚本中使用此咒语,以避免 Mercurial 命令的含义取决于用户的配置。请参阅http://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/automation.html从 Mozilla 获取有关 Mercurial 自动化的更多信息。
关于 Mercurial : disable all the extensions from the command line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46612210/