Comments
Patch
@@ -55,6 +55,8 @@
On Unix, the following files are consulted:
- ``<repo>/.hg/hgrc`` (per-repository)
+ - ``$XDG_CONFIG_HOME/hgrc`` (per-user)
+ - ``$HOME/.config/hgrc`` (per-user)
- ``$HOME/.hgrc`` (per-user)
- ``<install-root>/etc/mercurial/hgrc`` (per-installation)
- ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
@@ -41,7 +41,15 @@
if pycompat.sysplatform == 'plan9':
return [encoding.environ['home'] + '/lib/hgrc']
else:
- return [os.path.expanduser('~/.hgrc')]
+ xdg = encoding.environ.get("XDG_CONFIG_HOME")
+ if xdg is not None:
+ return [os.path.join(xdg, "hgrc")]
+ else:
+ cfg = os.path.expanduser("~/.config/hgrc")
+ if os.path.isfile(cfg):
+ return [cfg]
+ else:
+ return [os.path.expanduser('~/.hgrc')]
def termsize(ui):
try: