[PATCH 3 of 3] run-tests: check mercurial path with hg
Simon Heimberg
simohe at besonet.ch
Wed Apr 22 05:01:44 CDT 2009
# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1240384401 -7200
# Node ID 3c065c600270f67c19d8fed17076dff602189f72
# Parent 8dcac5c4675773c3353043834375f0585628e356
run-tests: check mercurial path with hg
for the case when hg is a shell script which modifies PYTHONPATH
diff -r 8dcac5c46757 -r 3c065c600270 tests/run-tests.py
--- a/tests/run-tests.py Mit Apr 22 09:11:46 2009 +0200
+++ b/tests/run-tests.py Mit Apr 22 09:13:21 2009 +0200
@@ -269,10 +269,22 @@
os.path.join(TESTDIR,'coverage.py'))
def _hgpath():
- cmd = '%s -c "import mercurial; print mercurial.__path__[0]"'
+ extpath = os.path.join(HGTMP, 'printpath.py')
+ f = open(extpath, 'w')
+ f.write("""
+import mercurial
+
+def printpath(*args):
+ print mercurial.__path__[0]
+
+cmdtable = { "printpath": (printpath, [], 'printpath')}
+"""
+ f.close()
+ cmd = 'hg --config extensions.printpath="%s" printpath' % extpath
hgpath = os.popen(cmd % PYTHON)
path = hgpath.read().strip()
hgpath.close()
+ os.unlink(extpath)
return path
def outputcoverage(options):
More information about the Mercurial-devel
mailing list