79
79
def test_upgrade_simple(self):
80
80
"""Upgrade simple v0.0.4 format to v5"""
81
eq = self.assertEquals
81
82
build_tree_contents(_upgrade1_template)
83
84
b = Branch.open('.')
85
eq(b._branch_format, 5)
86
rh = b.revision_history()
88
['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
89
'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
90
t = b.revision_tree(rh[0])
91
foo_id = 'foo-20051004035605-91e788d1875603ae'
92
eq(t.get_file_text(foo_id), 'initial contents\n')
93
t = b.revision_tree(rh[1])
94
eq(t.get_file_text(foo_id), 'new contents\n')
86
97
_upgrade1_template = \
91
102
'This is a Bazaar-NG control directory.\nDo not change any files in this directory.\n'),
92
103
('.bzr/branch-format', 'Bazaar-NG branch, format 0.0.4\n'),
93
104
('.bzr/revision-history',
94
'mbp@sourcefrog.net-20051004035611-176b16534b086b3c\nmbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd\n'),
105
'mbp@sourcefrog.net-20051004035611-176b16534b086b3c\n'
106
'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd\n'),
95
107
('.bzr/merged-patches', ''),
96
108
('.bzr/pending-merged-patches', ''),
97
109
('.bzr/branch-name', ''),
98
110
('.bzr/branch-lock', ''),
99
111
('.bzr/pending-merges', ''),
100
112
('.bzr/inventory',
101
'<inventory>\n<entry file_id="foo-20051004035605-91e788d1875603ae" kind="file" name="foo" />\n</inventory>\n'),
114
'<entry file_id="foo-20051004035605-91e788d1875603ae" kind="file" name="foo" />\n'
102
116
('.bzr/stat-cache',
103
'### bzr hashcache v5\nfoo// be9f309239729f69a6309e970ef24941d31e042c 13 1128398176 1128398176 303464 770\n'),
117
'### bzr hashcache v5\n'
118
'foo// be9f309239729f69a6309e970ef24941d31e042c 13 1128398176 1128398176 303464 770\n'),
104
119
('.bzr/text-store/',),
105
120
('.bzr/text-store/foo-20051004035611-1591048e9dc7c2d4.gz',
106
121
'\x1f\x8b\x08\x00[\xfdAC\x02\xff\xcb\xcc\xcb,\xc9L\xccQH\xce\xcf+I\xcd+)\xe6\x02\x00\xdd\xcc\xf90\x11\x00\x00\x00'),