~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-10 17:16:19 UTC
  • mfrom: (4884 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4889.
  • Revision ID: john@arbash-meinel.com-20091210171619-ehdcxjbl8afhq9g1
Bring in bzr.dev 4884

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    ResumedPack,
54
54
    Packer,
55
55
    )
 
56
from bzrlib.static_tuple import StaticTuple
56
57
 
57
58
 
58
59
class GCPack(NewPack):
814
815
                                 ' no new_path %r' % (file_id,))
815
816
            if new_path == '':
816
817
                new_inv.root_id = file_id
817
 
                parent_id_basename_key = ('', '')
 
818
                parent_id_basename_key = StaticTuple('', '').intern()
818
819
            else:
819
820
                utf8_entry_name = entry.name.encode('utf-8')
820
 
                parent_id_basename_key = (entry.parent_id, utf8_entry_name)
 
821
                parent_id_basename_key = StaticTuple(entry.parent_id,
 
822
                                                     utf8_entry_name).intern()
821
823
            new_value = entry_to_bytes(entry)
822
824
            # Populate Caches?
823
825
            # new_inv._path_to_fileid_cache[new_path] = file_id
824
 
            id_to_entry_dict[(file_id,)] = new_value
 
826
            key = StaticTuple(file_id).intern()
 
827
            id_to_entry_dict[key] = new_value
825
828
            parent_id_basename_dict[parent_id_basename_key] = file_id
826
829
 
827
830
        new_inv._populate_from_dicts(self.chk_bytes, id_to_entry_dict,
949
952
                        pb=pb):
950
953
                for name, bytes in items:
951
954
                    (name_utf8, file_id, revision_id) = bytes_to_info(bytes)
 
955
                    # TODO: consider interning file_id, revision_id here, or
 
956
                    #       pushing that intern() into bytes_to_info()
 
957
                    # TODO: rich_root should always be True here, for all
 
958
                    #       repositories that support chk_bytes
952
959
                    if not rich_root and name_utf8 == '':
953
960
                        continue
954
961
                    try:
1105
1112
        for stream_info in self._fetch_revision_texts(revision_ids):
1106
1113
            yield stream_info
1107
1114
        self._revision_keys = [(rev_id,) for rev_id in revision_ids]
 
1115
        self.from_repository.revisions.clear_cache()
 
1116
        self.from_repository.signatures.clear_cache()
1108
1117
        yield self._get_inventory_stream(self._revision_keys)
 
1118
        self.from_repository.inventories.clear_cache()
1109
1119
        # TODO: The keys to exclude might be part of the search recipe
1110
1120
        # For now, exclude all parents that are at the edge of ancestry, for
1111
1121
        # which we have inventories
1114
1124
                        self._revision_keys)
1115
1125
        for stream_info in self._get_filtered_chk_streams(parent_keys):
1116
1126
            yield stream_info
 
1127
        self.from_repository.chk_bytes.clear_cache()
1117
1128
        yield self._get_text_stream()
 
1129
        self.from_repository.texts.clear_cache()
1118
1130
 
1119
1131
    def get_stream_for_missing_keys(self, missing_keys):
1120
1132
        # missing keys can only occur when we are byte copying and not
1184
1196
            # are always rich-root, so there are no synthesised root records to
1185
1197
            # ignore.
1186
1198
            _, file_id, revision_id = bytes_to_info(bytes)
1187
 
            text_keys.add((file_id, revision_id))
 
1199
            file_id = intern(file_id)
 
1200
            revision_id = intern(revision_id)
 
1201
            text_keys.add(StaticTuple(file_id, revision_id).intern())
1188
1202
        yield record
1189
1203
 
1190
1204