changeset 34056:72b23c9452d6

run-tests: pass --with-hg to run-tests.py command used by bisect This makes `run-tests.py -l test-run-tests.t` 23 seconds faster on my laptop. Inside the test, `$ rt --known-good-rev=0 test-bisect.t` took 24.9 seconds before, and 1.2 seconds after. Differential Revision: https://phab.mercurial-scm.org/D576
author Jun Wu <quark@fb.com>
date Wed, 02 Aug 2017 21:01:38 -0700
parents bc2535238de2
children 85bfd6a0bdbf
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Aug 28 13:43:25 2017 -0700
+++ b/tests/run-tests.py	Wed Aug 02 21:01:38 2017 -0700
@@ -2080,9 +2080,14 @@
                     nooutput(['hg', 'bisect', '--bad', '.'])
                     nooutput(['hg', 'bisect', '--good',
                               self._runner.options.known_good_rev])
-                    # TODO: we probably need to forward some options
+                    # TODO: we probably need to forward more options
                     # that alter hg's behavior inside the tests.
-                    rtc = '%s %s %s' % (sys.executable, sys.argv[0], test)
+                    opts = ''
+                    withhg = self._runner.options.with_hg
+                    if withhg:
+                        opts += ' --with-hg=%s ' % shellquote(withhg)
+                    rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts,
+                                           test)
                     sub = subprocess.Popen(['hg', 'bisect', '--command', rtc],
                                            stderr=subprocess.STDOUT,
                                            stdout=subprocess.PIPE)