~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Aaron Bentley
  • Date: 2007-02-09 07:12:55 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070209071255-74pex0pbd0gelb1u
Get merge working initially

Show diffs side-by-side

added added

removed removed

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