def getflogheads(self, path): if not self.capable('getflogheads'): raise error.Abort('configured remotefile server does not ' 'support getflogheads') f = future() yield {'path': path}, f heads = f.value.split('\n') if f.value else [] yield heads
def x_rfl_getflogheads(self, path): if not self.capable('x_rfl_getflogheads'): raise error.Abort('configured remotefile server does not ' 'support getflogheads') f = wireprotov1peer.future() yield {'path': path}, f heads = f.value.split('\n') if f.value else [] yield heads
def getannotate(self, path, lastnode=None): if not self.capable(b'getannotate'): ui.warn(_(b'remote peer cannot provide annotate cache\n')) yield None, None else: args = {b'path': path, b'lastnode': lastnode or b''} f = wireprotov1peer.future() yield args, f yield _parseresponse(f.value)
def x_rfl_getfile(self, file, node): if not self.capable('x_rfl_getfile'): raise error.Abort( 'configured remotefile server does not support getfile') f = wireprotov1peer.future() yield {'file': file, 'node': node}, f code, data = f.value.split('\0', 1) if int(code): raise error.LookupError(file, node, data) yield data
def getfile(self, file, node): if not self.capable('getfile'): raise error.Abort( 'configured remotefile server does not support getfile') f = future() yield {'file': file, 'node': node}, f code, data = f.value.split('\0', 1) if int(code): raise error.LookupError(file, node, data) yield data
def statlfile(self, sha): f = wireprotov1peer.future() result = {b'sha': sha} yield result, f try: yield int(f.value) except (ValueError, urlerr.httperror): # If the server returns anything but an integer followed by a # newline, newline, it's not speaking our language; if we get # an HTTP error, we can't be sure the largefile is present; # either way, consider it missing. yield 2
def listkeyspatterns(self, namespace, patterns): if not self.capable('pushkey'): yield {}, None f = wireprotov1peer.future() self.ui.debug('preparing listkeys for "%s"\n' % namespace) yield { 'namespace': encoding.fromlocal(namespace), 'patterns': wireprototypes.encodelist(patterns) }, f d = f.value self.ui.debug('received listkey for "%s": %i bytes\n' % (namespace, len(d))) yield pushkey.decodekeys(d)
def greet(self, name): f = wireprotov1peer.future() yield {b'name': mangle(name)}, f yield unmangle(f.value)
def pushkey(self, namespace, key, old, new): f = future() yield {}, f yield super(gitrepo, self).pushkey(key, old, new)
def listkeys(self, namespace): f = future() yield {}, f yield super(gitrepo, self).listkeys(namespace)
def heads(self): f = future() yield {}, f yield super(gitrepo, self).heads()
def lookup(self, key): f = future() yield {}, f yield super(gitrepo, self).lookup(key)
def bar(self, b, a): encresref = wireprotov1peer.future() yield [('b', mangle(b),), ('a', mangle(a),)], encresref yield unmangle(encresref.value)
def foo(self, one, two=None): encargs = [('one', mangle(one),), ('two', mangle(two),)] encresref = wireprotov1peer.future() yield encargs, encresref yield unmangle(encresref.value)
def wrapper(*args, **kwargs): yield None, wireprotov1peer.future() yield fn(*args, **kwargs)