diff mercurial/hgweb/server.py @ 6217:fe8dbbe9520d

Avoid importing mercurial.node/mercurial.repo stuff from mercurial.hg
author Joel Rosdahl <joel@rosdahl.net>
date Thu, 06 Mar 2008 22:51:16 +0100
parents e75aab656f46
children de7256c82fad
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Thu Mar 06 22:23:41 2008 +0100
+++ b/mercurial/hgweb/server.py	Thu Mar 06 22:51:16 2008 +0100
@@ -8,6 +8,7 @@
 
 import os, sys, errno, urllib, BaseHTTPServer, socket, SocketServer, traceback
 from mercurial import hg, util
+from mercurial.repo import RepoError
 from hgweb_mod import hgweb
 from hgwebdir_mod import hgwebdir
 from mercurial.i18n import gettext as _
@@ -247,8 +248,8 @@
                 elif repo is not None:
                     hgwebobj = hgweb(hg.repository(repo.ui, repo.root))
                 else:
-                    raise hg.RepoError(_("There is no Mercurial repository here"
-                                         " (.hg not found)"))
+                    raise RepoError(_("There is no Mercurial repository here"
+                                      " (.hg not found)"))
                 return hgwebobj
             self.application = make_handler()
 
@@ -277,7 +278,7 @@
 
         def __init__(self, *args, **kwargs):
             if self.address_family is None:
-                raise hg.RepoError(_('IPv6 not available on this system'))
+                raise RepoError(_('IPv6 not available on this system'))
             super(IPv6HTTPServer, self).__init__(*args, **kwargs)
 
     if ssl_cert: