Mercurial > public > mercurial-scm > hg-stable
diff tests/test-batching.py @ 37615:f3dc8239e3a9
peer: scatter module to the wind (API)
peer.py hardly contained any code. The code it did contain was
generic to the version 1 peer interface or specific to the
local repository peer.
So code has been moved to wireprotov1peer and localrepo, as
appropriate.
Differential Revision: https://phab.mercurial-scm.org/D3260
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 11 Apr 2018 12:51:09 -0700 |
parents | a81d02ea65db |
children | 33a6eee08db2 |
line wrap: on
line diff
--- a/tests/test-batching.py Wed Apr 11 12:49:08 2018 -0700 +++ b/tests/test-batching.py Wed Apr 11 12:51:09 2018 -0700 @@ -9,9 +9,10 @@ from mercurial import ( error, - peer, + localrepo, util, wireprotov1peer, + ) # equivalent of repo.repository @@ -31,7 +32,7 @@ return "Hello, %s" % name def batchiter(self): '''Support for local batching.''' - return peer.localiterbatcher(self) + return localrepo.localiterbatcher(self) # usage of "thing" interface def use(it): @@ -51,7 +52,7 @@ bar2 = batch.bar(b="Uno", a="Due") # Future shouldn't be set until we submit(). - assert isinstance(foo, peer.future) + assert isinstance(foo, wireprotov1peer.future) assert not util.safehasattr(foo, 'value') assert not util.safehasattr(bar, 'value') batch.submit() @@ -179,16 +180,16 @@ def batchiter(self): return wireprotov1peer.remoteiterbatcher(self) - @peer.batchable + @wireprotov1peer.batchable def foo(self, one, two=None): encargs = [('one', mangle(one),), ('two', mangle(two),)] - encresref = peer.future() + encresref = wireprotov1peer.future() yield encargs, encresref yield unmangle(encresref.value) - @peer.batchable + @wireprotov1peer.batchable def bar(self, b, a): - encresref = peer.future() + encresref = wireprotov1peer.future() yield [('b', mangle(b),), ('a', mangle(a),)], encresref yield unmangle(encresref.value)