Mercurial > hg
diff mercurial/hgweb/hgwebdir_mod.py @ 45378:dc9fe90bdbd5
hgweb: let staticfile() look up path from default location unless provided
This reduces duplication between the two callers.
Differential Revision: https://phab.mercurial-scm.org/D8934
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 22 Aug 2020 16:03:44 -0700 |
parents | 1a4f925f72c3 |
children | d4ba4d51f85f |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Mon Aug 03 22:40:05 2020 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Sat Aug 22 16:03:44 2020 -0700 @@ -413,12 +413,7 @@ else: fname = req.qsparams[b'static'] static = self.ui.config(b"web", b"static", untrusted=False) - if not static: - tp = self.templatepath or templater.templatedir() - if tp is not None: - static = os.path.join(tp, b'static') - - staticfile(static, fname, res) + staticfile(self.templatepath, static, fname, res) return res.sendresponse() # top-level index