[PATCH 1 of 2] Fix hgwebdir after 9858477ed74cce9dc8f4069f9453a1bda0e13ba1 broke it

Benoit Boissinot bboissin at gmail.com
Mon Aug 6 16:43:54 CDT 2007


On 8/6/07, Eric Hopper <hopper at omnifarious.org> wrote:
> 2 files changed, 24 insertions(+), 8 deletions(-)
> mercurial/commands.py     |    2 +-
> mercurial/hgweb/server.py |   30 +++++++++++++++++++++++-------
>
>
Why not use this simpler patch ?

diff -r a2c11f49e989 mercurial/commands.py
--- a/mercurial/commands.py	Mon Aug 06 10:57:51 2007 +0200
+++ b/mercurial/commands.py	Mon Aug 06 23:43:13 2007 +0200
@@ -2466,7 +2466,7 @@ def serve(ui, repo, **opts):
     for o in optlist.split():
         if opts[o]:
             parentui.setconfig("web", o, str(opts[o]))
-            if repo.ui != parentui:
+            if (repo is not None) and (repo.ui != parentui):
                 repo.ui.setconfig("web", o, str(opts[o]))

     if repo is None and not ui.config("web", "webdir_conf"):
diff -r a2c11f49e989 mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	Mon Aug 06 10:57:51 2007 +0200
+++ b/mercurial/hgweb/server.py	Mon Aug 06 23:43:13 2007 +0200
@@ -203,13 +203,17 @@ def create_server(ui, repo):
             return open(opt, 'w')
         return default

-    address = repo.ui.config("web", "address", "")
-    port = int(repo.ui.config("web", "port", 8000))
-    use_ipv6 = repo.ui.configbool("web", "ipv6")
-    webdir_conf = repo.ui.config("web", "webdir_conf")
-    ssl_cert = repo.ui.config("web", "certificate")
-    accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout)
-    errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr)
+    if repo is None:
+        myui = ui
+    else:
+        myui = repo.ui
+    address = myui.config("web", "address", "")
+    port = int(myui.config("web", "port", 8000))
+    use_ipv6 = myui.configbool("web", "ipv6")
+    webdir_conf = myui.config("web", "webdir_conf")
+    ssl_cert = myui.config("web", "certificate")
+    accesslog = openlog(myui.config("web", "accesslog", "-"), sys.stdout)
+    errorlog = openlog(myui.config("web", "errorlog", "-"), sys.stderr)

     if use_threads:
         try:


More information about the Mercurial-devel mailing list