30
branch as _mod_branch,
29
35
import bzrlib.branch
30
36
from bzrlib.branch import Branch
31
import bzrlib.bzrdir as bzrdir
32
import bzrlib.repository as repository
33
37
from bzrlib.revision import is_ancestor
34
38
from bzrlib.tests import TestCase, TestCaseInTempDir
35
39
from bzrlib.transport import get_transport
159
163
['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
160
164
'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
166
def test_convert_branch5_branch6(self):
167
branch = self.make_branch('branch', format='knit')
168
branch.set_revision_history(['AB', 'CD'])
169
branch.set_parent('file:///EF')
170
branch.set_bound_location('file:///GH')
171
branch.set_push_location('file:///IJ')
172
target = bzrdir.format_registry.make_bzrdir('experimental-branch6')
173
converter = branch.bzrdir._format.get_converter(target)
174
converter.convert(branch.bzrdir, progress.DummyProgress())
175
new_branch = _mod_branch.Branch.open(self.get_url('branch'))
176
self.assertIs(new_branch.__class__, _mod_branch.BzrBranch6)
177
self.assertEqual('CD', new_branch.last_revision())
178
self.assertEqual('file:///EF', new_branch.get_parent())
179
self.assertEqual('file:///GH', new_branch.get_bound_location())
180
branch_config = new_branch.get_config()._get_branch_data_config()
181
self.assertEqual('file:///IJ',
182
branch_config.get_user_option('push_location'))
184
branch2 = self.make_branch('branch2', format='knit')
185
converter = branch2.bzrdir._format.get_converter(target)
186
converter.convert(branch2.bzrdir, progress.DummyProgress())
163
189
_upgrade1_template = \