mercurial/hgweb/webcommands.py
changeset 7107 125c8fedcbe0
parent 7102 14f3ea2ea54f
child 7182 295af5bc1bcc
equal deleted inserted replaced
7106:4674706b5b95 7107:125c8fedcbe0
   564 
   564 
   565 def static(web, req, tmpl):
   565 def static(web, req, tmpl):
   566     fname = req.form['file'][0]
   566     fname = req.form['file'][0]
   567     # a repo owner may set web.static in .hg/hgrc to get any file
   567     # a repo owner may set web.static in .hg/hgrc to get any file
   568     # readable by the user running the CGI script
   568     # readable by the user running the CGI script
   569     static = web.config("web", "static",
   569     static = web.config("web", "static", None, untrusted=False)
   570                         os.path.join(web.templatepath, "static"),
   570     if not static:
   571                         untrusted=False)
   571         tp = web.templatepath
       
   572         if isinstance(tp, str):
       
   573             tp = [tp]
       
   574         for path in tp:
       
   575             static = os.path.join(path, 'static')
       
   576             if os.path.isdir(static):
       
   577                 break
   572     return [staticfile(static, fname, req)]
   578     return [staticfile(static, fname, req)]
   573 
   579 
   574 def graph(web, req, tmpl):
   580 def graph(web, req, tmpl):
   575     rev = webutil.changectx(web.repo, req).rev()
   581     rev = webutil.changectx(web.repo, req).rev()
   576     bg_height = 39
   582     bg_height = 39