~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_pack_repository.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
965
965
            ('add', ('', 'root-id', 'directory', None))])
966
966
        builder.build_snapshot('B-id', ['A-id', 'ghost-id'], [])
967
967
        builder.finish_series()
968
 
        repo = self.make_repository('target')
 
968
        repo = self.make_repository('target', format=self.get_format())
969
969
        b = builder.get_branch()
970
970
        b.lock_read()
971
971
        self.addCleanup(b.unlock)
1003
1003
        source_repo, target_repo = self.create_source_and_target()
1004
1004
        target_repo.start_write_group()
1005
1005
        try:
1006
 
            stream = source_repo.revisions.get_record_stream([('B-id',)],
1007
 
                                                             'unordered', True)
 
1006
            # Copy all texts, inventories, and chks so that nothing is missing
 
1007
            # for revision B-id.
 
1008
            for vf_name in ['texts', 'chk_bytes', 'inventories']:
 
1009
                source_vf = getattr(source_repo, vf_name, None)
 
1010
                if source_vf is None:
 
1011
                    continue
 
1012
                target_vf = getattr(target_repo, vf_name)
 
1013
                stream = source_vf.get_record_stream(
 
1014
                    source_vf.keys(), 'unordered', True)
 
1015
                target_vf.insert_record_stream(stream)
 
1016
            # Copy just revision B-id
 
1017
            stream = source_repo.revisions.get_record_stream(
 
1018
                [('B-id',)], 'unordered', True)
1008
1019
            target_repo.revisions.insert_record_stream(stream)
1009
1020
            key_refs = target_repo.revisions._index._key_dependencies
1010
1021
            self.assertEqual([('B-id',)], sorted(key_refs.get_referrers()))