~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Martin Pool
  • Date: 2007-04-24 05:02:04 UTC
  • mfrom: (2449 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: mbp@sourcefrog.net-20070424050204-bfkc1qiq0axt5f14
Merge trunk & fix NEWS conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
            state.save()
174
174
        finally:
175
175
            state.unlock()
176
 
        del state # Callers should unlock
 
176
        del state
177
177
        state = dirstate.DirState.on_file('dirstate')
178
178
        state.lock_read()
179
179
        try:
648
648
        try:
649
649
            self.assertIsInstance(state, dirstate.DirState)
650
650
            lines = state.get_lines()
651
 
            self.assertFileEqual(''.join(state.get_lines()),
652
 
                'dirstate')
653
 
            self.check_state_with_reopen(expected_result, state)
654
 
        except:
 
651
        finally:
655
652
            state.unlock()
656
 
            raise
 
653
        # On win32 you can't read from a locked file, even within the same
 
654
        # process. So we have to unlock and release before we check the file
 
655
        # contents.
 
656
        self.assertFileEqual(''.join(lines), 'dirstate')
 
657
        state.lock_read() # check_state_with_reopen will unlock
 
658
        self.check_state_with_reopen(expected_result, state)
657
659
 
658
660
 
659
661
class TestDirStateManipulations(TestCaseWithDirState):