/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/tests/per_pack_repository.py

  • Committer: Andrew Bennetts
  • Date: 2010-03-18 05:24:02 UTC
  • mto: This revision was merged to the branch mainline in revision 5141.
  • Revision ID: andrew.bennetts@canonical.com-20100318052402-vsdd48oxucivcgve
Test that pack collection uses set_sibling_indices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
        repo._pack_collection._clear_obsolete_packs()
289
289
        self.assertTrue(repo_transport.has('obsolete_packs/.nfsblahblah'))
290
290
 
 
291
    def test_pack_collection_sets_sibling_indices(self):
 
292
        """The CombinedGraphIndex objects in the pack collection are all
 
293
        siblings of each other, so that search-order reorderings will be copied
 
294
        to each other.
 
295
        """
 
296
        repo = self.make_repository('repo')
 
297
        pack_coll = repo._pack_collection
 
298
        indices = set([pack_coll.revision_index, pack_coll.inventory_index,
 
299
                pack_coll.text_index, pack_coll.signature_index])
 
300
        if pack_coll.chk_index is not None:
 
301
            indices.add(pack_coll.chk_index)
 
302
        combined_indices = set(idx.combined_index for idx in indices)
 
303
        for combined_index in combined_indices:
 
304
            self.assertEqual(
 
305
                combined_indices.difference([combined_index]),
 
306
                combined_index._sibling_indices)
 
307
 
291
308
    def test_pack_after_two_commits_packs_everything(self):
292
309
        format = self.get_format()
293
310
        tree = self.make_branch_and_tree('.', format=format)