comparison mercurial/hgweb/webcommands.py @ 45327:9a5c4875a88c

hgweb: simplify staticfile() now that we always pass it a single directory I didn't realize this further simplifications enabled by D8786 until now. Differential Revision: https://phab.mercurial-scm.org/D8874
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 03 Aug 2020 22:15:45 -0700
parents 86f9b25d750b
children da3b7c80aa34
comparison
equal deleted inserted replaced
45326:e2320bb7a99f 45327:9a5c4875a88c
1318 # a repo owner may set web.static in .hg/hgrc to get any file 1318 # a repo owner may set web.static in .hg/hgrc to get any file
1319 # readable by the user running the CGI script 1319 # readable by the user running the CGI script
1320 static = web.config(b"web", b"static", untrusted=False) 1320 static = web.config(b"web", b"static", untrusted=False)
1321 if not static: 1321 if not static:
1322 tp = web.templatepath or templater.templatedir() 1322 tp = web.templatepath or templater.templatedir()
1323 static = [os.path.join(tp, b'static')] 1323 static = os.path.join(tp, b'static')
1324 1324
1325 staticfile(static, fname, web.res) 1325 staticfile(static, fname, web.res)
1326 return web.res.sendresponse() 1326 return web.res.sendresponse()
1327 1327
1328 1328