~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

(broken) merge aaron's workingtree format changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
            conflicts.UnversionedParent('Versioned directory', 'b', 'b-id')],
179
179
            tree_a.conflicts())
180
180
 
 
181
    def test_nested_merge(self):
 
182
        tree = self.make_branch_and_tree('tree', format='experimental-knit3')
 
183
        sub_tree = self.make_branch_and_tree('tree/sub-tree',
 
184
                                             format='experimental-knit3')
 
185
        sub_tree.set_root_id('sub-tree-root')
 
186
        self.build_tree_contents([('tree/sub-tree/file', 'text1')])
 
187
        sub_tree.add('file')
 
188
        sub_tree.commit('foo')
 
189
        tree.add_reference(sub_tree)
 
190
        tree.commit('set text to 1')
 
191
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
 
192
        self.build_tree_contents([('tree2/sub-tree/file', 'text2')])
 
193
        subtree2 = tree2.get_nested_tree(tree2.inventory['sub-tree-root'],
 
194
                                         'sub-tree')
 
195
        tree2.commit('changed file text')
 
196
        tree.merge_from_branch(tree2.branch)
 
197
        self.assertFileEqual('text2', 'tree/sub-tree/file')
 
198
 
181
199
    def test_merge_with_missing(self):
182
200
        tree_a = self.make_branch_and_tree('tree_a')
183
201
        self.build_tree_contents([('tree_a/file', 'content_1')])