~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_break_lock.py

  • Committer: Robert Collins
  • Date: 2007-10-12 05:37:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20071012053736-y2su3gx25bhxzeos
Allow pack repositories to have multiple writers active at one time, for greater concurrency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    def test_locked(self):
53
53
        # break_lock when locked should
54
54
        self.repo.lock_write()
55
 
        try:
56
 
            self.unused_repo.break_lock()
57
 
        except NotImplementedError:
58
 
            # repository does not support break_lock
 
55
        self.assertEqual(self.repo.get_physical_lock_status(),
 
56
            self.unused_repo.get_physical_lock_status())
 
57
        if not self.unused_repo.get_physical_lock_status():
 
58
            # 'lock_write' has not taken a physical mutex out.
59
59
            self.repo.unlock()
60
60
            return
 
61
        self.unused_repo.break_lock()
61
62
        self.assertRaises(errors.LockBroken, self.repo.unlock)