예제 #1
0
 def getflogheads(self, path):
     if not self.capable("getflogheads"):
         raise error.Abort("configured remotefile server does not "
                           "support getflogheads")
     f = wireproto.future()
     yield {"path": path}, f
     heads = pycompat.decodeutf8(f.value).split("\n") if f.value else []
     yield heads
예제 #2
0
 def getannotate(self, path, lastnode=None):
     if not self.capable("getannotate"):
         ui.warn(_("remote peer cannot provide annotate cache\n"))
         yield None, None
     else:
         args = {"path": path, "lastnode": lastnode or ""}
         f = wireproto.future()
         yield args, f
         yield _parseresponse(f.value)
예제 #3
0
 def getfile(self, file, node):
     if not self.capable("getfile"):
         raise error.Abort(
             "configured remotefile server does not support getfile")
     f = wireproto.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
예제 #4
0
 def getannotate(self, path, lastnode=None):
     if not self.capable("getannotate"):
         ui.warn(_("remote peer cannot provide annotate cache\n"))
         yield None, None
     else:
         lastnode = lastnode or b""
         if sys.version_info[0] >= 3:
             lastnode = hex(lastnode)
         args = {"path": path, "lastnode": lastnode}
         f = wireproto.future()
         yield args, f
         yield _parseresponse(f.value)
예제 #5
0
 def greet(self, name):
     f = wireproto.future()
     yield {"name": mangle(name)}, f
     yield unmangle(pycompat.decodeutf8(f.value))
예제 #6
0
 def greet(self, name):
     f = wireproto.future()
     yield {"name": mangle(name)}, f
     yield unmangle(f.value)