Snagged from the manpages at https://www.selenic.com/mercurial/hgrc.5.html.
Files
Mercurial reads configuration data from several files, if they exist.
These files do not exist by default and you will have to create the
appropriate configuration files yourself:
Local configuration is put into the per-repository /.hg/hgrc
file.
Global configuration like the username setting is typically put into:
%USERPROFILE%\mercurial.ini
$HOME/.hgrc
The names of these files depend on the system on which Mercurial is
installed. *.rc files from a single directory are read in alphabetical
order, later ones overriding earlier ones. Where multiple paths are
given below, settings from earlier paths override later ones.
On Unix, the following files are consulted:
- /.hg/hgrc (per-repository)
- $HOME/.hgrc (per-user)
- /etc/mercurial/hgrc (per-installation)
- /etc/mercurial/hgrc.d/*.rc (per-installation)
- /etc/mercurial/hgrc (per-system)
- /etc/mercurial/hgrc.d/*.rc (per-system)
- /default.d/*.rc (defaults)
On Windows, the following files are consulted:
- /.hg/hgrc (per-repository)
- %USERPROFILE%.hgrc (per-user)
- %USERPROFILE%\Mercurial.ini (per-user)
- %HOME%.hgrc (per-user)
- %HOME%\Mercurial.ini (per-user)
- HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (per-installation)
- \hgrc.d*.rc (per-installation)
- \Mercurial.ini (per-installation)
- /default.d/*.rc (defaults)