124
127
to_repo.texts.get_record_stream([('foo', revid)],
125
128
'unordered', True).next().get_bytes_as('fulltext'))
130
def test_fetch_parent_inventories_at_stacking_boundary_smart(self):
131
self.setup_smart_server_with_call_log()
132
self.test_fetch_parent_inventories_at_stacking_boundary()
134
def test_fetch_parent_inventories_at_stacking_boundary_smart_old(self):
135
self.setup_smart_server_with_call_log()
136
self.disable_verb('Repository.insert_stream_1.19')
137
self.test_fetch_parent_inventories_at_stacking_boundary()
127
139
def test_fetch_parent_inventories_at_stacking_boundary(self):
128
140
"""Fetch to a stacked branch copies inventories for parents of
129
141
revisions at the stacking boundary.
180
192
self.assertEqual(left_tree.inventory, stacked_left_tree.inventory)
181
193
self.assertEqual(right_tree.inventory, stacked_right_tree.inventory)
195
# Finally, it's not enough to see that the basis inventories are
196
# present. The texts introduced in merge (and only those) should be
197
# present, and also generating a stream should succeed without blowing
199
self.assertTrue(unstacked_repo.has_revision('merge'))
200
expected_texts = set([('file-id', 'merge')])
201
if stacked_branch.repository.texts.get_parent_map([('root-id',
203
# If a (root-id,merge) text exists, it should be in the stacked
205
expected_texts.add(('root-id', 'merge'))
206
self.assertEqual(expected_texts, unstacked_repo.texts.keys())
207
self.assertCanStreamRevision(unstacked_repo, 'merge')
209
def assertCanStreamRevision(self, repo, revision_id):
210
exclude_keys = set(repo.all_revision_ids()) - set([revision_id])
211
search = SearchResult([revision_id], exclude_keys, 1, [revision_id])
212
source = repo._get_source(repo._format)
213
for substream_kind, substream in source.get_stream(search):
214
# Consume the substream
183
217
def test_fetch_across_stacking_boundary_ignores_ghost(self):
184
218
if not self.repository_format_to.supports_external_lookups:
185
219
raise TestNotApplicable("Need stacking support in the target.")
218
252
self.addCleanup(stacked_branch.unlock)
219
253
stacked_second_tree = stacked_branch.repository.revision_tree('second')
220
254
self.assertEqual(second_tree.inventory, stacked_second_tree.inventory)
255
# Finally, it's not enough to see that the basis inventories are
256
# present. The texts introduced in merge (and only those) should be
257
# present, and also generating a stream should succeed without blowing
259
self.assertTrue(unstacked_repo.has_revision('third'))
260
expected_texts = set([('file-id', 'third')])
261
if stacked_branch.repository.texts.get_parent_map([('root-id',
263
# If a (root-id,third) text exists, it should be in the stacked
265
expected_texts.add(('root-id', 'third'))
266
self.assertEqual(expected_texts, unstacked_repo.texts.keys())
267
self.assertCanStreamRevision(unstacked_repo, 'third')
222
269
def test_fetch_missing_basis_text(self):
223
270
"""If fetching a delta, we should die if a basis is not present."""