49
49
['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
50
50
'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
51
t = b.revision_tree(rh[0])
51
t = b.repository.revision_tree(rh[0])
52
52
foo_id = 'foo-20051004035605-91e788d1875603ae'
53
53
eq(t.get_file_text(foo_id), 'initial contents\n')
54
t = b.revision_tree(rh[1])
54
t = b.repository.revision_tree(rh[1])
55
55
eq(t.get_file_text(foo_id), 'new contents\n')
57
57
def test_upgrade_with_ghosts(self):
58
58
"""Upgrade v0.0.4 tree containing ghost references.
60
60
That is, some of the parents of revisions mentioned in the branch
61
aren't present in the branches storage.
61
aren't present in the branch's storage.
63
63
This shouldn't normally happen in branches created entirely in
64
bzr but can happen in imports from baz and arch, or from other
65
systems, where the importer knows about a revision but not
64
bzr, but can happen in branches imported from baz and arch, or from
65
other systems, where the importer knows about a revision but not
67
67
eq = self.assertEquals
68
68
self.build_tree_contents(_ghost_template)
70
70
b = Branch.open(u'.')
71
71
revision_id = b.revision_history()[1]
72
rev = b.get_revision(revision_id)
72
rev = b.repository.get_revision(revision_id)
73
73
eq(len(rev.parent_ids), 2)
74
74
eq(rev.parent_ids[1], 'wibble@wobble-2')