Comments
Patch
@@ -38,6 +38,7 @@ ones.
- ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
- ``/etc/mercurial/hgrc`` (per-system)
- ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
+ - ``<internal>/default.d/*.rc`` (defaults)
.. container:: verbose.windows
@@ -51,6 +52,7 @@ ones.
- ``<install-dir>\Mercurial.ini`` (per-installation)
- ``<install-dir>\hgrc.d\*.rc`` (per-installation)
- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
+ - ``<internal>/default.d/*.rc`` (defaults)
.. note::
@@ -67,6 +69,7 @@ ones.
- ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
- ``/lib/mercurial/hgrc`` (per-system)
- ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
+ - ``<internal>/default.d/*.rc`` (defaults)
Per-repository configuration options only apply in a
particular repository. This file is not version-controlled, and
@@ -102,6 +105,13 @@ is running. Options in these files apply
executed by any user in any directory. Options in these files
override per-installation options.
+Mercurial comes with some default configuration. The default configuration
+files are installed with Mercurial and will be overwritten on upgrades. Default
+configuration files should never be edited by users or administrators but can
+be overridden in other configuration files. So far the directory only contains
+merge tool configuration but packagers can also put other default configuration
+there.
+
Syntax
======
@@ -495,7 +495,13 @@ def walkrepos(path, followsym=False, see
def osrcpath():
'''return default os-specific hgrc search path'''
- path = systemrcpath()
+ path = []
+ defaultpath = os.path.join(util.datapath, 'default.d')
+ if os.path.isdir(defaultpath):
+ for f, kind in osutil.listdir(defaultpath):
+ if f.endswith('.rc'):
+ path.append(os.path.join(defaultpath, f))
+ path.extend(systemrcpath())
path.extend(userrcpath())
path = [os.path.normpath(f) for f in path]
return path
@@ -517,6 +517,7 @@ cygwinccompiler.Mingw32CCompiler = Hacke
packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
'help/*.txt',
+ 'default.d/*.rc',
'dummycert.pem']}
def ordinarypath(p):