diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -124,6 +124,10 @@ def has_bzr_range(v): except ImportError: return False +@check("chg", "running with chg") +def has_chg(): + return 'CHGHG' in os.environ + @check("cvs", "cvs client/server") def has_cvs(): re = r'Concurrent Versions System.*?server' diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2064,6 +2064,8 @@ class TestRunner(object): chgbindir = self._bindir if self.options.chg or self.options.with_chg: osenvironb[b'CHGHG'] = os.path.join(self._bindir, self._hgcommand) + else: + osenvironb.pop(b'CHGHG', None) # drop flag for hghave if self.options.chg: self._hgcommand = b'chg' elif self.options.with_chg: