mercurial/hgweb/hgwebdir_mod.py
changeset 7107 125c8fedcbe0
parent 6945 2cfdabe235fb
child 7225 59b4ae211584
equal deleted inserted replaced
7106:4674706b5b95 7107:125c8fedcbe0
    82                 ctype = tmpl('mimetype', encoding=util._encoding)
    82                 ctype = tmpl('mimetype', encoding=util._encoding)
    83                 ctype = templater.stringify(ctype)
    83                 ctype = templater.stringify(ctype)
    84 
    84 
    85                 # a static file
    85                 # a static file
    86                 if virtual.startswith('static/') or 'static' in req.form:
    86                 if virtual.startswith('static/') or 'static' in req.form:
    87                     static = os.path.join(templater.templatepath(), 'static')
       
    88                     if virtual.startswith('static/'):
    87                     if virtual.startswith('static/'):
    89                         fname = virtual[7:]
    88                         fname = virtual[7:]
    90                     else:
    89                     else:
    91                         fname = req.form['static'][0]
    90                         fname = req.form['static'][0]
       
    91                     static = templater.templatepath('static')
    92                     return staticfile(static, fname, req)
    92                     return staticfile(static, fname, req)
    93 
    93 
    94                 # top-level index
    94                 # top-level index
    95                 elif not virtual:
    95                 elif not virtual:
    96                     req.respond(HTTP_OK, ctype)
    96                     req.respond(HTTP_OK, ctype)