Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 45201:86f9b25d750b
hgweb: simplify now that we always have a single path
Both `templatedir()` and `web.templatepath` are now always a single
path (or None).
Differential Revision: https://phab.mercurial-scm.org/D8788
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 21 Jul 2020 13:36:48 -0700 |
parents | 91aa9bba3dc9 |
children | d5ccc059fbcd |
comparison
equal
deleted
inserted
replaced
45200:4e9b39033d3f | 45201:86f9b25d750b |
---|---|
413 else: | 413 else: |
414 fname = req.qsparams[b'static'] | 414 fname = req.qsparams[b'static'] |
415 static = self.ui.config(b"web", b"static", untrusted=False) | 415 static = self.ui.config(b"web", b"static", untrusted=False) |
416 if not static: | 416 if not static: |
417 tp = self.templatepath or templater.templatedir() | 417 tp = self.templatepath or templater.templatedir() |
418 if isinstance(tp, bytes): | 418 static = [os.path.join(tp, b'static')] |
419 tp = [tp] | |
420 static = [os.path.join(p, b'static') for p in tp] | |
421 | 419 |
422 staticfile(static, fname, res) | 420 staticfile(static, fname, res) |
423 return res.sendresponse() | 421 return res.sendresponse() |
424 | 422 |
425 # top-level index | 423 # top-level index |