Пример #1
0
def wireprotoknownnodes(repo, proto, nodes, others):
    """similar to 'known' but also check in infinitepush storage"""
    nodes = wireproto.decodelist(nodes)
    knownlocally = repo.known(nodes)
    for index, known in enumerate(knownlocally):
        # TODO: make a single query to the bundlestore.index
        if not known and repo.bundlestore.index.getnodebyprefix(
                nodemod.hex(nodes[index])):
            knownlocally[index] = True
    return "".join(b and "1" or "0" for b in knownlocally)
Пример #2
0
def wireprotolistkeyspatterns(repo, proto, namespace, patterns):
    patterns = wireproto.decodelist(patterns)
    d = pycompat.iteritems(repo.listkeys(encoding.tolocal(namespace),
                                         patterns))
    return pushkey.encodekeys(d)