[PATCH] win32: allow hgrc.d on Windows

Steve Borho steve at borho.org
Mon Feb 8 06:28:35 CST 2010


On Mon, Feb 8, 2010 at 1:44 AM, Patrick Mézard <pmezard at gmail.com> wrote:
> Le 07/02/10 23:36, Steve Borho a écrit :
>> On Sun, Feb 7, 2010 at 7:14 AM, Patrick Mézard <pmezard at gmail.com> wrote:
>>> Le 07/02/10 12:34, Steve Borho a écrit :
>>>> # HG changeset patch
>>>> # User Steve Borho <steve at borho.org>
>>>> # Date 1265542462 21600
>>>> # Node ID 14672bbd226694122d0689e85aad714f89afba70
>>>> # Parent  ec02cf8d16286551cdaf7d5fec51f0ef6c5aeef2
>>>> win32: allow hgrc.d on Windows
>>>
>>> Just to know, what will you use that for?
>>
>> I'm refactoring the TortoiseHg installer to make some components
>> optional, and hgrc.d is the only sane way to do this.
>>
>> I would like to do this for the Mercurial MSI installer as well.
>> Right now the ISS script is appending contrib/mergetools.hgrc to
>> contrib/win32/mercurial.ini which is just horrible.  The INI file has
>> dos EOLN and mergetools.hgrc has unix EOLN.   My new MSI installer is
>> a tad more clever.  It appends %include mergetools.hgrc to
>> mercurial.ini.  But still, it's much cleaner to simply install both
>> files into PF\Mercurial\hgrc.d as mercurial.rc and mergetools.rc.
>>
>>> Also, shouldn't be doc/hgrc.5.txt be updated?
>>
>> Excellent point.  If no-one objects, I'll update HGRC.5 and push this to crew.
>
> diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
> --- a/doc/hgrc.5.txt
> +++ b/doc/hgrc.5.txt
> @@ -72,16 +72,19 @@
>     in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
>     to all Mercurial commands executed by any user in any directory.
>
> -| (Windows) ``C:\Mercurial\Mercurial.ini``
> +| (Windows) ``<install-dir>\Mercurial.ini``
> +| (Windows) ``<install-dir>\hgrc.d\*.rc``
>  | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
> -| (Windows) ``<install-dir>\Mercurial.ini``
>
>     Per-installation/system configuration files, for the system on
>     which Mercurial is running. Options in these files apply to all
>     Mercurial commands executed by any user in any directory. Registry
>     keys contain PATH-like strings, every part of which must reference
>     a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
> -    be read.
> +    be read.  Mercurial checks each of these locations in the specified
> +    order until one or more configuration files are detected.  If the
> +    py2win32 extensions are not installed, Mercurial will only look for
> +    site-wide configuration in ``C:\Mercurial\Mercurial.ini``.
>
>
> Did you meant "pywin32" (and singular "is not installed")? or py2exe/pywin32? Or something else?

FWIW: I've always seen pywin32 referred to as Python for Windows
extensions, as in:

http://sourceforge.net/projects/pywin32/

Thus the plural form.

Thanks for catching, I pushed a fix for the typo.

--
Steve Borho


More information about the Mercurial-devel mailing list