# HG changeset patch # User Thomas Arendsen Hein # Date 1160665611 -7200 # Node ID cf680c9ab1dd6c27cceb01c2181bcce41406d953 # Parent 537a93cafa797a3b6689dc078c5d5733cf6f73ea Keep session variables when linking from hgwebdir's index to repositories. diff -r 537a93cafa79 -r cf680c9ab1dd mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Thu Oct 12 16:37:03 2006 +0200 +++ b/mercurial/hgweb/hgwebdir_mod.py Thu Oct 12 17:06:51 2006 +0200 @@ -90,6 +90,18 @@ "node": nodeid, "url": url} def entries(sortcolumn="", descending=False, **map): + def sessionvars(**map): + fields = [] + if req.form.has_key('style'): + style = req.form['style'][0] + if style != get('web', 'style', ''): + fields.append(('style', style)) + + separator = url[-1] == '?' and ';' or '?' + for name, value in fields: + yield dict(name=name, value=value, separator=separator) + separator = ';' + rows = [] parity = 0 for name, path in self.repos: @@ -123,6 +135,7 @@ description_sort=description.upper() or "unknown", lastchange=d, lastchange_sort=d[1]-d[0], + sessionvars=sessionvars, archives=archivelist(u, "tip", url)) if (not sortcolumn or (sortcolumn, descending) == self.repos_sorted): diff -r 537a93cafa79 -r cf680c9ab1dd templates/gitweb/map --- a/templates/gitweb/map Thu Oct 12 16:37:03 2006 +0200 +++ b/templates/gitweb/map Thu Oct 12 17:06:51 2006 +0200 @@ -49,7 +49,7 @@ shortlogentry = '#date|age# ago#author##desc|strip|firstline|escape#changeset | manifest' filelogentry = '#date|age# ago#desc|strip|firstline|escape#file | annotate #rename%filelogrename#' archiveentry = ' | #type|escape# ' -indexentry = '#name|escape##description##contact|obfuscate##lastchange|age# ago #archives%archiveentry#' +indexentry = '#name|escape##description##contact|obfuscate##lastchange|age# ago #archives%archiveentry#' index = index.tmpl urlparameter = '#separator##name#=#value|urlescape#' hiddenformentry = '' diff -r 537a93cafa79 -r cf680c9ab1dd templates/map --- a/templates/map Thu Oct 12 16:37:03 2006 +0200 +++ b/templates/map Thu Oct 12 17:06:51 2006 +0200 @@ -46,7 +46,7 @@ filelogparent = 'parent #rev#:#node|short#' filediffchild = 'child #rev#:#node|short#' filelogchild = 'child #rev#:#node|short#' -indexentry = '#name|escape##description##contact|obfuscate##lastchange|age# agoRSS #archives%archiveentry#' +indexentry = '#name|escape##description##contact|obfuscate##lastchange|age# agoRSS #archives%archiveentry#' index = index.tmpl archiveentry = '#type|escape# ' notfound = notfound.tmpl