124
124
to_repo.texts.get_record_stream([('foo', revid)],
125
125
'unordered', True).next().get_bytes_as('fulltext'))
127
def test_fetch_parent_inventories_at_stacking_boundary(self):
128
"""Fetch to a stacked branch copies inventories for parents of
129
revisions at the stacking boundary.
131
This is necessary so that the server is able to determine the file-ids
132
altered by all revisions it contains, which means that it needs both
133
the inventory for any revision it has, and the inventories of all that
136
to_repo = self.make_to_repository('to')
137
if not to_repo._format.supports_external_lookups:
138
raise TestNotApplicable("Need stacking support in the target.")
139
builder = self.make_branch_builder('branch')
140
builder.start_series()
141
builder.build_snapshot('base', None, [
142
('add', ('', 'root-id', 'directory', ''))])
143
builder.build_snapshot('left', ['base'], [])
144
builder.build_snapshot('right', ['base'], [])
145
builder.build_snapshot('merge', ['left', 'right'], [])
146
builder.finish_series()
147
branch = builder.get_branch()
148
repo = self.make_to_repository('trunk')
149
trunk = repo.bzrdir.create_branch()
150
trunk.repository.fetch(branch.repository, 'left')
151
trunk.repository.fetch(branch.repository, 'right')
152
repo = self.make_to_repository('stacked')
153
stacked_branch = repo.bzrdir.create_branch()
154
stacked_branch.set_stacked_on_url(trunk.base)
155
stacked_branch.repository.fetch(branch.repository, 'merge')
156
unstacked_repo = stacked_branch.bzrdir.open_repository()
157
unstacked_repo.lock_read()
158
self.addCleanup(unstacked_repo.unlock)
159
self.assertFalse(unstacked_repo.has_revision('left'))
160
self.assertFalse(unstacked_repo.has_revision('right'))
162
set([('left',), ('right',), ('merge',)]),
163
unstacked_repo.inventories.keys())
127
165
def test_fetch_missing_basis_text(self):
128
166
"""If fetching a delta, we should die if a basis is not present."""
129
167
tree = self.make_branch_and_tree('tree')