[PATCH 4 of 5] run-tests: install hg after computing tests to run

Siddharth Agarwal sid0 at fb.com
Tue Jun 6 17:39:27 EDT 2017


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1496782613 25200
#      Tue Jun 06 13:56:53 2017 -0700
# Node ID 29aaeed22502929559e1e85d8fb0c1ed6433ecba
# Parent  cd0fe3fedddab358d47d6f34d5c1e596298199bb
run-tests: install hg after computing tests to run

We're going to add a way to list tests, and we don't need to install hg for
that.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2347,15 +2347,6 @@ class TestRunner(object):
             return self._gettest(desc, i)
 
         try:
-            if self._installdir:
-                self._installhg()
-                self._checkhglib("Testing")
-            else:
-                self._usecorrectpython()
-            if self.options.chg:
-                assert self._installdir
-                self._installchg()
-
             if self.options.restart:
                 orig = list(testdescs)
                 while testdescs:
@@ -2393,6 +2384,16 @@ class TestRunner(object):
             if self.options.verbose:
                 verbosity = 2
             runner = TextTestRunner(self, verbosity=verbosity)
+
+            if self._installdir:
+                self._installhg()
+                self._checkhglib("Testing")
+            else:
+                self._usecorrectpython()
+            if self.options.chg:
+                assert self._installdir
+                self._installchg()
+
             result = runner.run(suite)
 
             if result.failures:


More information about the Mercurial-devel mailing list