Mercurial : disable all the extensions from the command line

标签 mercurial mercurial-extension

有没有一种方法可以使用命令行开关/环境变量在没有任何外部扩展的情况下运行 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/

相关文章:

git - 为与 master 完全无关的代码创建分支不是很奇怪吗?

Mercurial 转换更改行尾?

svn - 使用 svnsync & hg convert 将 SVN 同步到 Mercurial——未命中 svn :externals?

Mercurial 更新以激活书签

运行多个存储库的 Mercurial 服务器

mercurial - 使用hg-git时不推送任何更改

mercurial - HG : Checkout 'tipmost' tag

python - 在 Hg 扩展中重载 pull 命令

python - Mercurial API : repo. changectx(change) 不存在!

mercurial - 如何从上游存储库获取文件的副本?