~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_branch.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        self.runbzr('commit -m foo --unchanged')
51
51
        os.chdir('..')
52
52
 
53
 
    def test_branch_basis(self):
54
 
        # ensure that basis really does grab from the basis by having incomplete source
55
 
        tree = self.make_branch_and_tree('commit_tree')
56
 
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
57
 
        tree.add('foo')
58
 
        tree.commit('revision 1', rev_id='1')
59
 
        source = self.make_branch_and_tree('source')
60
 
        # this gives us an incomplete repository
61
 
        tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
62
 
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
63
 
        tree.bzrdir.open_branch().copy_content_into(source.branch)
64
 
        tree.copy_content_into(source)
65
 
        self.assertFalse(source.branch.repository.has_revision('2'))
66
 
        dir = source.bzrdir
67
 
        self.runbzr('branch source target --basis commit_tree')
68
 
        target = bzrdir.BzrDir.open('target')
69
 
        self.assertEqual('2', target.open_branch().last_revision())
70
 
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
71
 
        self.assertTrue(target.open_branch().repository.has_revision('2'))
72
 
 
73
53
    def test_branch_only_copies_history(self):
74
54
        # Knit branches should only push the history for the current revision.
75
55
        format = bzrdir.BzrDirMetaFormat1()