changeset 2392:8238a3f039e6

Adjusting hgweb splitup to be a little cleaner.
author Eric Hopper <hopper@omnifarious.org>
date Fri, 02 Jun 2006 08:25:02 -0700
parents d351a3be3371
children 5083cba2a777
files mercurial/commands.py mercurial/hgweb/server.py
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Jun 02 08:05:01 2006 -0700
+++ b/mercurial/commands.py	Fri Jun 02 08:25:02 2006 -0700
@@ -13,8 +13,7 @@
 demandload(globals(), "fnmatch mdiff random signal tempfile time")
 demandload(globals(), "traceback errno socket version struct atexit sets bz2")
 demandload(globals(), "archival changegroup")
-demandload(globals(), "mercurial.hgweb.server:create_server")
-demandload(globals(), "mercurial.hgweb:hgweb,hgwebdir")
+demandload(globals(), "hgweb.server")
 
 class UnknownCommand(Exception):
     """Exception raised if command is not in the command table."""
@@ -2544,7 +2543,7 @@
         os._exit(0)
 
     try:
-        httpd = create_server(ui, repo, hgwebdir, hgweb)
+        httpd = hgweb.server.create_server(ui, repo)
     except socket.error, inst:
         raise util.Abort(_('cannot start server: ') + inst.args[1])
 
--- a/mercurial/hgweb/server.py	Fri Jun 02 08:05:01 2006 -0700
+++ b/mercurial/hgweb/server.py	Fri Jun 02 08:25:02 2006 -0700
@@ -10,7 +10,7 @@
 import os, sys, errno
 demandload(globals(), "urllib BaseHTTPServer socket SocketServer")
 demandload(globals(), "mercurial:ui,hg,util,templater")
-demandload(globals(), "mercurial.hgweb.request:hgrequest")
+demandload(globals(), "hgweb_mod:hgweb hgwebdir_mod:hgwebdir request:hgrequest")
 from mercurial.i18n import gettext as _
 
 def _splitURI(uri):
@@ -87,7 +87,7 @@
         self.send_response(200, "Script output follows")
         self.server.make_and_run_handler(req)
 
-def create_server(ui, repo, webdirmaker, repoviewmaker):
+def create_server(ui, repo):
     use_threads = True
 
     def openlog(opt, default):
@@ -123,8 +123,8 @@
             self.errorlog = errorlog
             self.repo = repo
             self.webdir_conf = webdir_conf
-            self.webdirmaker = webdirmaker
-            self.repoviewmaker = repoviewmaker
+            self.webdirmaker = hgwebdir
+            self.repoviewmaker = hgweb
 
         def make_and_run_handler(self, req):
             if self.webdir_conf: