Commits

Patrick Mézard committed 3647b4b

Fix httprepo.do_read in hg >= 1.7

  • Participants
  • Parent commits 5f20f2b

Comments (0)

Files changed (1)

 
 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
         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
         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