[PATCH 2 of 2] Adjusting hgweb splitup to be a little cleaner

Eric Hopper hopper at omnifarious.org
Fri Jun 2 10:10:47 CDT 2006


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID a3fa91e80f0ae22b4e8a56a63b486c80b33d5ba8
# Parent  d351a3be33713b2b37355f1cbc8d1d60af1f5d95
Adjusting hgweb splitup to be a little cleaner.

diff -r d351a3be3371 -r a3fa91e80f0a mercurial/commands.py
--- a/mercurial/commands.py	Fri Jun 02 08:05:01 2006 -0700
+++ b/mercurial/commands.py	Fri Jun 02 08:06:34 2006 -0700
@@ -13,8 +13,7 @@ demandload(globals(), "fnmatch mdiff ran
 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."""
@@ -2432,7 +2431,7 @@ def rollback(ui, repo):
     repository; for example an in-progress pull from the repository
     may fail if a rollback is performed.
     """
-    repo.rollback()
+    repo.undo()
 
 def root(ui, repo):
     """print the root (top) of the current working dir
@@ -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])
 
@@ -2757,7 +2756,7 @@ def undo(ui, repo):
     instructions, see the rollback command.
     """
     ui.warn(_('(the undo command is deprecated; use rollback instead)\n'))
-    repo.rollback()
+    repo.undo()
 
 def update(ui, repo, node=None, merge=False, clean=False, force=None,
            branch=None, **opts):
diff -r d351a3be3371 -r a3fa91e80f0a 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:06:34 2006 -0700
@@ -10,7 +10,7 @@ import os, sys, errno
 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:



More information about the Mercurial mailing list