How do I configure Mercurial to use environment variables in mercurial.ini
configuration, environment, mercurial, variables
Solution
It won't interpolate environment variables in the hgrc, but I do believe that tilda expands to your home/profile directory correctly even on windows.
So:
ignore = ~/.hgignore
should work on windows and elsewhere (even the slashes get spun the wrong way automatically for you).
For other variables you'd need to get a little tricker and write a batch/cmd file that does the interpolation in advance and then hands the result off to mercurial for processing.
Problem
How can I modify the mercurial.ini file to include an environment variable such as %userprofile%. Specific situation: I am learning to use Mercurial. I have modified the [ui] section of Mercurial.ini (in my home path) to include: ``` ignore = c:\users\user\.hgignore ``` Where user is my username literal. The .hgignore file includes filename filters that are used to ignore files during commit. How can I alter it from being the a literal user to an environment variable $user?