Comment 2 for bug 165290

Revision history for this message
Robert Collins (lifeless) wrote :

for efficiency I suggest that this be done as:
fetch all the texts - _copy_nodes_graph
after that, use nodes to generate a set of referenced texts
text_refs = set()
text_keys = set()
        for index, key, value, references in nodes:
            if references[1]:
                text_refs.update(references[1])
            text_keys.add(key)

Then filter that by the keys copied
external_refs = text_refs - text_keys

Now look up external_refs in self._pack_collection.text_index.combined_index
found_items = list(self._pack_collection.text_index.combined_index.iter_entries(external_refs))
if len(found_items) != len(external_refs):
    identify the missing ones here.

-Rob