2017-10-06 85 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