# HG changeset patch # User Patrick Mezard # Date 1305574010 -7200 # Node ID 1f7fd6db1e178a0348c7875835d1ad891b267be3 # Parent 92325072c4d4a0db46056f01072417218b211001 run-tests: fix hg.bat python reference hg.bat expects to live in pythonxx/scripts and the python interpreter to be in pythonxx. run-tests.py file layout is a little different and python location must be fixed. [ original upstream message ] diff -r 92325072c4d4 -r 1f7fd6db1e17 tests/run-tests.py --- a/tests/run-tests.py Mon May 16 21:24:14 2011 +0200 +++ b/tests/run-tests.py Mon May 16 21:26:50 2011 +0200 @@ -440,6 +440,22 @@ f.write(line + '\n') f.close() + hgbat = os.path.join(BINDIR, 'hg.bat') + if os.path.isfile(hgbat): + # hg.bat expects to be put in bin/scripts while run-tests.py + # installation layout put it in bin/ directly. Fix it + f = open(hgbat, 'rb') + data = f.read() + f.close() + if '"%~dp0..\python" "%~dp0hg" %*' in data: + data = data.replace('"%~dp0..\python" "%~dp0hg" %*', + '"%~dp0python" "%~dp0hg" %*') + f = open(hgbat, 'wb') + f.write(data) + f.close() + else: + print 'WARNING: cannot fix hg.bat reference to python.exe' + if options.anycoverage: custom = os.path.join(TESTDIR, 'sitecustomize.py') target = os.path.join(PYTHONDIR, 'sitecustomize.py')