[cig-commits] commit: hgweb's internal workings have changed for serving HTTP.

Mercurial hg at geodynamics.org
Mon Nov 24 11:27:19 PST 2008


changeset:   83:715440e45bf4
user:        Simon Law <simon at akoha.org>
date:        Mon Jan 28 12:59:13 2008 -0500
files:       forest.py
description:
hgweb's internal workings have changed for serving HTTP.

Thanks to Mark Williamson <mark.williamson at cl.cam.ac.uk> for the initial
patch.


diff -r f5f1d398f1db -r 715440e45bf4 forest.py
--- a/forest.py	Mon Jan 28 12:19:24 2008 -0500
+++ b/forest.py	Mon Jan 28 12:59:13 2008 -0500
@@ -55,9 +55,8 @@ import re
 import re
 import shutil
 
-from mercurial import cmdutil, commands, hg, node, util
+from mercurial import cmdutil, commands, hg, hgweb, node, util
 from mercurial import localrepo, sshrepo, sshserver, httprepo, statichttprepo
-from mercurial.hgweb import hgweb_mod
 from mercurial.i18n import gettext as _
 from mercurial.repo import RepoError
 
@@ -92,6 +91,10 @@ except:
             """Mercurial <= 0.9.3 doesn't have this feature."""
             return url, (revs or None)
 
+
+# For backwards compatibility, find the HTTP protocol.
+if not hasattr(hgweb, 'protocol'):
+    hgweb.protocol = hgweb.hgweb_mod.hgweb
 
 def cmd_options(ui, cmd, remove=None, table=commands.table):
     aliases, spec = findcmd(ui, cmd, table)
@@ -252,7 +255,7 @@ def _httpserver_do_capabilities(self, re
     req.httphdr("application/mercurial-0.1", length=len(resp))
     req.write(resp)
 
-hgweb_mod.hgweb.do_capabilities = _httpserver_do_capabilities
+hgweb.protocol.do_capabilities = _httpserver_do_capabilities
 
 
 def _httpserver_do_forests(self, req):
@@ -269,7 +272,7 @@ def _httpserver_do_forests(self, req):
     req.write(resp)
 
 
-hgweb_mod.hgweb.do_forests = _httpserver_do_forests
+hgweb.protocol.do_forests = _httpserver_do_forests
 
 
 def _statichttprepo_forests(self, walkhg):



More information about the CIG-COMMITS mailing list