changeset 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 4e9b39033d3f
children 31393ec06cef
files mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/webcommands.py
diffstat 2 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue Jul 21 13:41:26 2020 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Tue Jul 21 13:36:48 2020 -0700
@@ -415,9 +415,7 @@
                 static = self.ui.config(b"web", b"static", untrusted=False)
                 if not static:
                     tp = self.templatepath or templater.templatedir()
-                    if isinstance(tp, bytes):
-                        tp = [tp]
-                    static = [os.path.join(p, b'static') for p in tp]
+                    static = [os.path.join(tp, b'static')]
 
                 staticfile(static, fname, res)
                 return res.sendresponse()
--- a/mercurial/hgweb/webcommands.py	Tue Jul 21 13:41:26 2020 -0700
+++ b/mercurial/hgweb/webcommands.py	Tue Jul 21 13:36:48 2020 -0700
@@ -1320,9 +1320,7 @@
     static = web.config(b"web", b"static", untrusted=False)
     if not static:
         tp = web.templatepath or templater.templatedir()
-        if isinstance(tp, bytes):
-            tp = [tp]
-        static = [os.path.join(p, b'static') for p in tp]
+        static = [os.path.join(tp, b'static')]
 
     staticfile(static, fname, web.res)
     return web.res.sendresponse()