equal
deleted
inserted
replaced
34 pycompat, |
34 pycompat, |
35 revset, |
35 revset, |
36 revsetlang, |
36 revsetlang, |
37 scmutil, |
37 scmutil, |
38 smartset, |
38 smartset, |
39 templater, |
|
40 templateutil, |
39 templateutil, |
41 ) |
40 ) |
42 |
41 |
43 from ..utils import stringutil |
42 from ..utils import stringutil |
44 |
43 |
1316 def static(web): |
1315 def static(web): |
1317 fname = web.req.qsparams[b'file'] |
1316 fname = web.req.qsparams[b'file'] |
1318 # a repo owner may set web.static in .hg/hgrc to get any file |
1317 # a repo owner may set web.static in .hg/hgrc to get any file |
1319 # readable by the user running the CGI script |
1318 # readable by the user running the CGI script |
1320 static = web.config(b"web", b"static", untrusted=False) |
1319 static = web.config(b"web", b"static", untrusted=False) |
1321 if not static: |
1320 staticfile(web.templatepath, static, fname, web.res) |
1322 tp = web.templatepath or templater.templatedir() |
|
1323 if tp is not None: |
|
1324 static = os.path.join(tp, b'static') |
|
1325 |
|
1326 staticfile(static, fname, web.res) |
|
1327 return web.res.sendresponse() |
1321 return web.res.sendresponse() |
1328 |
1322 |
1329 |
1323 |
1330 @webcommand(b'graph') |
1324 @webcommand(b'graph') |
1331 def graph(web): |
1325 def graph(web): |