/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

  • Committer: John Arbash Meinel
  • Date: 2009-04-01 15:49:55 UTC
  • mto: (3735.2.184 brisbane-core)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090401154955-vukyb3s3igmrnu95
Change the tests so we now just use a direct test that _get_source is
returning the optimized GroupCHKStreamSource.

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
        self.make_two_commits(change_root=False, fetch_twice=True)
603
603
        self.assertEqual((('TREE_ROOT', 'first-id'),),
604
604
            self.get_parents('TREE_ROOT', 'second-id'))
605
 
 
606
 
 
607
 
class TestGCCHKToGCCHKFetch(TestCaseWithTransport):
608
 
 
609
 
    def test_simple_fetch(self):
610
 
        builder = self.make_branch_builder('source', format='gc-chk255-big')
611
 
        builder.start_series()
612
 
        try:
613
 
            builder.build_snapshot('A', None, [
614
 
                ('add', ('', 'TREE_ROOT', 'directory', None))])
615
 
            builder.build_snapshot('B', ['A'], [
616
 
                ('add', ('foo', 'foo-id', 'file', 'foo content\n'))])
617
 
            builder.build_snapshot('C', ['B'], [
618
 
                ('add', ('bar', 'bar-id', 'file', 'bar content\n'))])
619
 
        finally:
620
 
            builder.finish_series()
621
 
        source_branch = builder.get_branch()
622
 
 
623
 
        target_branch = self.make_branch('target', format='gc-chk255-big')
624
 
        target_branch.lock_write()
625
 
        self.addCleanup(target_branch.unlock)
626
 
        target = target_branch.repository
627
 
        target.fetch(source_branch.repository, 'B')
628
 
        self.assertEqual({'B': ('A',)}, target.get_parent_map(['B', 'C']))
629
 
        target.fetch(source_branch.repository, 'C')
630
 
        self.assertEqual({'B': ('A',), 'C': ('B',)},
631
 
                         target.get_parent_map(['B', 'C']))