~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_pack_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-28 18:16:14 UTC
  • mfrom: (3789.1.11 pack_retry_153786-1)
  • Revision ID: pqm@pqm.ubuntu.com-20081028181614-p3qlghekhffb6cbu
(jam) First part of fixing #153786,
        CombinedGraphIndex reloads index list and retries operation.

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
        tree.lock_write()
 
402
        try:
 
403
            rev1 = tree.commit('one')
 
404
            rev2 = tree.commit('two')
 
405
            r2 = repository.Repository.open('tree')
 
406
            r2.lock_read()
 
407
            try:
 
408
                # Now r2 has read the pack-names file, but will need to reload
 
409
                # it after r1 has repacked
 
410
                tree.branch.repository.pack()
 
411
                self.assertEqual({rev2:(rev1,)}, r2.get_parent_map([rev2]))
 
412
            finally:
 
413
                r2.unlock()
 
414
        finally:
 
415
            tree.unlock()
 
416
 
398
417
    def test_lock_write_does_not_physically_lock(self):
399
418
        repo = self.make_repository('.', format=self.get_format())
400
419
        repo.lock_write()