Mercurial > hg > hgforest
changeset 83:715440e45bf4
hgweb's internal workings have changed for serving HTTP.
Thanks to Mark Williamson <mark.williamson@cl.cam.ac.uk> for the initial
patch.
author | Simon Law <simon@akoha.org> |
---|---|
date | Mon, 28 Jan 2008 12:59:13 -0500 |
parents | f5f1d398f1db |
children | af8268c7a99b ae7fe8ca0122 |
files | forest.py |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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):