~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_locking.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-15 08:20:33 UTC
  • mfrom: (4288.1.12 push.roundtrips)
  • Revision ID: pqm@pqm.ubuntu.com-20090415082033-tds4zs962x6kwc2c
(robertc) Add a Branch.set_parent_location verb and reduce lock
        churning to reduce network round trips. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
            b.repository._other.unlock()
172
172
 
173
173
    def test_04_lock_fail_unlock_control(self):
174
 
        # Make sure repository.unlock() is called, if we fail to unlock self
 
174
        # Make sure repository.unlock() is not called, if we fail to unlock
 
175
        # self leaving ourselves still locked, so that attempts to recover
 
176
        # don't encounter an unlocked repository.
175
177
        b = self.get_instrumented_branch()
176
178
        b.control_files.disable_unlock()
177
179
 
183
185
            self.assertTrue(b.repository.is_locked())
184
186
            self.assertRaises(TestPreventLocking, b.unlock)
185
187
            self.assertTrue(b.is_locked())
186
 
            if self.combined_control:
187
 
                self.assertTrue(b.repository.is_locked())
188
 
            else:
189
 
                self.assertFalse(b.repository.is_locked())
 
188
            self.assertTrue(b.repository.is_locked())
190
189
 
191
190
            # We unlock the repository even if
192
191
            # we fail to unlock the control files
206
205
                                  ('bc', 'lw', True),
207
206
                                  ('b', 'ul', True),
208
207
                                  ('bc', 'ul', False),
209
 
                                  ('r', 'ul', True),
210
208
                                 ], self.locks)
211
209
 
212
210
        finally: