[PATCH] run-tests: use os.path.realpath() to find hg's setup.py

Greg Ward greg-hg at gerg.ca
Tue Jun 23 21:22:19 CDT 2009


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1245810054 14400
# Node ID 5e6a6fb10a77f1a55e0f9acd49ee5aea6004dc78
# Parent  1e16f9b21ce48244ae24f6d9e20b04c335740ae0
run-tests: use os.path.realpath() to find hg's setup.py.

Needed for running out-of-tree test suites without --with-hg/--local.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -266,7 +266,9 @@
     pure = options.pure and "--pure" or ""
 
     # Run installer in hg root
-    os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..'))
+    script = os.path.realpath(sys.argv[0])
+    hgroot = os.path.dirname(os.path.dirname(script))
+    os.chdir(hgroot)
     cmd = ('%s setup.py %s clean --all'
            ' install --force --prefix="%s" --install-lib="%s"'
            ' --install-scripts="%s" >%s 2>&1'


More information about the Mercurial-devel mailing list