changeset 47831:94158c541c74 stable

pyoxidized: add a `pyoxidizer` hghave keyword for line matching Some output line can be affected by pyoxidizer, for example the source file path are replaced by the module name. We introduce a new condition keyword to cope with this. Differential Revision: https://phab.mercurial-scm.org/D11283
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 17 Aug 2021 20:48:34 +0200
parents 981cef5188c3
children 7835f2696de8
files tests/hghave.py tests/run-tests.py
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Tue Aug 17 14:38:25 2021 +0200
+++ b/tests/hghave.py	Tue Aug 17 20:48:34 2021 +0200
@@ -199,6 +199,11 @@
     return 'RHG_INSTALLED_AS_HG' in os.environ
 
 
+@check("pyoxidizer", "running with pyoxidizer build as 'hg'")
+def has_rhg():
+    return 'PYOXIDIZED_INSTALLED_AS_HG' in os.environ
+
+
 @check("cvs", "cvs client/server")
 def has_cvs():
     re = br'Concurrent Versions System.*?server'
--- a/tests/run-tests.py	Tue Aug 17 14:38:25 2021 +0200
+++ b/tests/run-tests.py	Tue Aug 17 20:48:34 2021 +0200
@@ -3241,6 +3241,10 @@
             )
             full_path = os.path.join(reporootdir, bin_path)
             self._hgcommand = full_path
+            # Affects hghave.py
+            osenvironb[b'PYOXIDIZED_INSTALLED_AS_HG'] = b'1'
+        else:
+            osenvironb.pop(b'PYOXIDIZED_INSTALLED_AS_HG', None)
 
         osenvironb[b"BINDIR"] = self._bindir
         osenvironb[b"PYTHON"] = PYTHON