167 content = getattr(webcommands, cmd)(self, req, tmpl) |
167 content = getattr(webcommands, cmd)(self, req, tmpl) |
168 req.respond(HTTP_OK, ctype) |
168 req.respond(HTTP_OK, ctype) |
169 |
169 |
170 req.write(content) |
170 req.write(content) |
171 del tmpl |
171 del tmpl |
172 return ''.join(content), |
172 return req |
173 |
173 |
174 except revlog.LookupError, err: |
174 except revlog.LookupError, err: |
175 req.respond(HTTP_NOT_FOUND, ctype) |
175 req.respond(HTTP_NOT_FOUND, ctype) |
176 msg = str(err) |
176 msg = str(err) |
177 if 'manifest' not in msg: |
177 if 'manifest' not in msg: |
178 msg = 'revision not found: %s' % err.name |
178 msg = 'revision not found: %s' % err.name |
179 return ''.join(tmpl('error', error=msg)), |
179 req.write(tmpl('error', error=msg)) |
180 except (RepoError, revlog.RevlogError), inst: |
180 except (RepoError, revlog.RevlogError), inst: |
181 req.respond(HTTP_SERVER_ERROR, ctype) |
181 req.respond(HTTP_SERVER_ERROR, ctype) |
182 return ''.join(tmpl('error', error=str(inst))), |
182 req.write(tmpl('error', error=str(inst))) |
183 except ErrorResponse, inst: |
183 except ErrorResponse, inst: |
184 req.respond(inst.code, ctype) |
184 req.respond(inst.code, ctype) |
185 return ''.join(tmpl('error', error=inst.message)), |
185 req.write(tmpl('error', error=inst.message)) |
186 |
186 |
187 def templater(self, req): |
187 def templater(self, req): |
188 |
188 |
189 # determine scheme, port and server name |
189 # determine scheme, port and server name |
190 # this is needed to create absolute urls |
190 # this is needed to create absolute urls |