Mercurial > hg
diff tests/test-wireproto.py @ 37633:33a6eee08db2
wireproto: remove iterbatch() from peer interface (API)
Good riddance.
Some tests have been ported to the new API. This probably should
have been done in earlier commits. But duplicating the test coverage
would have been difficult. It was easier this way.
.. api::
The wire protocol peer's ``iterbatch()`` for bulk executing commands
has been remove.d Use ``peer.commandexecutor()`` instead.
Differential Revision: https://phab.mercurial-scm.org/D3271
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 11 Apr 2018 16:18:26 -0700 |
parents | a81d02ea65db |
children | b4d85bc122bd |
line wrap: on
line diff
--- a/tests/test-wireproto.py Fri Apr 13 11:08:46 2018 -0700 +++ b/tests/test-wireproto.py Wed Apr 11 16:18:26 2018 -0700 @@ -93,7 +93,9 @@ clt = clientpeer(srv, uimod.ui()) print(clt.greet(b"Foobar")) -b = clt.iterbatch() -list(map(b.greet, (b'Fo, =;:<o', b'Bar'))) -b.submit() -print([r for r in b.results()]) + +with clt.commandexecutor() as e: + fgreet1 = e.callcommand(b'greet', {b'name': b'Fo, =;:<o'}) + fgreet2 = e.callcommand(b'greet', {b'name': b'Bar'}) + +print([f.result() for f in (fgreet1, fgreet2)])