~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: 2012-03-06 19:49:19 UTC
  • mfrom: (6472.2.6 use-bzr-controldir)
  • Revision ID: pqm@pqm.ubuntu.com-20120306194919-kt7mj6xmhifsgees
(jelmer) Use bzrlib.controldir for generic access to control directories,
 rather than bzrlib.bzrdir. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Black-box tests for bzr rmbranch."""
19
19
 
20
20
from bzrlib import (
21
 
    bzrdir,
 
21
    controldir,
22
22
    )
23
23
from bzrlib.tests import (
24
24
    TestCaseWithTransport,
44
44
        self.run_bzr_error(['Branch is active. Use --force to remove it.\n'],
45
45
            'rmbranch a')
46
46
        self.run_bzr('rmbranch --force a')
47
 
        dir = bzrdir.BzrDir.open('a')
 
47
        dir = controldir.ControlDir.open('a')
48
48
        self.assertFalse(dir.has_branch())
49
49
        self.assertPathExists('a/hello')
50
50
        self.assertPathExists('a/goodbye')
60
60
        tree = self.example_tree('a')
61
61
        tree.bzrdir.destroy_workingtree()
62
62
        self.run_bzr('rmbranch', working_dir='a')
63
 
        dir = bzrdir.BzrDir.open('a')
 
63
        dir = controldir.ControlDir.open('a')
64
64
        self.assertFalse(dir.has_branch())
65
65
 
66
66
    def test_no_arg(self):
69
69
        self.run_bzr_error(['Branch is active. Use --force to remove it.\n'],
70
70
            'rmbranch a')
71
71
        self.run_bzr('rmbranch --force', working_dir='a')
72
 
        dir = bzrdir.BzrDir.open('a')
 
72
        dir = controldir.ControlDir.open('a')
73
73
        self.assertFalse(dir.has_branch())
74
74
 
75
75
    def test_remove_colo(self):
78
78
        tree.bzrdir.create_branch(name="otherbranch")
79
79
        self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
80
80
        self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url)
81
 
        dir = bzrdir.BzrDir.open('a')
 
81
        dir = controldir.ControlDir.open('a')
82
82
        self.assertFalse(dir.has_branch('otherbranch'))
83
83
        self.assertTrue(dir.has_branch())
84
84
 
88
88
        tree.bzrdir.create_branch(name="otherbranch")
89
89
        self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
90
90
        self.run_bzr('rmbranch otherbranch -d %s' % tree.bzrdir.user_url)
91
 
        dir = bzrdir.BzrDir.open('a')
 
91
        dir = controldir.ControlDir.open('a')
92
92
        self.assertFalse(dir.has_branch('otherbranch'))
93
93
        self.assertTrue(dir.has_branch())
94
94