diff -r 9675147aec06 -r 67fb0dca29bc mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Sat Mar 10 18:51:32 2018 -0800 +++ b/mercurial/hgweb/hgweb_mod.py Sat Mar 10 20:35:35 2018 -0800 @@ -14,7 +14,6 @@ from .common import ( ErrorResponse, HTTP_BAD_REQUEST, - HTTP_OK, cspvalues, permhooks, statusmessage, @@ -405,15 +404,7 @@ # override easily enough. res.status = '200 Script output follows' res.headers['Content-Type'] = ctype - content = getattr(webcommands, cmd)(rctx, wsgireq, tmpl) - - if content is res: - return res.sendresponse() - elif content is True: - return [] - else: - wsgireq.respond(HTTP_OK, ctype) - return content + return getattr(webcommands, cmd)(rctx, wsgireq, tmpl) except (error.LookupError, error.RepoLookupError) as err: msg = pycompat.bytestr(err)