##// END OF EJS Templates
wireproto: remove todict() and use {} literals instead
Augie Fackler -
r20671:5442cab5 default
parent child Browse files
Show More
@@ -145,9 +145,6 b' def unescapearg(escaped):'
145
145
146 # client side
146 # client side
147
147
148 def todict(**args):
149 return args
150
151 class wirepeer(peer.peerrepository):
148 class wirepeer(peer.peerrepository):
152
149
153 def batch(self):
150 def batch(self):
@@ -166,7 +163,7 b' class wirepeer(peer.peerrepository):'
166 def lookup(self, key):
163 def lookup(self, key):
167 self.requirecap('lookup', _('look up remote revision'))
164 self.requirecap('lookup', _('look up remote revision'))
168 f = future()
165 f = future()
169 yield todict(key=encoding.fromlocal(key)), f
166 yield {'key': encoding.fromlocal(key)}, f
170 d = f.value
167 d = f.value
171 success, data = d[:-1].split(" ", 1)
168 success, data = d[:-1].split(" ", 1)
172 if int(success):
169 if int(success):
@@ -186,7 +183,7 b' class wirepeer(peer.peerrepository):'
186 @batchable
183 @batchable
187 def known(self, nodes):
184 def known(self, nodes):
188 f = future()
185 f = future()
189 yield todict(nodes=encodelist(nodes)), f
186 yield {'nodes': encodelist(nodes)}, f
190 d = f.value
187 d = f.value
191 try:
188 try:
192 yield [bool(int(f)) for f in d]
189 yield [bool(int(f)) for f in d]
@@ -236,10 +233,10 b' class wirepeer(peer.peerrepository):'
236 yield False, None
233 yield False, None
237 f = future()
234 f = future()
238 self.ui.debug('preparing pushkey for "%s:%s"\n' % (namespace, key))
235 self.ui.debug('preparing pushkey for "%s:%s"\n' % (namespace, key))
239 yield todict(namespace=encoding.fromlocal(namespace),
236 yield {'namespace': encoding.fromlocal(namespace),
240 key=encoding.fromlocal(key),
237 'key': encoding.fromlocal(key),
241 old=encoding.fromlocal(old),
238 'old': encoding.fromlocal(old),
242 new=encoding.fromlocal(new)), f
239 'new': encoding.fromlocal(new)}, f
243 d = f.value
240 d = f.value
244 d, output = d.split('\n', 1)
241 d, output = d.split('\n', 1)
245 try:
242 try:
@@ -257,7 +254,7 b' class wirepeer(peer.peerrepository):'
257 yield {}, None
254 yield {}, None
258 f = future()
255 f = future()
259 self.ui.debug('preparing listkeys for "%s"\n' % namespace)
256 self.ui.debug('preparing listkeys for "%s"\n' % namespace)
260 yield todict(namespace=encoding.fromlocal(namespace)), f
257 yield {'namespace': encoding.fromlocal(namespace)}, f
261 d = f.value
258 d = f.value
262 r = {}
259 r = {}
263 for l in d.splitlines():
260 for l in d.splitlines():
General Comments 0
You need to be logged in to leave comments. Login now