comparison mercurial/hgweb/webcommands.py @ 39793:536f22d6c2c5

hgweb: register web.static to the config table Otherwise we would got a develwarn.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 23 Sep 2018 16:15:48 +0900
parents be0f32ca2671
children 4f44f747f094
comparison
equal deleted inserted replaced
39792:ff0060d2a099 39793:536f22d6c2c5
1219 @webcommand('static') 1219 @webcommand('static')
1220 def static(web): 1220 def static(web):
1221 fname = web.req.qsparams['file'] 1221 fname = web.req.qsparams['file']
1222 # a repo owner may set web.static in .hg/hgrc to get any file 1222 # a repo owner may set web.static in .hg/hgrc to get any file
1223 # readable by the user running the CGI script 1223 # readable by the user running the CGI script
1224 static = web.config("web", "static", None, untrusted=False) 1224 static = web.config("web", "static", untrusted=False)
1225 if not static: 1225 if not static:
1226 tp = web.templatepath or templater.templatepaths() 1226 tp = web.templatepath or templater.templatepaths()
1227 if isinstance(tp, str): 1227 if isinstance(tp, str):
1228 tp = [tp] 1228 tp = [tp]
1229 static = [os.path.join(p, 'static') for p in tp] 1229 static = [os.path.join(p, 'static') for p in tp]