[PATCH v3] hg: allow usage of XDG_CONFIG_HOME and $HOME/.config/hg/hgrc

Sean Farley sean at farley.io
Tue Feb 21 18:54:35 EST 2017


Yuya Nishihara <yuya at tcha.org> writes:

> On Tue, 14 Feb 2017 15:53:24 +0100, David Demelier wrote:
>> Le 14/02/2017 à 14:34, Yuya Nishihara a écrit :
>> > On Mon, 13 Feb 2017 09:37:48 -0800, Jun Wu wrote:
>> >> Excerpts from David Demelier's message of 2017-02-13 15:43:45 +0100:
>> >>> Le 10/02/2017 à 10:08, Raffaele Salmaso a écrit :
>> >>>> Hi,
>> >>>>
>> >>>> On Fri, Feb 10, 2017 at 9:19 AM, David Demelier
>> >>>> <demelier.david at gmail.com <mailto:demelier.david at gmail.com>> wrote:
>> >>>>
>> >>>>     I've updated the code so that hg config --edit still create a
>> >>>>     ~/.hgrc file first if no file is found.
>> >>>>
>> >>>> Why?
>> >>>> If you support this specs, I expect it does the right thing by default
>> >>>> (or at least ask, if any)
>> >>>>
>> >>>> A lot of things can go wrong even for $HOME/.hgrc, so I don't think it
>> >>>> is a bigger problem creating a directory first
>> >>>>
>> >>>
>> >>> I have no problem with this but I would like to know if everybody agree
>> >>> with that.
>> >>>
>> >>
>> >> I'm +1 on creating the directory and editing XDG_CONFIG_HOME/hg/hgrc if
>> >> ~/.hgrc does not exist.
>> >
>> > -1 for compatibility with old versions. Since old hg won't read .config/hg/hgrc,
>> > creating it by default could confuse users.
>> >
>> 
>> So if I understand correctly, that means:
>> 
>> 1. the user installs a recent version of Mercurial
>> 2. the user init a config using hg config --edit
>> 3. the user downgrades Mercurial
>
> Yes. Alternatively,
>
>  3. the user switch to another host sharing HOME

Or in my too frequent case:

3. the user activates a different virtualenv


More information about the Mercurial-devel mailing list