Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webutil.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 | de9c87fe1620 |
children | 9fe97eea5510 |
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py Fri Oct 31 15:28:06 2008 +0100 +++ b/mercurial/hgweb/webutil.py Fri Nov 07 23:31:12 2008 +0100 @@ -6,7 +6,7 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import os +import os, copy from mercurial import match, patch from mercurial.node import hex, nullid from mercurial.repo import RepoError @@ -196,3 +196,19 @@ block.append(chunk) yield tmpl('diffblock', parity=parity.next(), lines=prettyprintlines(''.join(block))) + +class sessionvars(object): + def __init__(self, vars, start='?'): + self.start = start + self.vars = vars + def __getitem__(self, key): + return self.vars[key] + def __setitem__(self, key, value): + self.vars[key] = value + def __copy__(self): + return sessionvars(copy.copy(self.vars), self.start) + def __iter__(self): + separator = self.start + for key, value in self.vars.iteritems(): + yield {'name': key, 'value': str(value), 'separator': separator} + separator = '&'