Mercurial HGRCPATH overrides user level .hgrc or installation level configuration file?

My understanding: Mercurial has three levels of configuration files: one for all users (installation level), overriding for each user (user level) and overriding for each repository (repo level).

The HGRCPATH environment variable seems to override the second level found in the users/<user > directory on Windows.

However, on the TortoiseHG settings screen, it refers (and allows direct editing) to the user level configuration file in the users/<user > directory, even if it is overridden by HGRCPATH. A quick experiment showed that TortoiseHG really uses the one installed by HGRCPATH, and not the one that it indicates.

Is this a mistake with the turtle or is my understanding of HGRCPATH flawed?

+4
source share
2 answers

The description in the Mercurial help page sounds as if HGRCPATH was installed, the system-wide file ( /etc/mercurial/hgrc on linux) and the file for each user are ignored, but the file $(hg root)/.hg/hgrc is still executed . It was my experience outside the turtle.

I would not expect the tortoisehg GUI to not show hgrc commands that it doesn't invoke, just to not accept their settings. Is that what you see?

http://www.selenic.com/mercurial/hg.1.html

+3
source

Yes, that should be the downside of TortoiseHg. The hg help environment reference text states that HGRCPATH used to override the default search path for configuration files. This includes ~/.hgrc and allows you to quickly turn off user settings:

 $ HGRCPATH= hg log # <- only read .hg/hgrc, ignore all other config files 

You cannot scroll .hg/hgrc Mercurial .hg/hgrc .

+4
source

Source: https://habr.com/ru/post/1346332/


All Articles