~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Aaron Bentley
  • Date: 2011-07-06 20:52:00 UTC
  • mto: (6011.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6012.
  • Revision ID: aaron@aaronbentley.com-20110706205200-z1fxvikw8ohvjqbm
Merging an unrelated tree retains root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
            preview = tt.get_preview_tree()
136
136
            self.assertEqual(wt.get_root_id(), preview.get_root_id())
137
137
 
 
138
    def test_merge_unrelated_retains_root(self):
 
139
        wt = self.make_branch_and_tree('tree')
 
140
        null_tree = wt.basis_tree()
 
141
        self.build_tree(['tree/file'])
 
142
        wt.add('file')
 
143
        wt.commit('tree with root')
 
144
        other_tree = self.make_branch_and_tree('other')
 
145
        other_tree.commit('add root')
 
146
        merger = _mod_merge.Merge3Merger(wt, wt, null_tree, other_tree,
 
147
                                         this_branch=wt.branch,
 
148
                                         do_merge=False)
 
149
        with merger.make_preview_transform() as tt:
 
150
            preview = tt.get_preview_tree()
 
151
            self.assertEqual(wt.get_root_id(), preview.get_root_id())
 
152
 
138
153
    def test_create_rename(self):
139
154
        """Rename an inventory entry while creating the file"""
140
155
        tree =self.make_branch_and_tree('.')