2017-10-06 78 views
0

有没有使用命令行开关/环境变量运行mercurial而没有任何外部扩展的方法?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=!禁用个别扩展,但我需要一次核弹的一切。

回答

3

hg help environment

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的更多信息,请参阅http://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/automation.html