~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge with get_file_sha1

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self.assertEqual(branchb_id, checkout.last_revision())
63
63
        checkout = checkout.bzrdir.open_workingtree()
64
64
        self.assertEqual(tree2.branch.base, checkout.branch.base)
65
 
        
 
65
 
 
66
    def test_switch_finds_relative_bound_branch(self):
 
67
        """Using switch on a heavy checkout should find master sibling
 
68
 
 
69
        The behaviour of lighweight and heavy checkouts should be 
 
70
        consistentwhen using the convenient "switch to sibling" feature
 
71
        Both should switch to a sibling of the branch
 
72
        they are bound to, and not a sibling of themself"""
 
73
 
 
74
        self.build_tree(['repo/',
 
75
                         'heavyco/'])
 
76
        tree1 = self.make_branch_and_tree('repo/brancha')
 
77
        tree1.commit('foo')
 
78
        tree2 = self.make_branch_and_tree('repo/branchb')
 
79
        tree2.pull(tree1.branch)
 
80
        branchb_id = tree2.commit('bar')
 
81
        checkout = tree1.branch.create_checkout('heavyco/a', lightweight=False)
 
82
        self.run_bzr(['switch', 'branchb'], working_dir='heavyco/a')
 
83
        self.assertEqual(branchb_id, checkout.last_revision())
 
84
        self.assertEqual(tree2.branch.base, checkout.branch.get_bound_location())