~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_fetch.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-06 15:15:44 UTC
  • mfrom: (5835 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5836.
  • Revision ID: john@arbash-meinel.com-20110506151544-atzxeezfwssnlacr
Merge bzr.dev 5835 in prep for release-notes updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    bzrdir,
21
21
    errors,
22
22
    gpg,
23
 
    graph,
24
23
    remote,
25
24
    repository,
26
25
    tests,
356
355
        self.addCleanup(source.unlock)
357
356
        target.fetch(source, revision_id='B-id')
358
357
 
359
 
 
360
 
class TestSource(TestCaseWithRepository):
361
 
    """Tests for/about the results of Repository._get_source."""
362
 
 
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()
375
 
        b.lock_read()
376
 
        self.addCleanup(b.unlock)
377
 
        repo = b.repository
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),))