marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REVISION SUMMARY Hooks and extensions can rely on PYTHONPATH value. Yet the pyoxidized binary ignore the variable. So we manually reinstall the behavior to fix various tests and restore the expected behavior. This positively affects: - test-extension.t - test-hook.t REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D11302 AFFECTED FILES rust/hgcli/pyoxidizer.bzl CHANGE DETAILS diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl --- a/rust/hgcli/pyoxidizer.bzl +++ b/rust/hgcli/pyoxidizer.bzl @@ -36,6 +36,12 @@ # Code to run in Python interpreter. RUN_CODE = """ +import os +import sys +extra_path = os.environ.get('PYTHONPATH') +if extra_path is not None: + # extensions and hooks expect a working python environment + sys.path[0:0] = extra_path.split(os.pathsep) import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel