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
--- 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