~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-11-24 13:15:51 UTC
  • mfrom: (6240.4.5 rmbranch-colo)
  • Revision ID: pqm@pqm.ubuntu.com-20111124131551-u7xzxgto1p1yfz57
(gz) Support removing colocated branches in 'bzr rmbranch' (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class TestRemoveBranch(TestCaseWithTransport):
29
29
 
30
 
    def example_branch(self, path='.'):
31
 
        tree = self.make_branch_and_tree(path)
 
30
    def example_branch(self, path='.', format=None):
 
31
        tree = self.make_branch_and_tree(path, format=format)
32
32
        self.build_tree_contents([(path + '/hello', 'foo')])
33
33
        tree.add('hello')
34
34
        tree.commit(message='setup')
35
35
        self.build_tree_contents([(path + '/goodbye', 'baz')])
36
36
        tree.add('goodbye')
37
37
        tree.commit(message='setup')
 
38
        return tree
38
39
 
39
40
    def test_remove_local(self):
40
41
        # Remove a local branch.
58
59
        dir = bzrdir.BzrDir.open('a')
59
60
        self.assertFalse(dir.has_branch())
60
61
 
 
62
    def test_remove_colo(self):
 
63
        # Remove a colocated branch.
 
64
        tree = self.example_branch('a', format='development-colo')
 
65
        tree.bzrdir.create_branch(name="otherbranch")
 
66
        self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
 
67
        self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url)
 
68
        dir = bzrdir.BzrDir.open('a')
 
69
        self.assertFalse(dir.has_branch('otherbranch'))
 
70
        self.assertTrue(dir.has_branch())
 
71
 
61
72
 
62
73
class TestSmartServerRemoveBranch(TestCaseWithTransport):
63
74