# HG changeset patch # User Benoit Boissinot # Date 1217586790 -7200 # Node ID 2ff0829bdae54646f4da2aebdd73d45a8a7d849e # Parent 6ec941b6003d714f931ab5050afb1337789838ed hgweb: do not use unassigned variables in exception handling diff -r 6ec941b6003d -r 2ff0829bdae5 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Jul 30 22:26:41 2008 +0200 +++ b/mercurial/hgweb/webcommands.py Fri Aug 01 12:33:10 2008 +0200 @@ -53,16 +53,15 @@ def file(web, req, tmpl): path = web.cleanpath(req.form.get('file', [''])[0]) - if path: + if not path: + return web.manifest(tmpl, web.changectx(req), path) + try: + return web.filerevision(tmpl, web.filectx(req)) + except revlog.LookupError, inst: try: - return web.filerevision(tmpl, web.filectx(req)) - except revlog.LookupError, inst: - pass - - try: - return web.manifest(tmpl, web.changectx(req), path) - except ErrorResponse: - raise inst + return web.manifest(tmpl, web.changectx(req), path) + except ErrorResponse: + raise inst def changelog(web, req, tmpl, shortlog = False): if 'node' in req.form: