def bundle(repo, nodes): """Generate bundled mutation data for bundling alongside the given nodes. This consists of mutation entries for all predecessors of the given nodes, including the nodes themselves. """ nodes = set(nodes) remaining = set(nodes) seen = set() entries = [] while remaining: current = remaining.pop() if current in seen: continue seen.add(current) entry = lookupsplit(repo, current) if entry is not None: entries.append(entry.tostoreentry()) for nextnode in entry.preds(): if nextnode not in seen: remaining.add(nextnode) return mutationstore.bundle(entries)
def bundleentries(entries): return mutationstore.bundle(entries)