298
299
revision_id = tree.commit('test')
299
300
repo.fetch(tree.branch.repository)
300
301
repo.fetch(tree.branch.repository)
304
class TestSource(TestCaseWithRepository):
305
"""Tests for/about the results of Repository._get_source."""
307
def test_no_absent_records_in_stream_with_ghosts(self):
308
# XXX: Arguably should be in interrepository_implementations but
309
# doesn't actually gain coverage there; need a specific set of
310
# permutations to cover it.
311
# bug lp:376255 was reported about this.
312
builder = self.make_branch_builder('repo')
313
builder.start_series()
314
builder.build_snapshot('tip', ['ghost'],
315
[('add', ('', 'ROOT_ID', 'directory', ''))],
316
allow_leftmost_as_ghost=True)
317
builder.finish_series()
318
b = builder.get_branch()
320
self.addCleanup(b.unlock)
322
source = repo._get_source(repo._format)
323
search = graph.PendingAncestryResult(['tip'], repo)
324
stream = source.get_stream(search)
325
for substream_type, substream in stream:
326
for record in substream:
327
self.assertNotEqual('absent', record.storage_kind,
328
"Absent record for %s" % (((substream_type,) + record.key),))