run-tests: move HGRCPATH to env stable
authorMatt Mackall <mpm@selenic.com>
Sun, 02 Jun 2013 16:22:51 -0500
branchstable
changeset 1246 e6ba976e152c
parent 1245 605be28ee4d0
child 1247 7691a1e24745
run-tests: move HGRCPATH to env [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Sun Jun 02 16:22:51 2013 -0500
+++ b/tests/run-tests.py	Sun Jun 02 16:22:51 2013 -0500
@@ -905,8 +905,6 @@
 
     vlog("# Test", test)
 
-    createhgrc(HGRCPATH, options)
-
     if os.path.exists(err):
         os.remove(err)       # Remove any previous output files
 
@@ -935,8 +933,11 @@
     env["HGPORT"] = str(options.port)
     env["HGPORT1"] = str(options.port + 1)
     env["HGPORT2"] = str(options.port + 2)
+    env["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
     env["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
 
+    createhgrc(env['HGRCPATH'], options)
+
     if options.time:
         starttime = time.time()
     ret, out = runner(testpath, testtmp, options, replacements, env)
@@ -1167,9 +1168,6 @@
             break
 
 def runtests(options, tests):
-    global HGRCPATH
-    HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
-
     try:
         if INST:
             installhg(options)
@@ -1300,7 +1298,6 @@
             d = os.getenv('TMP')
         tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
-    HGRCPATH = None
 
     os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
     os.environ["HGMERGE"] = "internal:merge"