# HG changeset patch # User Patrick Mezard # Date 2011-05-16 19:26:50 # Node ID 0cbf0d1f79392f69fe425365043f56980b709e55 # Parent 220f31030e7fbf7f221a282aa8bc96c1deb05d9d 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -440,6 +440,22 @@ def installhg(options): 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')