# HG changeset patch # User Simon Law # Date 1201543153 18000 # Node ID 715440e45bf49e6baacff55e48e880f61e8ef23d # Parent f5f1d398f1db701fed2ca56418bf709e5900fa50 hgweb's internal workings have changed for serving HTTP. Thanks to Mark Williamson 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 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 @@ -93,6 +92,10 @@ 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]) @@ -252,7 +255,7 @@ 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 @@ req.write(resp) -hgweb_mod.hgweb.do_forests = _httpserver_do_forests +hgweb.protocol.do_forests = _httpserver_do_forests def _statichttprepo_forests(self, walkhg):