indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The last use of this API was removed in
https://phab.mercurial-scm.org/rHGb6e71f8af5b8710139b64706a375b3f16eb1241e 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().
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D320
AFFECTED FILES
mercurial/peer.py
mercurial/wireproto.py
tests/test-wireproto.py
CHANGE DETAILS
diff --git a/tests/test-wireproto.py b/tests/test-wireproto.py
--- a/tests/test-wireproto.py
+++ b/tests/test-wireproto.py
@@ -55,7 +55,7 @@
clt = clientpeer(srv)
print(clt.greet("Foobar"))
-b = clt.batch()
-fs = [b.greet(s) for s in ["Fo, =;: on the server
diff --git a/mercurial/peer.py b/mercurial/peer.py
--- a/mercurial/peer.py
+++ b/mercurial/peer.py
@@ -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.
To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel