~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        self.run_bzr(['switch', 'branchb'], working_dir='heavyco/a')
134
134
        self.assertEqual(branchb_id, checkout.last_revision())
135
135
        self.assertEqual(tree2.branch.base, checkout.branch.get_bound_location())
 
136
 
 
137
    def prepare_lightweight_switch(self):
 
138
        branch = self.make_branch('branch')
 
139
        branch.create_checkout('tree', lightweight=True)
 
140
        os.rename('branch', 'branch1')
 
141
 
 
142
    def test_switch_lightweight_after_branch_moved(self):
 
143
        self.prepare_lightweight_switch()
 
144
        self.run_bzr('switch --force ../branch1', working_dir='tree')
 
145
        branch_location = WorkingTree.open('tree').branch.base
 
146
        self.assertEndsWith(branch_location, 'branch1/')
 
147
 
 
148
    def test_switch_lightweight_after_branch_moved_relative(self):
 
149
        self.prepare_lightweight_switch()
 
150
        self.run_bzr('switch --force branch1', working_dir='tree')
 
151
        branch_location = WorkingTree.open('tree').branch.base
 
152
        self.assertEndsWith(branch_location, 'branch1/')