[PATCH] hgweb: show 404 on missing template in current style (issue3809)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Feb 6 02:37:58 CST 2013


On Tue, Feb 05, 2013 at 11:43:04AM -0600, Kevin Bullock wrote:
> # HG changeset patch
> # User Kevin Bullock <kbullock at ringworld.org>
> # Date 1360084904 21600
> # Branch stable
> # Node ID be8cfc33342e8277b7569f3b1f4f512ca798271a
> # Parent  5d02f1d86c2e172d82eba98bc3248f3101c91bc4
> hgweb: show 404 on missing template in current style (issue3809)
> 
> diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
> --- a/mercurial/hgweb/hgweb_mod.py
> +++ b/mercurial/hgweb/hgweb_mod.py
> @@ -219,7 +219,11 @@ class hgweb(object):
>              tmpl = self.templater(req)
>              ctype = tmpl('mimetype', encoding=encoding.encoding)
>              ctype = templater.stringify(ctype)
> +        except error.Abort, err:
> +            req.respond(HTTP_NOT_FOUND, ctype)
> +            return tmpl('error', error=str(err))

404 on Abort exception seems far too wide. But I did not looked the code closely.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list