diff mercurial/peer.py @ 33767:b47fe9733d76

peer: remove non iterating batcher (API) The last use of this API was removed in b6e71f8af5b8 in 2016. While not formally deprecated, as of the last commit the code is no longer explicitly tested. I think the new API has existed long enough for people to transition to it. I also have plans to more formalize the peer API and removing batch() makes that work easier. I'm not convinced the current client-side API around batching is great. But it's the best we have at the moment. .. api:: remove peer.batch() Replace with peer.iterbatch(). Differential Revision: https://phab.mercurial-scm.org/D320
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 09 Aug 2017 23:35:20 -0700
parents 4c706037adef
children dedab036215d
line wrap: on
line diff
--- a/mercurial/peer.py	Wed Aug 09 23:29:30 2017 -0700
+++ b/mercurial/peer.py	Wed Aug 09 23:35:20 2017 -0700
@@ -49,15 +49,6 @@
     def results(self):
         raise NotImplementedError()
 
-class localbatch(batcher):
-    '''performs the queued calls directly'''
-    def __init__(self, local):
-        batcher.__init__(self)
-        self.local = local
-    def submit(self):
-        for name, args, opts, resref in self.calls:
-            resref.set(getattr(self.local, name)(*args, **opts))
-
 class localiterbatcher(iterbatcher):
     def __init__(self, local):
         super(iterbatcher, self).__init__()
@@ -106,10 +97,6 @@
     return plain
 
 class peerrepository(object):
-
-    def batch(self):
-        return localbatch(self)
-
     def iterbatch(self):
         """Batch requests but allow iterating over the results.