Show More
@@ -169,20 +169,23 b' class hgweb(object):' | |||
|
169 | 169 | |
|
170 | 170 | req.write(content) |
|
171 | 171 | del tmpl |
|
172 |
return |
|
|
172 | return [] | |
|
173 | 173 | |
|
174 | 174 | except revlog.LookupError, err: |
|
175 | 175 | req.respond(HTTP_NOT_FOUND, ctype) |
|
176 | 176 | msg = str(err) |
|
177 | 177 | if 'manifest' not in msg: |
|
178 | 178 | msg = 'revision not found: %s' % err.name |
|
179 |
re |
|
|
179 | req.write(tmpl('error', error=msg)) | |
|
180 | return [] | |
|
180 | 181 | except (RepoError, revlog.RevlogError), inst: |
|
181 | 182 | req.respond(HTTP_SERVER_ERROR, ctype) |
|
182 |
re |
|
|
183 | req.write(tmpl('error', error=str(inst))) | |
|
184 | return [] | |
|
183 | 185 | except ErrorResponse, inst: |
|
184 | 186 | req.respond(inst.code, ctype) |
|
185 |
re |
|
|
187 | req.write(tmpl('error', error=inst.message)) | |
|
188 | return [] | |
|
186 | 189 | |
|
187 | 190 | def templater(self, req): |
|
188 | 191 |
@@ -89,12 +89,14 b' class hgwebdir(object):' | |||
|
89 | 89 | fname = virtual[7:] |
|
90 | 90 | else: |
|
91 | 91 | fname = req.form['static'][0] |
|
92 |
re |
|
|
92 | req.write(staticfile(static, fname, req)) | |
|
93 | return [] | |
|
93 | 94 | |
|
94 | 95 | # top-level index |
|
95 | 96 | elif not virtual: |
|
96 | 97 | req.respond(HTTP_OK, ctype) |
|
97 |
re |
|
|
98 | req.write(self.makeindex(req, tmpl)) | |
|
99 | return [] | |
|
98 | 100 | |
|
99 | 101 | # nested indexes and hgwebs |
|
100 | 102 | |
@@ -116,7 +118,8 b' class hgwebdir(object):' | |||
|
116 | 118 | subdir = virtual + '/' |
|
117 | 119 | if [r for r in repos if r.startswith(subdir)]: |
|
118 | 120 | req.respond(HTTP_OK, ctype) |
|
119 |
re |
|
|
121 | req.write(self.makeindex(req, tmpl, subdir)) | |
|
122 | return [] | |
|
120 | 123 | |
|
121 | 124 | up = virtual.rfind('/') |
|
122 | 125 | if up < 0: |
@@ -125,11 +128,13 b' class hgwebdir(object):' | |||
|
125 | 128 | |
|
126 | 129 | # prefixes not found |
|
127 | 130 | req.respond(HTTP_NOT_FOUND, ctype) |
|
128 |
re |
|
|
131 | req.write(tmpl("notfound", repo=virtual)) | |
|
132 | return [] | |
|
129 | 133 | |
|
130 | 134 | except ErrorResponse, err: |
|
131 | 135 | req.respond(err.code, ctype) |
|
132 |
re |
|
|
136 | req.write(tmpl('error', error=err.message or '')) | |
|
137 | return [] | |
|
133 | 138 | finally: |
|
134 | 139 | tmpl = None |
|
135 | 140 |
@@ -43,17 +43,15 b' env = {' | |||
|
43 | 43 | |
|
44 | 44 | output = StringIO() |
|
45 | 45 | env['QUERY_STRING'] = 'style=atom' |
|
46 |
|
|
|
47 |
|
|
|
48 | sys.stdout.write(''.join(content)) | |
|
46 | hgweb('.', name = 'repo')(env, startrsp) | |
|
47 | print output.getvalue() | |
|
49 | 48 | print '---- ERRORS' |
|
50 | 49 | print errors.getvalue() |
|
51 | 50 | |
|
52 | 51 | output = StringIO() |
|
53 | 52 | env['QUERY_STRING'] = 'style=raw' |
|
54 |
|
|
|
55 |
|
|
|
56 | sys.stdout.write(''.join(content)) | |
|
53 | hgwebdir({'repo': '.'})(env, startrsp) | |
|
54 | print output.getvalue() | |
|
57 | 55 | print '---- ERRORS' |
|
58 | 56 | print errors.getvalue() |
|
59 | 57 | EOF |
@@ -35,6 +35,7 b' 200 Script output follows' | |||
|
35 | 35 | </entry> |
|
36 | 36 | |
|
37 | 37 | </feed> |
|
38 | ||
|
38 | 39 | ---- ERRORS |
|
39 | 40 | |
|
40 | 41 | ---- HEADERS |
@@ -44,5 +45,6 b' 200 Script output follows' | |||
|
44 | 45 | |
|
45 | 46 | repo/ |
|
46 | 47 | |
|
48 | ||
|
47 | 49 | ---- ERRORS |
|
48 | 50 |
@@ -44,36 +44,32 b' env = {' | |||
|
44 | 44 | output = StringIO() |
|
45 | 45 | env['PATH_INFO'] = '/' |
|
46 | 46 | env['QUERY_STRING'] = 'style=atom' |
|
47 |
|
|
|
48 |
|
|
|
49 | sys.stdout.write(''.join(content)) | |
|
47 | hgweb('.', name = 'repo')(env, startrsp) | |
|
48 | print output.getvalue() | |
|
50 | 49 | print '---- ERRORS' |
|
51 | 50 | print errors.getvalue() |
|
52 | 51 | |
|
53 | 52 | output = StringIO() |
|
54 | 53 | env['PATH_INFO'] = '/file/tip/' |
|
55 | 54 | env['QUERY_STRING'] = 'style=raw' |
|
56 |
|
|
|
57 |
|
|
|
58 | sys.stdout.write(''.join(content)) | |
|
55 | hgweb('.', name = 'repo')(env, startrsp) | |
|
56 | print output.getvalue() | |
|
59 | 57 | print '---- ERRORS' |
|
60 | 58 | print errors.getvalue() |
|
61 | 59 | |
|
62 | 60 | output = StringIO() |
|
63 | 61 | env['PATH_INFO'] = '/' |
|
64 | 62 | env['QUERY_STRING'] = 'style=raw' |
|
65 |
|
|
|
66 |
|
|
|
67 | sys.stdout.write(''.join(content)) | |
|
63 | hgwebdir({'repo': '.'})(env, startrsp) | |
|
64 | print output.getvalue() | |
|
68 | 65 | print '---- ERRORS' |
|
69 | 66 | print errors.getvalue() |
|
70 | 67 | |
|
71 | 68 | output = StringIO() |
|
72 | 69 | env['PATH_INFO'] = '/repo/file/tip/' |
|
73 | 70 | env['QUERY_STRING'] = 'style=raw' |
|
74 |
|
|
|
75 |
|
|
|
76 | sys.stdout.write(''.join(content)) | |
|
71 | hgwebdir({'repo': '.'})(env, startrsp) | |
|
72 | print output.getvalue() | |
|
77 | 73 | print '---- ERRORS' |
|
78 | 74 | print errors.getvalue() |
|
79 | 75 | EOF |
@@ -35,6 +35,7 b' 200 Script output follows' | |||
|
35 | 35 | </entry> |
|
36 | 36 | |
|
37 | 37 | </feed> |
|
38 | ||
|
38 | 39 | ---- ERRORS |
|
39 | 40 | |
|
40 | 41 | ---- HEADERS |
@@ -45,6 +46,7 b' 200 Script output follows' | |||
|
45 | 46 | -rw-r--r-- 4 bar |
|
46 | 47 | |
|
47 | 48 | |
|
49 | ||
|
48 | 50 | ---- ERRORS |
|
49 | 51 | |
|
50 | 52 | ---- HEADERS |
@@ -54,6 +56,7 b' 200 Script output follows' | |||
|
54 | 56 | |
|
55 | 57 | /repo/ |
|
56 | 58 | |
|
59 | ||
|
57 | 60 | ---- ERRORS |
|
58 | 61 | |
|
59 | 62 | ---- HEADERS |
@@ -64,5 +67,6 b' 200 Script output follows' | |||
|
64 | 67 | -rw-r--r-- 4 bar |
|
65 | 68 | |
|
66 | 69 | |
|
70 | ||
|
67 | 71 | ---- ERRORS |
|
68 | 72 |
General Comments 0
You need to be logged in to leave comments.
Login now