diff mercurial/hgweb/hgweb_mod.py @ 7345:55651328dfcc

hgweb: fix up the less/more links on the graph page Previously, they pointed to a non-intuitive revision, and got borked when using a URL-specified style combined with alternate revcounts.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 07 Nov 2008 23:31:12 +0100
parents 2dc868712dcc
children 1a5c9ca2bfd5
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Fri Oct 31 15:28:06 2008 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Nov 07 23:31:12 2008 +0100
@@ -228,23 +228,16 @@
         def motd(**map):
             yield self.config("web", "motd", "")
 
-        def sessionvars(**map):
-            fields = []
-            if 'style' in req.form:
-                style = req.form['style'][0]
-                if style != self.config('web', 'style', ''):
-                    fields.append(('style', style))
-
-            separator = req.url[-1] == '?' and ';' or '?'
-            for name, value in fields:
-                yield dict(name=name, value=value, separator=separator)
-                separator = ';'
-
         # figure out which style to use
 
+        vars = {}
         style = self.config("web", "style", "")
         if 'style' in req.form:
             style = req.form['style'][0]
+            vars['style'] = style
+
+        start = req.url[-1] == '?' and '&' or '?'
+        sessionvars = webutil.sessionvars(vars, start)
         mapfile = style_map(self.templatepath, style)
 
         if not self.reponame: