# HG changeset patch # User Eric Hopper # Date 1149261902 25200 # Node ID 8238a3f039e61a5eaf5d6a2a56c21f5400aa8da9 # Parent d351a3be33713b2b37355f1cbc8d1d60af1f5d95 Adjusting hgweb splitup to be a little cleaner. diff -r d351a3be3371 -r 8238a3f039e6 mercurial/commands.py --- 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]) diff -r d351a3be3371 -r 8238a3f039e6 mercurial/hgweb/server.py --- 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: