~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert J. Tanner
  • Date: 2009-04-20 08:37:32 UTC
  • mfrom: (4299 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4300.
  • Revision ID: tanner@real-time.com-20090420083732-bzx919oo7wpmqc2u
[merge] 1.14rc2 back into bzr.dev (Bob Tanner)

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: