如何配置Mercurial以在mercurial.ini中使用环境变量

MW_*_*dev 7 variables environment configuration mercurial

如何修改mercurial.ini文件以包含环境变量,例如%userprofile%.

具体情况:

我正在学习使用Mercurial.我修改了Mercurial.ini[ui]部分(在我的主路径中),包括:

ignore = c:\users\user\.hgignore
Run Code Online (Sandbox Code Playgroud)

用户是我的用户名文字..hgignore文件包含用于在提交期间忽略文件的文件名过滤器.如何将其从文字用户更改为环境变量$ user?

Ry4*_*ase 8

它不会在hgrc中插入环境变量,但我相信即使在Windows上,tilda也会正确扩展到您的home/profile目录.

所以:

ignore = ~/.hgignore
Run Code Online (Sandbox Code Playgroud)

应该在Windows和其他地方工作(甚至斜线自动为你旋转错误的方式).

对于其他变量,您需要获得一些小工具并编写批处理/ cmd文件,提前进行插值,然后将结果移交给mercurial进行处理.