Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgweb_mod.py @ 6785:4879468fa28f
hgweb: return content iterator instead of using write() callable
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sun, 29 Jun 2008 22:36:18 +0200 |
parents | 18c429ea3a0e |
children | 943f066c0d58 |
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py Sun Jun 29 15:23:09 2008 +0200 +++ b/mercurial/hgweb/hgweb_mod.py Sun Jun 29 22:36:18 2008 +0200 @@ -169,20 +169,20 @@ req.write(content) del tmpl - return req + return ''.join(content), except revlog.LookupError, err: req.respond(HTTP_NOT_FOUND, ctype) msg = str(err) if 'manifest' not in msg: msg = 'revision not found: %s' % err.name - req.write(tmpl('error', error=msg)) + return ''.join(tmpl('error', error=msg)), except (RepoError, revlog.RevlogError), inst: req.respond(HTTP_SERVER_ERROR, ctype) - req.write(tmpl('error', error=str(inst))) + return ''.join(tmpl('error', error=str(inst))), except ErrorResponse, inst: req.respond(inst.code, ctype) - req.write(tmpl('error', error=inst.message)) + return ''.join(tmpl('error', error=inst.message)), def templater(self, req):