##// END OF EJS Templates
hgweb: get rid of inaccurate hgwebdir.repos_sorted, localize machinery
Dirkjan Ochtman -
r8346:b579823c default
parent child Browse files
Show More
@@ -30,11 +30,8 b' class hgwebdir(object):'
30 30 self.ui.setconfig('ui', 'report_untrusted', 'off')
31 31 self.ui.setconfig('ui', 'interactive', 'off')
32 32
33 self.repos_sorted = ('name', False)
34
35 33 if isinstance(conf, (list, tuple)):
36 34 self.repos = cleannames(conf)
37 self.repos_sorted = ('', False)
38 35 elif isinstance(conf, dict):
39 36 self.repos = sorted(cleannames(conf.items()))
40 37 else:
@@ -184,6 +181,7 b' class hgwebdir(object):'
184 181 yield {"type" : i[0], "extension": i[1],
185 182 "node": nodeid, "url": url}
186 183
184 sortdefault = 'name', False
187 185 def entries(sortcolumn="", descending=False, subdir="", **map):
188 186 rows = []
189 187 parity = paritygen(self.stripecount)
@@ -233,8 +231,7 b' class hgwebdir(object):'
233 231 lastchange=d,
234 232 lastchange_sort=d[1]-d[0],
235 233 archives=archivelist(u, "tip", url))
236 if (not sortcolumn
237 or (sortcolumn, descending) == self.repos_sorted):
234 if (not sortcolumn or (sortcolumn, descending) == sortdefault):
238 235 # fast path for unsorted output
239 236 row['parity'] = parity.next()
240 237 yield row
@@ -249,7 +246,7 b' class hgwebdir(object):'
249 246 yield row
250 247
251 248 sortable = ["name", "description", "contact", "lastchange"]
252 sortcolumn, descending = self.repos_sorted
249 sortcolumn, descending = sortdefault
253 250 if 'sort' in req.form:
254 251 sortcolumn = req.form['sort'][0]
255 252 descending = sortcolumn.startswith('-')
General Comments 0
You need to be logged in to leave comments. Login now