Show More
@@ -6,13 +6,10 b'' | |||
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from __future__ import absolute_import, print_function |
|
9 | from mercurial.peer import ( | |
|
10 | localbatch, | |
|
11 | batchable, | |
|
12 | future, | |
|
13 | ) | |
|
14 | from mercurial.wireproto import ( | |
|
15 | remotebatch, | |
|
9 | ||
|
10 | from mercurial import ( | |
|
11 | peer, | |
|
12 | wireproto, | |
|
16 | 13 | ) |
|
17 | 14 | |
|
18 | 15 | # equivalent of repo.repository |
@@ -32,7 +29,7 b' class localthing(thing):' | |||
|
32 | 29 | return "Hello, %s" % name |
|
33 | 30 | def batch(self): |
|
34 | 31 | '''Support for local batching.''' |
|
35 | return localbatch(self) | |
|
32 | return peer.localbatch(self) | |
|
36 | 33 | |
|
37 | 34 | # usage of "thing" interface |
|
38 | 35 | def use(it): |
@@ -152,20 +149,20 b' class remotething(thing):' | |||
|
152 | 149 | return res.split(';') |
|
153 | 150 | |
|
154 | 151 | def batch(self): |
|
155 | return remotebatch(self) | |
|
152 | return wireproto.remotebatch(self) | |
|
156 | 153 | |
|
157 | @batchable | |
|
154 | @peer.batchable | |
|
158 | 155 | def foo(self, one, two=None): |
|
159 | 156 | if not one: |
|
160 | 157 | yield "Nope", None |
|
161 | 158 | encargs = [('one', mangle(one),), ('two', mangle(two),)] |
|
162 | encresref = future() | |
|
159 | encresref = peer.future() | |
|
163 | 160 | yield encargs, encresref |
|
164 | 161 | yield unmangle(encresref.value) |
|
165 | 162 | |
|
166 | @batchable | |
|
163 | @peer.batchable | |
|
167 | 164 | def bar(self, b, a): |
|
168 | encresref = future() | |
|
165 | encresref = peer.future() | |
|
169 | 166 | yield [('b', mangle(b),), ('a', mangle(a),)], encresref |
|
170 | 167 | yield unmangle(encresref.value) |
|
171 | 168 |
General Comments 0
You need to be logged in to leave comments.
Login now