Mercurial > hg
diff mercurial/hgweb/hgwebdir_mod.py @ 45318:1a4f925f72c3
hgweb: enable reading styles from resources in frozen binaries
All we need to do to read styles from resources is to pass the
file-like object we get from `open_template()` on to `frommapfile()`.
This takes the number of failing tests with PyOxidizer from 62 to 54.
Differential Revision: https://phab.mercurial-scm.org/D8901
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 05 Aug 2020 14:19:42 -0700 |
parents | d12fba074cc6 |
children | dc9fe90bdbd5 |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Wed Aug 05 14:03:45 2020 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Wed Aug 05 14:19:42 2020 -0700 @@ -542,7 +542,7 @@ return self.ui.config(*args, **kwargs) vars = {} - styles, (style, mapfile) = hgweb_mod.getstyle( + styles, (style, mapfile, fp) = hgweb_mod.getstyle( req, config, self.templatepath ) if style == styles[0]: @@ -577,5 +577,6 @@ else: yield config(b'web', b'motd') - tmpl = templater.templater.frommapfile(mapfile, defaults=defaults) - return tmpl + return templater.templater.frommapfile( + mapfile, fp=fp, defaults=defaults + )