Show More
@@ -85,9 +85,10 class hgwebdir(object): | |||||
85 |
|
85 | |||
86 | def archivelist(ui, nodeid, url): |
|
86 | def archivelist(ui, nodeid, url): | |
87 | allowed = ui.configlist("web", "allow_archive") |
|
87 | allowed = ui.configlist("web", "allow_archive") | |
88 | for i in ['zip', 'gz', 'bz2']: |
|
88 | for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]: | |
89 | if i in allowed or ui.configbool("web", "allow" + i): |
|
89 | if i[0] in allowed or ui.configbool("web", "allow" + i[0]): | |
90 |
yield {"type" : i, " |
|
90 | yield {"type" : i[0], "extension": i[1], | |
|
91 | "node": nodeid, "url": url} | |||
91 |
|
92 | |||
92 | def entries(sortcolumn="", descending=False, **map): |
|
93 | def entries(sortcolumn="", descending=False, **map): | |
93 | rows = [] |
|
94 | rows = [] | |
@@ -101,7 +102,7 class hgwebdir(object): | |||||
101 | get = u.config |
|
102 | get = u.config | |
102 |
|
103 | |||
103 | url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name]) |
|
104 | url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name]) | |
104 | .replace("//", "/")) |
|
105 | .replace("//", "/")) + '/' | |
105 |
|
106 | |||
106 | # update time with local timezone |
|
107 | # update time with local timezone | |
107 | try: |
|
108 | try: | |
@@ -143,8 +144,16 class hgwebdir(object): | |||||
143 |
|
144 | |||
144 | virtual = req.env.get("PATH_INFO", "").strip('/') |
|
145 | virtual = req.env.get("PATH_INFO", "").strip('/') | |
145 | if virtual: |
|
146 | if virtual: | |
146 | real = dict(self.repos).get(virtual) |
|
147 | while virtual: | |
|
148 | real = dict(self.repos).get(virtual) | |||
|
149 | if real: | |||
|
150 | break | |||
|
151 | up = virtual.rfind('/') | |||
|
152 | if up < 0: | |||
|
153 | break | |||
|
154 | virtual = virtual[:up] | |||
147 | if real: |
|
155 | if real: | |
|
156 | req.env['REPO_NAME'] = virtual | |||
148 | try: |
|
157 | try: | |
149 | hgweb(real).run_wsgi(req) |
|
158 | hgweb(real).run_wsgi(req) | |
150 | except IOError, inst: |
|
159 | except IOError, inst: |
General Comments 0
You need to be logged in to leave comments.
Login now