Patchwork [5,of,5] hgweb: evaluate the "default" value as template

login
register
mail settings
Submitter Yuya Nishihara
Date March 18, 2018, 4:39 a.m.
Message ID <2503096ae995e3c1ba4c.1521347981@mimosa>
Download mbox | patch
Permalink /patch/29597/
State Accepted
Headers show

Comments

Yuya Nishihara - March 18, 2018, 4:39 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1459660607 -32400
#      Sun Apr 03 14:16:47 2016 +0900
# Node ID 2503096ae995e3c1ba4c35cdcb68afa3ce786744
# Parent  73de63e4c72042110b744e0838556421c7acaba8
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.

Patch

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