comparison hgext/infinitepush/__init__.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 b4d85bc122bd
comparison
equal deleted inserted replaced
37614:a81d02ea65db 37615:f3dc8239e3a9
118 error, 118 error,
119 exchange, 119 exchange,
120 extensions, 120 extensions,
121 hg, 121 hg,
122 localrepo, 122 localrepo,
123 peer,
124 phases, 123 phases,
125 pushkey, 124 pushkey,
126 pycompat, 125 pycompat,
127 registrar, 126 registrar,
128 util, 127 util,
352 results[bookmark] = node 351 results[bookmark] = node
353 return results 352 return results
354 else: 353 else:
355 return orig(self, namespace) 354 return orig(self, namespace)
356 355
357 @peer.batchable 356 @wireprotov1peer.batchable
358 def listkeyspatterns(self, namespace, patterns): 357 def listkeyspatterns(self, namespace, patterns):
359 if not self.capable('pushkey'): 358 if not self.capable('pushkey'):
360 yield {}, None 359 yield {}, None
361 f = peer.future() 360 f = wireprotov1peer.future()
362 self.ui.debug('preparing listkeys for "%s" with pattern "%s"\n' % 361 self.ui.debug('preparing listkeys for "%s" with pattern "%s"\n' %
363 (namespace, patterns)) 362 (namespace, patterns))
364 yield { 363 yield {
365 'namespace': encoding.fromlocal(namespace), 364 'namespace': encoding.fromlocal(namespace),
366 'patterns': wireprototypes.encodelist(patterns) 365 'patterns': wireprototypes.encodelist(patterns)