~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_pack_repository.py

add the failing acceptance test for the first portion.

When going through 'get_parent_map', if the index is missing, we should have
reloaded the index list without the calling code needing to know anything.

Show diffs side-by-side

added added

removed removed

Lines of Context:
395
395
        finally:
396
396
            r1.unlock()
397
397
 
 
398
    def test_concurrent_pack_triggers_reload(self):
 
399
        # create 2 packs, which we will then collapse
 
400
        tree = self.make_branch_and_tree('tree')
 
401
        rev1 = tree.commit('one')
 
402
        rev2 = tree.commit('two')
 
403
        r1 = tree.branch.repository
 
404
        r2 = repository.Repository.open('tree')
 
405
        r1.lock_write()
 
406
        try:
 
407
            r2.lock_read()
 
408
            try:
 
409
                # Now r2 has read the pack-names file, but will need to reload
 
410
                # it after r1 has repacked
 
411
                r1.pack()
 
412
                self.assertEqual({rev2:(rev1,)},
 
413
                                 r2.get_parent_map([rev2]))
 
414
            finally:
 
415
                r2.unlock()
 
416
        finally:
 
417
            r1.unlock()
 
418
 
398
419
    def test_lock_write_does_not_physically_lock(self):
399
420
        repo = self.make_repository('.', format=self.get_format())
400
421
        repo.lock_write()