Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgwebdir_mod.py @ 45235:91aa9bba3dc9
templater: make templatepaths() return a single path, or None
The function returns either a singleton list or an empty list, so it
makes more sense to return a value or None. The plural in the name
also doesn't make sense, but `templatepath()` is already taken, so I
renamed it to `templatedir()` instead.
Differential Revision: https://phab.mercurial-scm.org/D8786
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 21 Jul 2020 13:11:49 -0700 |
parents | bf23d6ee7ec7 |
children | 86f9b25d750b |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Tue Jul 21 13:05:37 2020 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Tue Jul 21 13:11:49 2020 -0700 @@ -414,7 +414,7 @@ fname = req.qsparams[b'static'] static = self.ui.config(b"web", b"static", untrusted=False) if not static: - tp = self.templatepath or templater.templatepaths() + tp = self.templatepath or templater.templatedir() if isinstance(tp, bytes): tp = [tp] static = [os.path.join(p, b'static') for p in tp]