26
from bzrlib.tests import TestCase, TestCaseInTempDir
26
import bzrlib.branch as branch
27
27
from bzrlib.branch import Branch
28
28
from bzrlib.revision import is_ancestor
29
from bzrlib.tests import TestCase, TestCaseInTempDir
30
from bzrlib.transport import get_transport
29
31
from bzrlib.upgrade import upgrade
43
45
self.build_tree_contents(_upgrade1_template)
45
47
b = Branch.open(u'.')
46
eq(b._branch_format, 6)
48
# tsk, peeking under the covers.
49
self.failUnless(isinstance(b._branch_format, branch.BzrBranchFormat6))
47
50
rh = b.revision_history()
49
52
['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
53
56
eq(t.get_file_text(foo_id), 'initial contents\n')
54
57
t = b.repository.revision_tree(rh[1])
55
58
eq(t.get_file_text(foo_id), 'new contents\n')
59
# check a backup was made:
60
transport = get_transport(b.base)
61
transport.stat('.bzr.backup')
62
transport.stat('.bzr.backup/README')
63
transport.stat('.bzr.backup/branch-format')
64
transport.stat('.bzr.backup/revision-history')
65
transport.stat('.bzr.backup/merged-patches')
66
transport.stat('.bzr.backup/pending-merged-patches')
67
transport.stat('.bzr.backup/pending-merges')
68
transport.stat('.bzr.backup/branch-name')
69
transport.stat('.bzr.backup/branch-lock')
70
transport.stat('.bzr.backup/inventory')
71
transport.stat('.bzr.backup/stat-cache')
72
transport.stat('.bzr.backup/text-store')
73
transport.stat('.bzr.backup/text-store/foo-20051004035611-1591048e9dc7c2d4.gz')
74
transport.stat('.bzr.backup/text-store/foo-20051004035756-4081373d897c3453.gz')
75
transport.stat('.bzr.backup/inventory-store/')
76
transport.stat('.bzr.backup/inventory-store/mbp@sourcefrog.net-20051004035611-176b16534b086b3c.gz')
77
transport.stat('.bzr.backup/inventory-store/mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd.gz')
78
transport.stat('.bzr.backup/revision-store/')
79
transport.stat('.bzr.backup/revision-store/mbp@sourcefrog.net-20051004035611-176b16534b086b3c.gz')
80
transport.stat('.bzr.backup/revision-store/mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd.gz')
57
82
def test_upgrade_with_ghosts(self):
58
83
"""Upgrade v0.0.4 tree containing ghost references.