~lifeless/bzr/dirstate2

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree_4.py

  • Committer: Robert Collins
  • Date: 2009-09-29 05:21:38 UTC
  • Revision ID: robertc@robertcollins.net-20090929052138-u2po4lj409sohiqa
Hook up IndirectedDirState to --development-rich-root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
666
666
        self.assertEqual(["contents of foo\n"], file_obj.readlines())
667
667
 
668
668
 
 
669
class TestWorkingTreeFormat7(TestCaseWithTransport):
 
670
    """Tests specific to WorkingTreeFormat7."""
 
671
 
 
672
    def test_disk_layout(self):
 
673
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
 
674
        control.create_repository()
 
675
        control.create_branch()
 
676
        tree = workingtree_4.WorkingTreeFormat7().initialize(control)
 
677
        # we want:
 
678
        # format 'Bazaar Working Tree format 7'
 
679
        t = control.get_workingtree_transport(None)
 
680
        self.assertEqualDiff('Bazaar Working Tree Format 7 (bzr 2.1)\n',
 
681
                             t.get('format').read())
 
682
        self.assertFalse(t.has('inventory.basis'))
 
683
        state = dirstate.IndirectedDirState.on_file(
 
684
            t.local_abspath('dirstate'))
 
685
        state.lock_read()
 
686
        try:
 
687
            self.assertEqual([], state.get_parent_ids())
 
688
        finally:
 
689
            state.unlock()
 
690
 
669
691
class TestCorruptDirstate(TestCaseWithTransport):
670
692
    """Tests for how we handle when the dirstate has been corrupted."""
671
693