def lookup(self, node): if len(node) == 40: node = bin(node) if len(node) != 20: raise error.LookupError(node, self.filename, _("invalid lookup input")) return node
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
def revision(self, node, raw=False): """returns the revlog contents at this node. this includes the meta data traditionally included in file revlogs. this is generally only used for bundling and communicating with vanilla hg clients. """ if node == nullid: return b"" if len(node) != 20: raise error.LookupError(node, self.filename, _("invalid revision input")) store = self.repo.fileslog.contentstore rawtext = store.get(self.filename, node) if raw: return rawtext if rawtext == constants.REDACTED_CONTENT: return constants.REDACTED_MESSAGE flags = store.getmeta(self.filename, node).get(constants.METAKEYFLAG, 0) if flags == 0: return rawtext text, verifyhash = self._processflags(rawtext, flags, "read") return text