1. Patrick Mézard
  2. hgforest-crew


Simon Law  committed 715440e

hgweb's internal workings have changed for serving HTTP.

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

  • Participants
  • Parent commits f5f1d39
  • Branches default

Comments (0)

Files changed (1)

File forest.py

View file
 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
             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)
     res = list(spec[1])
     req.httphdr("application/mercurial-0.1", length=len(resp))
-hgweb_mod.hgweb.do_capabilities = _httpserver_do_capabilities
+hgweb.protocol.do_capabilities = _httpserver_do_capabilities
 def _httpserver_do_forests(self, req):
-hgweb_mod.hgweb.do_forests = _httpserver_do_forests
+hgweb.protocol.do_forests = _httpserver_do_forests
 def _statichttprepo_forests(self, walkhg):