comparison mercurial/hgweb/hgwebdir_mod.py @ 3365:cf680c9ab1dd

Keep session variables when linking from hgwebdir's index to repositories.
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 12 Oct 2006 17:06:51 +0200
parents 415905fad4fe
children ec6f400cff4d
comparison
equal deleted inserted replaced
3364:537a93cafa79 3365:cf680c9ab1dd
88 if i[0] in allowed or ui.configbool("web", "allow" + i[0]): 88 if i[0] in allowed or ui.configbool("web", "allow" + i[0]):
89 yield {"type" : i[0], "extension": i[1], 89 yield {"type" : i[0], "extension": i[1],
90 "node": nodeid, "url": url} 90 "node": nodeid, "url": url}
91 91
92 def entries(sortcolumn="", descending=False, **map): 92 def entries(sortcolumn="", descending=False, **map):
93 def sessionvars(**map):
94 fields = []
95 if req.form.has_key('style'):
96 style = req.form['style'][0]
97 if style != get('web', 'style', ''):
98 fields.append(('style', style))
99
100 separator = url[-1] == '?' and ';' or '?'
101 for name, value in fields:
102 yield dict(name=name, value=value, separator=separator)
103 separator = ';'
104
93 rows = [] 105 rows = []
94 parity = 0 106 parity = 0
95 for name, path in self.repos: 107 for name, path in self.repos:
96 u = ui.ui() 108 u = ui.ui()
97 try: 109 try:
121 url=url, 133 url=url,
122 description=description or "unknown", 134 description=description or "unknown",
123 description_sort=description.upper() or "unknown", 135 description_sort=description.upper() or "unknown",
124 lastchange=d, 136 lastchange=d,
125 lastchange_sort=d[1]-d[0], 137 lastchange_sort=d[1]-d[0],
138 sessionvars=sessionvars,
126 archives=archivelist(u, "tip", url)) 139 archives=archivelist(u, "tip", url))
127 if (not sortcolumn 140 if (not sortcolumn
128 or (sortcolumn, descending) == self.repos_sorted): 141 or (sortcolumn, descending) == self.repos_sorted):
129 # fast path for unsorted output 142 # fast path for unsorted output
130 row['parity'] = parity 143 row['parity'] = parity