/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
from bzrlib.inventory import Inventory, InventoryDirectory, ROOT_ID
54
54
from bzrlib.symbol_versioning import (
55
55
        deprecated_method,
56
 
        zero_nine,
57
56
        )
58
57
from bzrlib.trace import mutter, note, warning
59
58
 
732
731
            pb.finished()
733
732
        return result
734
733
 
 
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
 
736
        of revision IDs.
 
737
 
 
738
        The keys will be ordered so that the corresponding items can be safely
 
739
        fetched and inserted in that order.
 
740
 
 
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'.
 
744
        """
 
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
 
749
        # processed?
 
750
        inv_w = self.get_inventory_weave()
 
751
        inv_w.enable_cache()
 
752
 
 
753
        # file ids that changed
 
754
        file_ids = self.fileids_altered_by_revision_ids(revision_ids)
 
755
        count = 0
 
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)
 
760
            count += 1
 
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.
 
764
        del _files_pb
 
765
 
 
766
        # inventory
 
767
        yield ("inventory", None, revision_ids)
 
768
        inv_w.clear_cache()
 
769
 
 
770
        # signatures
 
771
        revisions_with_signatures = set()
 
772
        for rev_id in revision_ids:
 
773
            try:
 
774
                self.get_signature_text(rev_id)
 
775
            except errors.NoSuchRevision:
 
776
                # not signed.
 
777
                pass
 
778
            else:
 
779
                revisions_with_signatures.add(rev_id)
 
780
        yield ("signatures", None, revisions_with_signatures)
 
781
 
 
782
        # revisions
 
783
        yield ("revisions", None, revision_ids)
 
784
 
735
785
    @needs_read_lock
736
786
    def get_inventory_weave(self):
737
787
        return self.control_weaves.get_weave('inventory',