Patchwork D11283: pyoxidized: add a `pyoxidizer` hghave keyword for line matching

login
register
mail settings
Submitter phabricator
Date Aug. 17, 2021, 7:34 p.m.
Message ID <differential-rev-PHID-DREV-d2d55e6jhhesy47fqmw7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49598/
State Superseded
Headers show

Comments

phabricator - Aug. 17, 2021, 7:34 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11283

AFFECTED FILES
  tests/hghave.py
  tests/run-tests.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -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'