356
355
self.addCleanup(source.unlock)
357
356
target.fetch(source, revision_id='B-id')
360
class TestSource(TestCaseWithRepository):
361
"""Tests for/about the results of Repository._get_source."""
363
def test_no_absent_records_in_stream_with_ghosts(self):
364
# XXX: Arguably should be in per_interrepository but
365
# doesn't actually gain coverage there; need a specific set of
366
# permutations to cover it.
367
# bug lp:376255 was reported about this.
368
builder = self.make_branch_builder('repo')
369
builder.start_series()
370
builder.build_snapshot('tip', ['ghost'],
371
[('add', ('', 'ROOT_ID', 'directory', ''))],
372
allow_leftmost_as_ghost=True)
373
builder.finish_series()
374
b = builder.get_branch()
376
self.addCleanup(b.unlock)
378
source = repo._get_source(repo._format)
379
search = graph.PendingAncestryResult(['tip'], repo)
380
stream = source.get_stream(search)
381
for substream_type, substream in stream:
382
for record in substream:
383
self.assertNotEqual('absent', record.storage_kind,
384
"Absent record for %s" % (((substream_type,) + record.key),))