~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

  • Committer: Robert Collins
  • Date: 2006-02-26 07:54:02 UTC
  • mto: (1587.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1588.
  • Revision ID: robertc@robertcollins.net-20060226075402-92fca9fdb7b0070d
Check for incorrect revision parentage in the weave during revision access.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        upgrade(u'.')
53
53
        control = bzrdir.BzrDir.open('.')
54
54
        b = control.open_branch()
 
55
        r = control.open_repository()
 
56
        t = control.open_workingtree()
55
57
        # tsk, peeking under the covers.
56
 
        self.failUnless(
57
 
            isinstance(
58
 
                control._format,
59
 
                bzrdir.BzrDirFormat.get_default_format().__class__))
 
58
        self.failUnless(isinstance(control._format, bzrdir.BzrDirFormat6))
 
59
        self.failUnless(isinstance(b._format, bzrlib.branch.BzrBranchFormat4))
 
60
        self.failUnless(isinstance(r._format, repository.RepositoryFormat6))
 
61
        self.failUnless(isinstance(t._format, workingtree.WorkingTreeFormat2))
60
62
        rh = b.revision_history()
61
63
        eq(rh,
62
64
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
110
112
 
111
113
    def test_upgrade_makes_dir_weaves(self):
112
114
        self.build_tree_contents(_upgrade_dir_template)
113
 
        old_repodir = bzrlib.bzrdir.BzrDir.open_unsupported('.')
114
 
        old_repo_format = old_repodir.open_repository()._format
115
115
        upgrade('.')
116
116
        # this is the path to the literal file. As format changes 
117
117
        # occur it needs to be updated. FIXME: ask the store for the
118
118
        # path.
119
 
        repo = bzrlib.repository.Repository.open('.')
120
 
        # it should have changed the format
121
 
        self.assertNotEqual(old_repo_format.__class__, repo._format.__class__)
122
 
        # and we should be able to read the names for the file id 
123
 
        # 'dir-20051005095101-da1441ea3fa6917a'
124
 
        self.assertNotEqual(
125
 
            [],
126
 
            repo.text_store.get_weave(
127
 
                'dir-20051005095101-da1441ea3fa6917a',
128
 
                repo.get_transaction()))
 
119
        self.failUnlessExists(
 
120
            '.bzr/weaves/de/dir-20051005095101-da1441ea3fa6917a.weave')
129
121
 
130
122
    def test_upgrade_to_meta_sets_workingtree_last_revision(self):
131
123
        self.build_tree_contents(_upgrade_dir_template)