From patchwork Mon Mar 19 13:45:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,3,V2] hgweb: evaluate the "default" value as template From: Yuya Nishihara X-Patchwork-Id: 29619 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 19 Mar 2018 22:45:05 +0900 # HG changeset patch # User Yuya Nishihara # Date 1459660607 -32400 # Sun Apr 03 14:16:47 2016 +0900 # Node ID cc058f8ed3d6ea8ee9d9a49263ea133c5adff587 # Parent faaed935789fd2b36121a5a5ec407d1cb694d48b hgweb: evaluate the "default" value as template Strictly speaking, everything in the map file is a template. So let's not take out an unparsed template string. 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 @@ -386,7 +386,7 @@ class hgweb(object): self.check_perm(rctx, req, None) if cmd == '': - req.qsparams['cmd'] = rctx.tmpl.cache['default'] + req.qsparams['cmd'] = rctx.tmpl.render('default', {}) cmd = req.qsparams['cmd'] # Don't enable caching if using a CSP nonce because then it wouldn't