[PATCH 1 of 1] freedesktop compliance: add ~/.config/mercurial/hgrc to configuration paths
Mads Kiilerich
mads at kiilerich.com
Tue Mar 23 03:14:24 CDT 2010
Nicolas Dumazet wrote, On 03/23/2010 03:59 AM:
> # HG changeset patch
> # User Nicolas Dumazet<nicdumz.commits at gmail.com>
> # Date 1269312897 -32400
> # Node ID 6bb2afdabe2168bb381407520ccdcacebbc6dea7
> # Parent 53313405b54d25f0f30ae64f9df3d33a239cb559
> freedesktop compliance: add ~/.config/mercurial/hgrc to configuration paths
>
> This solves issue2105.
>
> diff --git a/mercurial/posix.py b/mercurial/posix.py
> --- a/mercurial/posix.py
> +++ b/mercurial/posix.py
> @@ -44,7 +44,7 @@
> return path
>
> def user_rcpath():
> - return [os.path.expanduser('~/.hgrc')]
> + return map(os.path.expanduser, ('~/.hgrc', '~/.config/mercurial/hgrc'))
>
One reason to do this would be freedesktop / XDG compliance, so perhaps
we should adhere more to
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
and do something like
return [os.path.expanduser('~/.hgrc'),
(os.environ.get('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')) + '/mercurial/hgrc'
]
/Mads
More information about the Mercurial-devel
mailing list