~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-19 08:31:08 UTC
  • mfrom: (1666.1.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060419083108-fab2970f4575b010
Change the default branch format to be metadir. (Robert Collins, Aaron Bentley).

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()
57
55
        # tsk, peeking under the covers.
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))
 
56
        self.failUnless(
 
57
            isinstance(
 
58
                control._format,
 
59
                bzrdir.BzrDirFormat.get_default_format().__class__))
62
60
        rh = b.revision_history()
63
61
        eq(rh,
64
62
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
112
110
 
113
111
    def test_upgrade_makes_dir_weaves(self):
114
112
        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
 
        self.failUnlessExists(
120
 
            '.bzr/weaves/de/dir-20051005095101-da1441ea3fa6917a.weave')
 
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()))
121
129
 
122
130
    def test_upgrade_to_meta_sets_workingtree_last_revision(self):
123
131
        self.build_tree_contents(_upgrade_dir_template)