Show More
@@ -119,7 +119,7 b' def archivelist(ui, nodeid, url):' | |||
|
119 | 119 | |
|
120 | 120 | return archives |
|
121 | 121 | |
|
122 |
def rawindexentries(ui, repos |
|
|
122 | def rawindexentries(ui, repos, req, subdir=''): | |
|
123 | 123 | descend = ui.configbool('web', 'descend') |
|
124 | 124 | collapse = ui.configbool('web', 'collapse') |
|
125 | 125 | seenrepos = set() |
@@ -161,7 +161,7 b' def rawindexentries(ui, repos, wsgireq, ' | |||
|
161 | 161 | pass |
|
162 | 162 | |
|
163 | 163 | parts = [ |
|
164 |
|
|
|
164 | req.apppath.strip('/'), | |
|
165 | 165 | subdir.strip('/'), |
|
166 | 166 | name.strip('/'), |
|
167 | 167 | ] |
@@ -245,10 +245,10 b' def rawindexentries(ui, repos, wsgireq, ' | |||
|
245 | 245 | |
|
246 | 246 | yield row |
|
247 | 247 | |
|
248 |
def indexentries(ui, repos |
|
|
248 | def indexentries(ui, repos, req, stripecount, sortcolumn='', | |
|
249 | 249 | descending=False, subdir=''): |
|
250 | 250 | |
|
251 |
rows = rawindexentries(ui, repos, |
|
|
251 | rows = rawindexentries(ui, repos, req, subdir=subdir) | |
|
252 | 252 | |
|
253 | 253 | sortdefault = None, False |
|
254 | 254 | |
@@ -401,7 +401,7 b' class hgwebdir(object):' | |||
|
401 | 401 | |
|
402 | 402 | if (not virtual or virtual == 'index') and virtual not in repos: |
|
403 | 403 | wsgireq.respond(HTTP_OK, ctype) |
|
404 |
return self.makeindex( |
|
|
404 | return self.makeindex(req, tmpl) | |
|
405 | 405 | |
|
406 | 406 | # nested indexes and hgwebs |
|
407 | 407 | |
@@ -409,7 +409,7 b' class hgwebdir(object):' | |||
|
409 | 409 | subdir = virtual[:-len('index')] |
|
410 | 410 | if any(r.startswith(subdir) for r in repos): |
|
411 | 411 | wsgireq.respond(HTTP_OK, ctype) |
|
412 |
return self.makeindex( |
|
|
412 | return self.makeindex(req, tmpl, subdir) | |
|
413 | 413 | |
|
414 | 414 | def _virtualdirs(): |
|
415 | 415 | # Check the full virtual path, each parent, and the root ('') |
@@ -443,7 +443,7 b' class hgwebdir(object):' | |||
|
443 | 443 | subdir = virtual + '/' |
|
444 | 444 | if [r for r in repos if r.startswith(subdir)]: |
|
445 | 445 | wsgireq.respond(HTTP_OK, ctype) |
|
446 |
return self.makeindex( |
|
|
446 | return self.makeindex(req, tmpl, subdir) | |
|
447 | 447 | |
|
448 | 448 | # prefixes not found |
|
449 | 449 | wsgireq.respond(HTTP_NOT_FOUND, ctype) |
@@ -455,9 +455,7 b' class hgwebdir(object):' | |||
|
455 | 455 | finally: |
|
456 | 456 | tmpl = None |
|
457 | 457 | |
|
458 |
def makeindex(self, |
|
|
459 | req = wsgireq.req | |
|
460 | ||
|
458 | def makeindex(self, req, tmpl, subdir=""): | |
|
461 | 459 | self.refresh() |
|
462 | 460 | sortable = ["name", "description", "contact", "lastchange"] |
|
463 | 461 | sortcolumn, descending = None, False |
@@ -476,7 +474,7 b' class hgwebdir(object):' | |||
|
476 | 474 | |
|
477 | 475 | self.refresh() |
|
478 | 476 | |
|
479 |
entries = indexentries(self.ui, self.repos, |
|
|
477 | entries = indexentries(self.ui, self.repos, req, | |
|
480 | 478 | self.stripecount, sortcolumn=sortcolumn, |
|
481 | 479 | descending=descending, subdir=subdir) |
|
482 | 480 |
General Comments 0
You need to be logged in to leave comments.
Login now