734
def item_keys_introduced_by(self, revision_ids, _files_pb=None):
735
"""Get an iterable listing the keys of all the data introduced by a set
738
The keys will be ordered so that the corresponding items can be safely
739
fetched and inserted in that order.
741
:returns: An iterable producing tuples of (knit-kind, file-id,
742
versions). knit-kind is one of 'file', 'inventory', 'signatures',
743
'revisions'. file-id is None unless knit-kind is 'file'.
745
# XXX: it's a bit weird to control the inventory weave caching in this
746
# generator. Ideally the caching would be done in fetch.py I think. Or
747
# maybe this generator should explicitly have the contract that it
748
# should not be iterated until the previously yielded item has been
750
inv_w = self.get_inventory_weave()
753
# file ids that changed
754
file_ids = self.fileids_altered_by_revision_ids(revision_ids)
756
num_file_ids = len(file_ids)
757
for file_id, altered_versions in file_ids.iteritems():
758
if _files_pb is not None:
759
_files_pb.update("fetch texts", count, num_file_ids)
761
yield ("file", file_id, altered_versions)
762
# We're done with the files_pb. Note that it finished by the caller,
763
# just as it was created by the caller.
767
yield ("inventory", None, revision_ids)
771
revisions_with_signatures = set()
772
for rev_id in revision_ids:
774
self.get_signature_text(rev_id)
775
except errors.NoSuchRevision:
779
revisions_with_signatures.add(rev_id)
780
yield ("signatures", None, revisions_with_signatures)
783
yield ("revisions", None, revision_ids)
735
786
def get_inventory_weave(self):
736
787
return self.control_weaves.get_weave('inventory',