[PATCH STABLE] ignore python folder included within hackable hg packages

Steve Borho steve at borho.org
Wed Sep 10 03:38:37 CDT 2014

On 09/10, Mads Kiilerich wrote:
> On 09/09/2014 08:44 PM, Steve Borho wrote:
> ># HG changeset patch
> ># User Steve Borho <steve at borho.org>
> ># Date 1410288246 -7200
> >#      Tue Sep 09 20:44:06 2014 +0200
> ># Branch stable
> ># Node ID 9287bf0cdcc890e63f9a596f9e335a9b72a9532c
> ># Parent  71227dc24311b6d83904c50bacf7b339b1454bec
> >ignore python folder included within hackable hg packages
> >
> >the exewrapper.c that builds hg.exe for the hackable hg packages allows two
> >names for the Python install folder, hg-python or python2N where N matches the
> >minor version of Python you compiled against.
> Where / how do the python2N/ stuff happen? Have you tried it? AFAIK it has a
> mechanism for loading python2x.dll from $PATH but no direct alternative to
> hg-python.
> I have a vague recollection that the exewrapper search for hg-python only
> works if the hg.exe is invoked with a path (or in same directory) - it
> doesn't work to place the hackable directory with hg.exe in $PATH. Running
> the tests on windows thus broke and required another hack ... and that
> turned out to be to install a global python with the dlls in $PATH and not
> use hackable at all, or perhaps just to set $PYTHONHOME.

Yeah, I think after staring at exewrapper for a while longer I can see
how it is supposed to work.

It expects an hg-python/ folder in the same directory as hg.exe and it
will try to load pythonXX.dll from that folder based on the version of
python which hg.exe was compiled against.  Unless PYTHONHOME is set, in
which case it just prays pythonXX.dll is in the PATH.

This only work if the Python install you've copied into the hackable
folder was installed "for you only" otherwise pythonXX.dll is installed
in the system folders. Which is what has been tripping me up and making
this all work backwards.

So you would need to leave hg.exe in the same location as hg-python/ for
it to work. To run the tests you would need to do something like:

cd tests
../hg-python/python.exe run-tests.py

run-tests.py tries to build the extensions, which is annoying, so with
my bundle you have to run it from a VC9 x86 shell with DISTUTILS_USE_SDK=1

please ignore this patch.

Steve Borho

More information about the Mercurial-devel mailing list