/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/repofmt/groupcompress_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-14 00:01:32 UTC
  • mfrom: (4957.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100114000132-3p3rabnonjw3gzqb
(jam) Merge bzr.stable, bringing in bug fixes #175839, #504390

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