mercurial/hgweb/webcommands.py
changeset 7107 125c8fedcbe0
parent 7102 14f3ea2ea54f
child 7182 295af5bc1bcc
--- a/mercurial/hgweb/webcommands.py	Sun Oct 05 21:35:26 2008 +0200
+++ b/mercurial/hgweb/webcommands.py	Fri Oct 17 11:34:31 2008 -0700
@@ -566,9 +566,15 @@
     fname = req.form['file'][0]
     # a repo owner may set web.static in .hg/hgrc to get any file
     # readable by the user running the CGI script
-    static = web.config("web", "static",
-                        os.path.join(web.templatepath, "static"),
-                        untrusted=False)
+    static = web.config("web", "static", None, untrusted=False)
+    if not static:
+        tp = web.templatepath
+        if isinstance(tp, str):
+            tp = [tp]
+        for path in tp:
+            static = os.path.join(path, 'static')
+            if os.path.isdir(static):
+                break
     return [staticfile(static, fname, req)]
 
 def graph(web, req, tmpl):