1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #2379 open

settings: mercurial.ini search path

created an issue

In mercurial doc (http://www.selenic.com/mercurial/hgrc.5.html), I can read that configuration search path order is the following for windows:

(Windows) %USERPROFILE%\.hgrc
**(Windows) %USERPROFILE%\Mercurial.ini**
(Windows) %HOME%\.hgrc
(Windows) %HOME%\Mercurial.ini
(Windows) <install-dir>\Mercurial.ini or
(Windows) <install-dir>\hgrc.d\*.rc or

With tortoiseHG, when HOME is set, and I open settings, the file that is proposed for global settings is %HOME%/.hgrc, even if I also have a %USERPROFILE%\Mercurial.ini.

Shouldn't it read and modify %USERPROFILE%\Mercurial.ini instead %HOME%/.hgrc ?

Comments (5)

  1. erh

    I might be easier to consider the the docs are wrong. The code clearly puts %HOME% first: https://selenic.com/repo/hg/file/default/mercurial/scmwindows.py#l39

    Used at: https://selenic.com/repo/hg/file/default/mercurial/scmutil.py#l38 https://selenic.com/repo/hg/file/default/mercurial/scmutil.py#l677 https://selenic.com/repo/hg/file/default/mercurial/scmutil.py#l704

    TortoiseHG uses whatever scmutil.userrcpath returns: https://bitbucket.org/tortoisehg/thg/src/5b20d939f72bfd09ec4f8f2fd648c857c5270d7b/tortoisehg/hgqt/settings.py?at=default&fileviewer=file-view-default#settings.py-1205

    If you assume the ordering in the hg code is correct, then thg seems to work properly.

    A related (though perhaps separate?) issue is that the value of HGRCPATH is ignored.

  2. Yuya Nishihara

    I meant because HOME is loaded prior to USERPROFILE, USERPROFILE is stronger than HOME.

    the value of HGRCPATH is ignored.

    If HGRCPATH is specified, there is no distinction between system/user search paths.

  3. Log in to comment