--- a/mercurial/localrepo.py Wed Apr 11 12:49:08 2018 -0700
+++ b/mercurial/localrepo.py Wed Apr 11 12:51:09 2018 -0700
@@ -49,7 +49,6 @@
narrowspec,
obsolete,
pathutil,
- peer,
phases,
pushkey,
pycompat,
@@ -66,6 +65,7 @@
txnutil,
util,
vfs as vfsmod,
+ wireprotov1peer,
)
from .utils import (
procutil,
@@ -153,6 +153,20 @@
'unbundle'}
legacycaps = moderncaps.union({'changegroupsubset'})
+class localiterbatcher(wireprotov1peer.iterbatcher):
+ def __init__(self, local):
+ super(localiterbatcher, self).__init__()
+ self.local = local
+
+ def submit(self):
+ # submit for a local iter batcher is a noop
+ pass
+
+ def results(self):
+ for name, args, opts, resref in self.calls:
+ resref.set(getattr(self.local, name)(*args, **opts))
+ yield resref.value
+
class localpeer(repository.peer):
'''peer for a local repo; reflects only the most recent API'''
@@ -273,7 +287,7 @@
# Begin of peer interface.
def iterbatch(self):
- return peer.localiterbatcher(self)
+ return localiterbatcher(self)
# End of peer interface.