~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: 2009-05-29 15:06:16 UTC
  • mfrom: (4392 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4460.
  • Revision ID: john@arbash-meinel.com-20090529150616-m29oaesf6ekxr489
Merge bzr.dev, bringing in the gc stacking fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    bzrdir,
21
21
    errors,
22
22
    gpg,
 
23
    graph,
23
24
    remote,
24
25
    repository,
25
26
    )
298
299
        revision_id = tree.commit('test')
299
300
        repo.fetch(tree.branch.repository)
300
301
        repo.fetch(tree.branch.repository)
 
302
 
 
303
 
 
304
class TestSource(TestCaseWithRepository):
 
305
    """Tests for/about the results of Repository._get_source."""
 
306
 
 
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()
 
319
        b.lock_read()
 
320
        self.addCleanup(b.unlock)
 
321
        repo = b.repository
 
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),))