[Request] [+ ] D11283: pyoxidized: add a `pyoxidizer` hghave keyword for line matching

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Aug 17 19:34:47 UTC 2021


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

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
 
 
+ at 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'



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210817/3476ef05/attachment.html>


More information about the Mercurial-patches mailing list