~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-04-02 01:44:26 UTC
  • mfrom: (6518 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120402014426-0o5qtysohyl006b2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from bzrlib import (
21
21
    branch,
22
 
    bzrdir,
 
22
    controldir,
23
23
    errors,
24
24
    tests,
25
25
    )
35
35
        base_tree.add(['a', 'b'])
36
36
        base_tree.commit('init')
37
37
        base_tree.unlock()
38
 
        branch = base_tree.branch
39
38
 
40
 
        child_tree = branch.create_checkout('child')
 
39
        child_tree = base_tree.branch.create_checkout('child')
41
40
 
42
41
        self.check_revno(1, 'child')
43
 
        d = bzrdir.BzrDir.open('child')
 
42
        d = controldir.ControlDir.open('child')
44
43
        self.assertNotEqual(None, d.open_branch().get_master_branch())
45
44
 
46
45
        return base_tree, child_tree
47
46
 
48
47
    def check_revno(self, val, loc='.'):
49
48
        self.assertEqual(
50
 
            val, bzrdir.BzrDir.open(loc).open_branch().last_revision_info()[0])
 
49
            val, controldir.ControlDir.open(loc).open_branch().last_revision_info()[0])
51
50
 
52
51
    def test_simple_binding(self):
53
52
        tree = self.make_branch_and_tree('base')
59
58
 
60
59
        self.run_bzr('bind ../base', working_dir='child')
61
60
 
62
 
        d = bzrdir.BzrDir.open('child')
 
61
        d = controldir.ControlDir.open('child')
63
62
        self.assertNotEqual(None, d.open_branch().get_master_branch())
64
63
 
65
64
        self.run_bzr('unbind', working_dir='child')
133
132
        self.run_bzr('bind ../child', working_dir='child2')
134
133
 
135
134
        # Refresh the child tree object as 'unbind' modified it
136
 
        child2_tree = bzrdir.BzrDir.open('child2').open_workingtree()
 
135
        child2_tree = controldir.ControlDir.open('child2').open_workingtree()
137
136
        self.assertRaises(errors.CommitToDoubleBoundBranch,
138
137
                child2_tree.commit, message='child2', allow_pointless=True)
139
138
 
356
355
        branch = tree.branch
357
356
        tree.bzrdir.sprout('child')
358
357
        self.run_bzr('bind --directory=child base')
359
 
        d = bzrdir.BzrDir.open('child')
 
358
        d = controldir.ControlDir.open('child')
360
359
        self.assertNotEqual(None, d.open_branch().get_master_branch())
361
360
        self.run_bzr('unbind -d child')
362
361
        self.assertEqual(None, d.open_branch().get_master_branch())