~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-21 04:49:05 UTC
  • mfrom: (2367.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070321044905-ded01a80ab49bdd9
Update NEWS to match bzr 0.15.

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
 
53
73
    def test_branch_only_copies_history(self):
54
74
        # Knit branches should only push the history for the current revision.
55
75
        format = bzrdir.BzrDirMetaFormat1()