Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webcommands.py @ 7633:08cabecfa8a8
errors: move revlog errors
- create error.py for exception classes to reduce demandloading
- move revlog exceptions to it
- change users to import error and drop revlog import if possible
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 11 Jan 2009 22:48:28 -0600 |
parents | 4dd7b28003d2 |
children | 1d54e2f6c0b7 |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Sat Jan 10 18:02:38 2009 -0600 +++ b/mercurial/hgweb/webcommands.py Sun Jan 11 22:48:28 2009 -0600 @@ -7,7 +7,7 @@ import os, mimetypes, re, cgi, copy import webutil -from mercurial import revlog, archival, templatefilters +from mercurial import error, archival, templatefilters from mercurial.node import short, hex, nullid from mercurial.util import binary, datestr from mercurial.repo import RepoError @@ -39,7 +39,7 @@ try: fctx = webutil.filectx(web.repo, req) - except revlog.LookupError, inst: + except error.LookupError, inst: try: content = manifest(web, req, tmpl) req.respond(HTTP_OK, web.ctype) @@ -93,7 +93,7 @@ return manifest(web, req, tmpl) try: return _filerevision(web, tmpl, webutil.filectx(web.repo, req)) - except revlog.LookupError, inst: + except error.LookupError, inst: try: return manifest(web, req, tmpl) except ErrorResponse: @@ -521,7 +521,7 @@ fctx = webutil.filectx(web.repo, req) f = fctx.path() fl = fctx.filelog() - except revlog.LookupError: + except error.LookupError: f = webutil.cleanpath(web.repo, req.form['file'][0]) fl = web.repo.file(f) numrevs = len(fl)