changeset 47586:a8e33ab50c4f

run-tests: use more explicit signaling for `chg` Using a dedicated variable is clearer and less fragile. It cannot hurt. Differential Revision: https://phab.mercurial-scm.org/D11051
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 10 Jul 2021 01:58:34 +0200
parents 5654323832f0
children be496e3489b9
files tests/hghave.py tests/run-tests.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Sat Jul 10 01:57:35 2021 +0200
+++ b/tests/hghave.py	Sat Jul 10 01:58:34 2021 +0200
@@ -191,7 +191,7 @@
 
 @check("chg", "running with chg")
 def has_chg():
-    return 'CHGHG' in os.environ
+    return 'CHG_INSTALLED_AS_HG' in os.environ
 
 
 @check("rhg", "running with rhg as 'hg'")
--- a/tests/run-tests.py	Sat Jul 10 01:57:35 2021 +0200
+++ b/tests/run-tests.py	Sat Jul 10 01:58:34 2021 +0200
@@ -3165,9 +3165,11 @@
         # set CHGHG, then replace "hg" command by "chg"
         chgbindir = self._bindir
         if self.options.chg or self.options.with_chg:
+            osenvironb[b'CHG_INSTALLED_AS_HG'] = b'1'
             osenvironb[b'CHGHG'] = real_hg
         else:
-            osenvironb.pop(b'CHGHG', None)  # drop flag for hghave
+            # drop flag for hghave
+            osenvironb.pop(b'CHG_INSTALLED_AS_HG', None)
         if self.options.chg:
             self._hgcommand = b'chg'
         elif self.options.with_chg: