~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-12-09 20:58:03 UTC
  • mto: This revision was merged to the branch mainline in revision 3133.
  • Revision ID: aaron.bentley@utoronto.ca-20071209205803-9puidarg2y33bpzj
Get cherrypick-on-weave working

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
        merger.do_merge()
289
289
        self.assertEqual(tree_a.get_parent_ids(), [tree_b.last_revision()])
290
290
 
 
291
    def test_weave_cherrypick(self):
 
292
        this_tree = self.make_branch_and_tree('this')
 
293
        self.build_tree_contents([('this/file', "a\n")])
 
294
        this_tree.add('file')
 
295
        this_tree.commit('rev1')
 
296
        other_tree = this_tree.bzrdir.sprout('other').open_workingtree()
 
297
        self.build_tree_contents([('other/file', "a\nb\n")])
 
298
        other_tree.commit('rev2b', rev_id='rev2b')
 
299
        self.build_tree_contents([('other/file', "c\na\nb\n")])
 
300
        other_tree.commit('rev3b', rev_id='rev3b')
 
301
        this_tree.lock_write()
 
302
        self.addCleanup(this_tree.unlock)
 
303
        merger = _mod_merge.Merger.from_revision_ids(progress.DummyProgress(),
 
304
            this_tree, 'rev3b', 'rev2b', other_tree.branch)
 
305
        merger.merge_type = _mod_merge.WeaveMerger
 
306
        merger.do_merge()
 
307
        self.assertFileEqual('c\na\n', 'this/file')
 
308
 
291
309
 
292
310
class TestPlanMerge(TestCaseWithMemoryTransport):
293
311