~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-06-16 14:33:42 UTC
  • mfrom: (1770.2.1 config)
  • Revision ID: pqm@pqm.ubuntu.com-20060616143342-8f7f4a4f77c1e4c8
Use create_signature for signing policy, deprecate check_signatures for this

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        self.failUnlessExists('.bzr/README')
47
47
 
48
48
    def test_upgrade_simple(self):
49
 
        """Upgrade simple v0.0.4 format to latest format"""
 
49
        """Upgrade simple v0.0.4 format to v6"""
50
50
        eq = self.assertEquals
51
51
        self.build_tree_contents(_upgrade1_template)
52
52
        upgrade(u'.')
131
131
        self.build_tree_contents(_upgrade_dir_template)
132
132
        upgrade('.', bzrdir.BzrDirMetaFormat1())
133
133
        tree = workingtree.WorkingTree.open('.')
134
 
        self.assertEqual([tree.branch.revision_history()[-1]],
135
 
            tree.get_parent_ids())
136
 
 
137
 
    def test_upgrade_v6_to_meta_no_workingtree(self):
138
 
        # Some format6 branches do not have checkout files. Upgrading
139
 
        # such a branch to metadir must not setup a working tree.
140
 
        self.build_tree_contents(_upgrade1_template)
141
 
        upgrade('.', bzrdir.BzrDirFormat6())
142
 
        transport = get_transport('.')
143
 
        transport.delete_multi(['.bzr/pending-merges', '.bzr/inventory'])
144
 
        assert not transport.has('.bzr/stat-cache')
145
 
        # XXX: upgrade fails if a .bzr.backup is already present
146
 
        # -- David Allouche 2006-08-11
147
 
        transport.delete_tree('.bzr.backup')
148
 
        # At this point, we have a format6 branch without checkout files.
149
 
        upgrade('.', bzrdir.BzrDirMetaFormat1())
150
 
        # The upgrade should not have set up a working tree.
151
 
        control = bzrdir.BzrDir.open('.')
152
 
        self.assertFalse(control.has_workingtree())
153
 
        # We have covered the scope of this test, we may as well check that
154
 
        # upgrade has not eaten our data, even if it's a bit redundant with
155
 
        # other tests.
156
 
        self.failUnless(isinstance(control._format, bzrdir.BzrDirMetaFormat1))
157
 
        branch = control.open_branch()
158
 
        self.assertEquals(branch.revision_history(),
159
 
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
160
 
            'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
 
134
        self.assertEqual(tree.last_revision(),
 
135
                         tree.branch.revision_history()[-1])
161
136
 
162
137
 
163
138
_upgrade1_template = \