diff -r 7cd6dee6fe37 -r d3dbdca92458 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Thu Nov 12 10:29:40 2009 -0500 +++ b/mercurial/hgweb/hgwebdir_mod.py Thu Nov 12 16:39:11 2009 +0100 @@ -315,18 +315,21 @@ url += '/' vars = {} - style = self.style - if 'style' in req.form: - vars['style'] = style = req.form['style'][0] + styles = ( + req.form.get('style', [None])[0], + config('web', 'style'), + 'paper' + ) + style, mapfile = templater.stylemap(styles) + if style == styles[0]: + vars['style'] = style + start = url[-1] == '?' and '&' or '?' sessionvars = webutil.sessionvars(vars, start) - staticurl = config('web', 'staticurl') or url + 'static/' if not staticurl.endswith('/'): staticurl += '/' - style = 'style' in req.form and req.form['style'][0] or self.style - mapfile = templater.stylemap(style) tmpl = templater.templater(mapfile, defaults={"header": header, "footer": footer,