/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

Merge test-run support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        # Remove a local branch.
43
43
        tree = self.example_tree('a')
44
44
        self.run_bzr_error(['Branch is active. Use --force to remove it.\n'],
45
 
                           'rmbranch a')
 
45
            'rmbranch a')
46
46
        self.run_bzr('rmbranch --force a')
47
47
        dir = controldir.ControlDir.open('a')
48
48
        self.assertFalse(dir.has_branch())
52
52
    def test_no_branch(self):
53
53
        # No branch in the current directory.
54
54
        self.make_repository('a')
55
 
        self.run_bzr_error(['Not a branch'], 'rmbranch a')
 
55
        self.run_bzr_error(['Not a branch'],
 
56
            'rmbranch a')
56
57
 
57
58
    def test_no_tree(self):
58
59
        # removing the active branch is possible if there is no tree
66
67
        # location argument defaults to current directory
67
68
        self.example_tree('a')
68
69
        self.run_bzr_error(['Branch is active. Use --force to remove it.\n'],
69
 
                           'rmbranch a')
 
70
            'rmbranch a')
70
71
        self.run_bzr('rmbranch --force', working_dir='a')
71
72
        dir = controldir.ControlDir.open('a')
72
73
        self.assertFalse(dir.has_branch())
76
77
        tree = self.example_tree('a')
77
78
        tree.controldir.create_branch(name="otherbranch")
78
79
        self.assertTrue(tree.controldir.has_branch('otherbranch'))
79
 
        self.run_bzr('rmbranch %s,branch=otherbranch' %
80
 
                     tree.controldir.user_url)
 
80
        self.run_bzr('rmbranch %s,branch=otherbranch' % tree.controldir.user_url)
81
81
        dir = controldir.ControlDir.open('a')
82
82
        self.assertFalse(dir.has_branch('otherbranch'))
83
83
        self.assertTrue(dir.has_branch())
98
98
        branch = dir.create_branch('otherbranch')
99
99
        branch.create_checkout('a')
100
100
        self.run_bzr_error(['Branch is active. Use --force to remove it.\n'],
101
 
                           'rmbranch otherbranch -d %s' % branch.controldir.user_url)
 
101
            'rmbranch otherbranch -d %s' % branch.controldir.user_url)
102
102
        self.assertTrue(dir.has_branch('otherbranch'))
103
 
        self.run_bzr('rmbranch --force otherbranch -d %s' %
104
 
                     branch.controldir.user_url)
 
103
        self.run_bzr('rmbranch --force otherbranch -d %s' % branch.controldir.user_url)
105
104
        self.assertFalse(dir.has_branch('otherbranch'))
106
105
 
107
106