Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 46736:a6553ba1c598
tests: Enable rhg fallback to Python by default in tests
This premise of `run-tests.py --rhg`: fallback should make
`rhg` behave the same as `hg`, except faster in some cases.
To test run the whole test suite with installed `rhg` as `hg`
and with fallback enabled.
Differential Revision: https://phab.mercurial-scm.org/D10187
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Tue, 02 Mar 2021 22:42:10 +0100 |
parents | fb2368598281 |
children | 78e6700ab009 |
line wrap: on
line diff
--- a/tests/run-tests.py Fri Mar 12 18:45:32 2021 +0100 +++ b/tests/run-tests.py Tue Mar 02 22:42:10 2021 +0100 @@ -967,7 +967,6 @@ slowtimeout=None, usechg=False, chgdebug=False, - rhg_fallback_exe=None, useipv6=False, ): """Create a test from parameters. @@ -1025,7 +1024,6 @@ self._hgcommand = hgcommand or b'hg' self._usechg = usechg self._chgdebug = chgdebug - self._rhg_fallback_exe = rhg_fallback_exe self._useipv6 = useipv6 self._aborted = False @@ -1508,12 +1506,6 @@ hgrc.write(b'ipv6 = %r\n' % self._useipv6) hgrc.write(b'server-header = testing stub value\n') - if self._rhg_fallback_exe: - hgrc.write(b'[rhg]\n') - hgrc.write( - b'fallback-executable = %s\n' % self._rhg_fallback_exe - ) - for opt in self._extraconfigopts: section, key = _sys2bytes(opt).split(b'.', 1) assert b'=' in key, ( @@ -2999,7 +2991,6 @@ self._coveragefile = None self._createdfiles = [] self._hgcommand = None - self._rhg_fallback_exe = None self._hgpath = None self._portoffset = 0 self._ports = {} @@ -3140,10 +3131,17 @@ chgbindir = os.path.dirname(os.path.realpath(self.options.with_chg)) self._hgcommand = os.path.basename(self.options.with_chg) - # set fallback executable path, then replace "hg" command by "rhg" + # configure fallback and replace "hg" command by "rhg" rhgbindir = self._bindir if self.options.rhg or self.options.with_rhg: - self._rhg_fallback_exe = os.path.join(self._bindir, self._hgcommand) + # Affects configuration. Alternatives would be setting configuration through + # `$HGRCPATH` but some tests override that, or changing `_hgcommand` to include + # `--config` but that disrupts tests that print command lines and check expected + # output. + osenvironb[b'RHG_ON_UNSUPPORTED'] = b'fallback' + osenvironb[b'RHG_FALLBACK_EXECUTABLE'] = os.path.join( + self._bindir, self._hgcommand + ) if self.options.rhg: self._hgcommand = b'rhg' elif self.options.with_rhg: @@ -3477,7 +3475,6 @@ hgcommand=self._hgcommand, usechg=bool(self.options.with_chg or self.options.chg), chgdebug=self.options.chg_debug, - rhg_fallback_exe=self._rhg_fallback_exe, useipv6=useipv6, **kwds )