Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 36879:98baf8dea553
hgweb: port static file handling to new response API
hgwebdir_mod hasn't received as much porting effort. So we had to
do some minor plumbing to get it to match hgweb_mod and to support
the new response object.
Differential Revision: https://phab.mercurial-scm.org/D2789
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 10 Mar 2018 15:46:29 -0800 |
parents | 89002d07a114 |
children | 16499427f6de |
comparison
equal
deleted
inserted
replaced
36878:89002d07a114 | 36879:98baf8dea553 |
---|---|
1230 if not static: | 1230 if not static: |
1231 tp = web.templatepath or templater.templatepaths() | 1231 tp = web.templatepath or templater.templatepaths() |
1232 if isinstance(tp, str): | 1232 if isinstance(tp, str): |
1233 tp = [tp] | 1233 tp = [tp] |
1234 static = [os.path.join(p, 'static') for p in tp] | 1234 static = [os.path.join(p, 'static') for p in tp] |
1235 staticfile(static, fname, req) | 1235 |
1236 return [] | 1236 staticfile(static, fname, web.res) |
1237 return web.res | |
1237 | 1238 |
1238 @webcommand('graph') | 1239 @webcommand('graph') |
1239 def graph(web, req, tmpl): | 1240 def graph(web, req, tmpl): |
1240 """ | 1241 """ |
1241 /graph[/{revision}] | 1242 /graph[/{revision}] |