# HG changeset patch # User Jun Wu # Date 1501732898 25200 # Node ID 85bfd6a0bdbfde2a1ba9f346f09a75905271a569 # Parent 72b23c9452d6d719532467443f8b3c97b0cd6314 run-tests: extract prefix of bisect commands to a variable This does not change any logic. Differential Revision: https://phab.mercurial-scm.org/D577 diff -r 72b23c9452d6 -r 85bfd6a0bdbf tests/run-tests.py --- a/tests/run-tests.py Wed Aug 02 21:01:38 2017 -0700 +++ b/tests/run-tests.py Wed Aug 02 21:01:38 2017 -0700 @@ -2070,15 +2070,16 @@ savetimes(self._runner._outputdir, result) if failed and self._runner.options.known_good_rev: + bisectcmd = ['hg', 'bisect'] def nooutput(args): p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) p.stdout.read() p.wait() for test, msg in result.failures: - nooutput(['hg', 'bisect', '--reset']), - nooutput(['hg', 'bisect', '--bad', '.']) - nooutput(['hg', 'bisect', '--good', + nooutput(bisectcmd + ['--reset']), + nooutput(bisectcmd + ['--bad', '.']) + nooutput(bisectcmd + ['--good', self._runner.options.known_good_rev]) # TODO: we probably need to forward more options # that alter hg's behavior inside the tests. @@ -2088,7 +2089,7 @@ 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], + sub = subprocess.Popen(bisectcmd + ['--command', rtc], stderr=subprocess.STDOUT, stdout=subprocess.PIPE) data = sub.stdout.read()