~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.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:
24
24
 
25
25
from bzrlib import (
26
26
    branch,
27
 
    bzrdir,
 
27
    controldir,
28
28
    tests,
29
29
    upgrade,
30
30
    workingtree,
45
45
        b.set_parent('file:///EF')
46
46
        b.set_bound_location('file:///GH')
47
47
        b.set_push_location('file:///IJ')
48
 
        target = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
 
48
        target = controldir.format_registry.make_bzrdir('dirstate-with-subtree')
49
49
        converter = b.bzrdir._format.get_converter(target)
50
50
        converter.convert(b.bzrdir, None)
51
51
        new_branch = branch.Branch.open(self.get_url('branch'))
64
64
 
65
65
    def test_convert_branch7_branch8(self):
66
66
        b = self.make_branch('branch', format='1.9')
67
 
        target = bzrdir.format_registry.make_bzrdir('1.9')
 
67
        target = controldir.format_registry.make_bzrdir('1.9')
68
68
        target.set_branch_format(branch.BzrBranchFormat8())
69
69
        converter = b.bzrdir._format.get_converter(target)
70
70
        converter.convert(b.bzrdir, None)
75
75
    def test_convert_knit_dirstate_empty(self):
76
76
        # test that asking for an upgrade from knit to dirstate works.
77
77
        tree = self.make_branch_and_tree('tree', format='knit')
78
 
        target = bzrdir.format_registry.make_bzrdir('dirstate')
 
78
        target = controldir.format_registry.make_bzrdir('dirstate')
79
79
        converter = tree.bzrdir._format.get_converter(target)
80
80
        converter.convert(tree.bzrdir, None)
81
81
        new_tree = workingtree.WorkingTree.open('tree')
88
88
        tree = self.make_branch_and_tree('tree', format='knit')
89
89
        self.build_tree(['tree/file'])
90
90
        tree.add(['file'], ['file-id'])
91
 
        target = bzrdir.format_registry.make_bzrdir('dirstate')
 
91
        target = controldir.format_registry.make_bzrdir('dirstate')
92
92
        converter = tree.bzrdir._format.get_converter(target)
93
93
        converter.convert(tree.bzrdir, None)
94
94
        new_tree = workingtree.WorkingTree.open('tree')
99
99
        # test that asking for an upgrade from knit to dirstate works.
100
100
        tree = self.make_branch_and_tree('tree', format='knit')
101
101
        rev_id = tree.commit('first post')
102
 
        target = bzrdir.format_registry.make_bzrdir('dirstate')
 
102
        target = controldir.format_registry.make_bzrdir('dirstate')
103
103
        converter = tree.bzrdir._format.get_converter(target)
104
104
        converter.convert(tree.bzrdir, None)
105
105
        new_tree = workingtree.WorkingTree.open('tree')
116
116
        rev_id2 = tree.commit('second post')
117
117
        rev_id3 = merge_tree.commit('second merge post')
118
118
        tree.merge_from_branch(merge_tree.branch)
119
 
        target = bzrdir.format_registry.make_bzrdir('dirstate')
 
119
        target = controldir.format_registry.make_bzrdir('dirstate')
120
120
        converter = tree.bzrdir._format.get_converter(target)
121
121
        converter.convert(tree.bzrdir, None)
122
122
        new_tree = workingtree.WorkingTree.open('tree')
130
130
 
131
131
class TestSmartUpgrade(tests.TestCaseWithTransport):
132
132
 
133
 
    from_format = bzrdir.format_registry.make_bzrdir("pack-0.92")
134
 
    to_format = bzrdir.format_registry.make_bzrdir("2a")
 
133
    from_format = controldir.format_registry.make_bzrdir("pack-0.92")
 
134
    to_format = controldir.format_registry.make_bzrdir("2a")
135
135
 
136
136
    def make_standalone_branch(self):
137
137
        wt = self.make_branch_and_tree("branch1", format=self.from_format)
170
170
            format=self.from_format)
171
171
        # Note: self.make_branch() always creates a new repo at the location
172
172
        # so we need to avoid using that here ...
173
 
        b1 = bzrdir.BzrDir.create_branch_convenience("repo/branch1",
 
173
        b1 = controldir.ControlDir.create_branch_convenience("repo/branch1",
174
174
            format=self.from_format)
175
 
        b2 = bzrdir.BzrDir.create_branch_convenience("repo/branch2",
 
175
        b2 = controldir.ControlDir.create_branch_convenience("repo/branch2",
176
176
            format=self.from_format)
177
177
        return repo.bzrdir
178
178