# HG changeset patch # User Eric Hopper # Date 1149261902 25200 # Node ID 8238a3f039e61a5eaf5d6a2a56c21f5400aa8da9 # Parent d351a3be33713b2b37355f1cbc8d1d60af1f5d95 Adjusting hgweb splitup to be a little cleaner. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -13,8 +13,7 @@ demandload(globals(), "fancyopts ui hg u 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 @@ def serve(ui, repo, **opts): 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]) diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -10,7 +10,7 @@ from mercurial.demandload import demandl 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 @@ class _hgwebhandler(object, BaseHTTPServ 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 @@ def create_server(ui, repo, webdirmaker, 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: