This is an archive of the discontinued Mercurial Phabricator instance.

templater: start passing resource to read from into _readmapfile()
ClosedPublic

Authored by martinvonz on Aug 5 2020, 12:26 PM.

Details

Summary

This patch makes it so we pass in a file-like resource to read from
instead of having _readmapfile() open the file. This is one more
step towards making _readmapfile() able to read resources opened by
from importlib.resources. We still need to pass in the mapfile path
because it's used for loading dependent mapfiles from %include and
__base__, and it's also used for giving the user better error
messages. Besides that, one can safely call _readmapfile() with any
file-like resource after this patch.

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.