[PATCH] hgweb: allow web.templates to be a list

Anton Shestakov engored at ya.ru
Wed Jul 13 11:52:09 EDT 2016


13.07.2016, 02:23, "Ross Light" <light at google.com>:
> # HG changeset patch
> # User Ross Light <light at google.com>
> # Date 1468018129 25200
> # Fri Jul 08 15:48:49 2016 -0700
> # Node ID f93fdaa22399c1dcaa82034a73c04cafcf45bb4e
> # Parent 1b38cfde9530331d8d5767aa09a0de7d90931845
> hgweb: allow web.templates to be a list
>
> templater already supports searching multiple directories, but the config value
> was read in as one string. This allows the web.templates setting to use this
> functionality.
>
> diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
> --- a/mercurial/help/config.txt
> +++ b/mercurial/help/config.txt
> @@ -2093,8 +2093,8 @@
>      Example: ``monoblue``.
>
>  ``templates``
> - Where to find the HTML templates. The default path to the HTML templates
> - can be obtained from ``hg debuginstall``.
> + List of directories to search for the HTML templates. The default path
> + to the HTML templates can be obtained from ``hg debuginstall``.
>
>  ``websub``
>  ----------
> diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
> --- a/mercurial/hgweb/hgweb_mod.py
> +++ b/mercurial/hgweb/hgweb_mod.py
> @@ -99,7 +99,8 @@
>          # we use untrusted=False to prevent a repo owner from using
>          # web.templates in .hg/hgrc to get access to any file readable
>          # by the user running the CGI script
> - self.templatepath = self.config('web', 'templates', untrusted=False)
> + self.templatepath = self.configlist('web', 'templates',
> + untrusted=False) or None
>
>          # This object is more expensive to build than simple config values.
>          # It is shared across requests. The app will replace the object

The patch applies and passes tests, which is good. Unfortunately, only I could see it, because it again didn't make it to mercurial-devel thanks to google.com's DMARC. I heard that "using an app key" works, whatever that means.

Please resend this (whenever you have time) so that other people can see it and chime in.

Also, don't forget to use --flag V2 (would be V3 for me) for hg email so it's clear which version supersedes which.


More information about the Mercurial-devel mailing list