# HG changeset patch # User Jun Wu # Date 1501732898 25200 # Node ID 72b23c9452d6d719532467443f8b3c97b0cd6314 # Parent bc2535238de20bd116b04121ddac94614d9e553f 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 diff -r bc2535238de2 -r 72b23c9452d6 tests/run-tests.py --- 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)