~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

[BROKEN] Many updates to stop using experimental formats in tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
    def setUp(self):
46
46
        super(TestTreeTransform, self).setUp()
47
 
        self.wt = self.make_branch_and_tree('.', format='experimental-reference-dirstate')
 
47
        self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree')
48
48
        os.chdir('..')
49
49
 
50
50
    def get_transform(self):
127
127
        self.assertEqual(self.wt.path2id('oz/dorothy'), 'dorothy-id')
128
128
        self.assertEqual(self.wt.path2id('oz/dorothy/toto'), 'toto-id')
129
129
 
130
 
        self.assertEqual('toto-contents', 
 
130
        self.assertEqual('toto-contents',
131
131
                         self.wt.get_file_byname('oz/dorothy/toto').read())
132
132
        self.assertIs(self.wt.is_executable('toto-id'), False)
133
133
 
137
137
        trans_id = transform.new_directory('reference', root, 'subtree-id')
138
138
        transform.set_tree_reference('subtree-revision', trans_id)
139
139
        transform.apply()
140
 
        self.assertEqual('subtree-revision', 
 
140
        tree.lock_read()
 
141
        self.addCleanup(tree.unlock)
 
142
        self.assertEqual('subtree-revision',
141
143
                         tree.inventory['subtree-id'].reference_revision)
142
144
 
143
145
    def test_conflicts(self):
967
969
        a.add(['foo', 'foo/bar', 'foo/baz'])
968
970
        a.commit('initial commit')
969
971
        b = BzrDir.create_standalone_workingtree('b')
970
 
        build_tree(a.basis_tree(), b)
 
972
        basis = a.basis_tree()
 
973
        basis.lock_read()
 
974
        self.addCleanup(basis.unlock)
 
975
        build_tree(basis, b)
971
976
        self.assertIs(os.path.isdir('b/foo'), True)
972
977
        self.assertEqual(file('b/foo/bar', 'rb').read(), "contents")
973
978
        self.assertEqual(os.readlink('b/foo/baz'), 'a/foo/bar')
974
979
 
975
980
    def test_build_with_references(self):
976
 
        tree = self.make_branch_and_tree('source', format='experimental-reference-dirstate')
977
 
        subtree = self.make_branch_and_tree('source/subtree', 
978
 
                                            format='experimental-reference-dirstate')
 
981
        tree = self.make_branch_and_tree('source',
 
982
            format='dirstate-with-subtree')
 
983
        subtree = self.make_branch_and_tree('source/subtree',
 
984
            format='dirstate-with-subtree')
979
985
        tree.add_reference(subtree)
980
986
        tree.commit('a revision')
981
987
        tree.branch.create_checkout('target')