comparison mercurial/hgweb/hgwebdir_mod.py @ 18206:2c1276825e93

merge with stable
author Matt Mackall <mpm@selenic.com>
date Wed, 02 Jan 2013 00:24:28 -0600
parents 40374059d227 e4f17956f45a
children bebb05a7e249
comparison
equal deleted inserted replaced
18201:2efc6536ea43 18206:2c1276825e93
182 if virtual.startswith('static/') or 'static' in req.form: 182 if virtual.startswith('static/') or 'static' in req.form:
183 if virtual.startswith('static/'): 183 if virtual.startswith('static/'):
184 fname = virtual[7:] 184 fname = virtual[7:]
185 else: 185 else:
186 fname = req.form['static'][0] 186 fname = req.form['static'][0]
187 static = templater.templatepath('static') 187 static = self.ui.config("web", "static", None,
188 untrusted=False)
189 if not static:
190 tp = self.templatepath or templater.templatepath()
191 if isinstance(tp, str):
192 tp = [tp]
193 static = [os.path.join(p, 'static') for p in tp]
188 return (staticfile(static, fname, req),) 194 return (staticfile(static, fname, req),)
189 195
190 # top-level index 196 # top-level index
191 elif not virtual: 197 elif not virtual:
192 req.respond(HTTP_OK, ctype) 198 req.respond(HTTP_OK, ctype)