# HG changeset patch # User Patrick Mezard # Date 1290120579 -3600 # Node ID 3647b4bed1a156156330b7bc000b7a116f06ee07 # Parent 5f20f2b657fd1b1d0cd8c32277ee24c8aa49c096 Fix httprepo.do_read in hg >= 1.7 diff -r 5f20f2b657fd -r 3647b4bed1a1 forest.py --- a/forest.py Thu Nov 18 23:36:35 2010 +0100 +++ b/forest.py Thu Nov 18 23:49:39 2010 +0100 @@ -216,6 +216,13 @@ localrepo.localrepository.forests = _localrepo_forests +def repocall(repo, *args, **kwargs): + if hasattr(repo, '_call'): + # hg >= 1.7 + callfn = repo._call + else: + callfn = repo.do_read + return callfn(*args, **kwargs) def _sshrepo_forests(self, walkhg): """Shim this function into mercurial.sshrepo.sshrepository so @@ -228,7 +235,7 @@ raise util.Abort(_("Remote forests cannot be cloned because the " "other repository doesn't support the forest " "extension.")) - data = self.call("forests", walkhg=("", "True")[walkhg]) + data = repocall(self, "forests", walkhg=("", "True")[walkhg]) return data.splitlines() sshrepo.sshrepository.forests = _sshrepo_forests @@ -280,7 +287,7 @@ raise util.Abort(_("Remote forests cannot be cloned because the " "other repository doesn't support the forest " "extension.")) - data = self.do_read("forests", walkhg=("", "True")[walkhg]) + data = repocall(self, "forests", walkhg=("", "True")[walkhg]) return data.splitlines() httprepo.httprepository.forests = _httprepo_forests