This is an archive of the discontinued Mercurial Phabricator instance.

help: get helptext/ data from `resources` module if available
ClosedPublic

Authored by martinvonz on Dec 12 2019, 6:44 PM.

Details

Summary

For PyOxidizer, we need to read configs using the resources
module. This patch makes it so we use that module if available
(i.e. Python >= 3.7). It does that by adding a new open_resource()
function to our resourceutil module.

Tested by running $PYTHON ./hg help pager for each $PYTHON in
{python2, python3.6, python3.7}.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Dec 12 2019, 6:44 PM
mharbison72 added inline comments.
mercurial/utils/resourceutil.py
45

s/open_resouce/open_resource/

martinvonz updated this revision to Diff 18684.Dec 13 2019, 3:01 AM
martinvonz marked an inline comment as done.Dec 13 2019, 3:01 AM
martinvonz added inline comments.
mercurial/utils/resourceutil.py
45

Oops, done.

indygreg accepted this revision.Dec 14 2019, 7:34 PM

This seems like a reasonable and lightweight implementation of resource reading!

This revision is now accepted and ready to land.Dec 14 2019, 7:34 PM
martinvonz marked an inline comment as done.Dec 14 2019, 10:11 PM
This revision was automatically updated to reflect the committed changes.