diff mercurial/hgweb/hgweb_mod.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 3ccaefc84f45
children 1d54e2f6c0b7
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sat Jan 10 18:02:38 2009 -0600
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Jan 11 22:48:28 2009 -0600
@@ -9,8 +9,8 @@
 import os, mimetypes
 from mercurial.node import hex, nullid
 from mercurial.repo import RepoError
-from mercurial import ui, hg, util, hook
-from mercurial import revlog, templater, templatefilters
+from mercurial import ui, hg, util, hook, error
+from mercurial import templater, templatefilters
 from common import get_mtime, style_map, ErrorResponse
 from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 from common import HTTP_UNAUTHORIZED, HTTP_METHOD_NOT_ALLOWED
@@ -185,13 +185,13 @@
 
             return content
 
-        except revlog.LookupError, err:
+        except error.LookupError, err:
             req.respond(HTTP_NOT_FOUND, ctype)
             msg = str(err)
             if 'manifest' not in msg:
                 msg = 'revision not found: %s' % err.name
             return tmpl('error', error=msg)
-        except (RepoError, revlog.RevlogError), inst:
+        except (RepoError, error.RevlogError), inst:
             req.respond(HTTP_SERVER_ERROR, ctype)
             return tmpl('error', error=str(inst))
         except ErrorResponse, inst: