46
46
self.failUnlessExists('.bzr/README')
48
48
def test_upgrade_simple(self):
49
"""Upgrade simple v0.0.4 format to v6"""
49
"""Upgrade simple v0.0.4 format to latest format"""
50
50
eq = self.assertEquals
51
51
self.build_tree_contents(_upgrade1_template)
134
134
self.assertEqual(tree.last_revision(),
135
135
tree.branch.revision_history()[-1])
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
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'])
138
163
_upgrade1_template = \