/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 tests/test_branch.py

Rename BzrDir to ControlDir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    Branch,
38
38
    InterBranch,
39
39
    )
40
 
from bzrlib.bzrdir import (
41
 
    BzrDir,
42
 
    )
 
40
try:
 
41
    from bzrlib.controldir import (
 
42
        ControlDir,
 
43
        )
 
44
except ImportError:
 
45
    # bzr < 2.3
 
46
    from bzrlib.bzrdir import (
 
47
        BzrDir,
 
48
        )
 
49
    ControlDir = BzrDir
43
50
from bzrlib.repository import (
44
51
    Repository,
45
52
    )
46
53
 
47
54
from bzrlib.plugins.git import (
48
 
    LocalGitBzrDirFormat,
 
55
    LocalGitControlDirFormat,
49
56
    branch,
50
57
    tests,
51
58
    )
58
65
 
59
66
    def test_open_existing(self):
60
67
        GitRepo.init('.')
61
 
        d = BzrDir.open('.')
 
68
        d = ControlDir.open('.')
62
69
        thebranch = d.create_branch()
63
70
        self.assertIsInstance(thebranch, branch.GitBranch)
64
71
 
65
72
    def test_repr(self):
66
73
        GitRepo.init('.')
67
 
        d = BzrDir.open('.')
 
74
        d = ControlDir.open('.')
68
75
        thebranch = d.create_branch()
69
76
        self.assertEquals("<LocalGitBranch('file://%s/', 'HEAD')>" % self.test_dir, repr(thebranch))
70
77
 
71
78
    def test_last_revision_is_null(self):
72
79
        GitRepo.init('.')
73
 
        thedir = BzrDir.open('.')
 
80
        thedir = ControlDir.open('.')
74
81
        thebranch = thedir.create_branch()
75
82
        self.assertEqual(revision.NULL_REVISION, thebranch.last_revision())
76
83
        self.assertEqual((0, revision.NULL_REVISION),
130
137
    def setUp(self):
131
138
        tests.TestCaseWithTransport.setUp(self)
132
139
        dulwich.repo.Repo.create(self.test_dir)
133
 
        d = BzrDir.open(self.test_dir)
 
140
        d = ControlDir.open(self.test_dir)
134
141
        self.git_branch = d.create_branch()
135
142
 
136
143
    def test_get_parent(self):
186
193
        return "d", (marks[mark1], marks[mark2])
187
194
 
188
195
    def clone_git_branch(self, from_url, to_url):
189
 
        from_dir = BzrDir.open(from_url)
 
196
        from_dir = ControlDir.open(from_url)
190
197
        to_dir = from_dir.sprout(to_url)
191
198
        return to_dir.open_branch()
192
199
 
252
259
class ForeignTestsBranchFactory(object):
253
260
 
254
261
    def make_empty_branch(self, transport):
255
 
        d = LocalGitBzrDirFormat().initialize_on_transport(transport)
 
262
        d = LocalGitControlDirFormat().initialize_on_transport(transport)
256
263
        return d.create_branch()
257
264
 
258
265
    make_branch = make_empty_branch