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