--- hgforest-7748e801692a/forest.py 2011-03-06 10:07:36.000000000 +0100 +++ hgforest/forest.py 2013-03-20 16:03:16.541771535 +0100 @@ -55,7 +55,18 @@ import shutil from mercurial import cmdutil, commands, error, hg, hgweb, node, util -from mercurial import localrepo, sshrepo, sshserver, httprepo, statichttprepo +from mercurial import localrepo, sshserver, statichttprepo +try: + from mercurial import sshrepo + from mercurial import httprepo + SshRepository = sshrepo.sshrepository + HttpRepository = httprepo.httprepository +except ImportError: + from mercurial import sshpeer + from mercurial import httppeer + SshRepository = sshpeer.sshpeer + HttpRepository = httppeer.httppeer + from mercurial.i18n import gettext as _ # For backwards compatibility, we need the following function definition. @@ -86,7 +97,7 @@ import mercurial.cmdutil RepoError = mercurial.repo.RepoError ParseError = mercurial.dispatch.ParseError -except AttributeError: +except (AttributeError, ImportError): import mercurial.error RepoError = mercurial.error.RepoError ParseError = mercurial.error.ParseError @@ -238,7 +249,7 @@ data = repocall(self, "forests", walkhg=("", "True")[walkhg]) return data.splitlines() -sshrepo.sshrepository.forests = _sshrepo_forests +SshRepository.forests = _sshrepo_forests def _sshserver_do_hello(self): @@ -314,7 +325,7 @@ data = repocall(self, "forests", walkhg=("", "True")[walkhg]) return data.splitlines() -httprepo.httprepository.forests = _httprepo_forests +HttpRepository.forests = _httprepo_forests def _httpserver_do_capabilities(self, req):