~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: John Arbash Meinel
  • Date: 2008-03-15 13:51:09 UTC
  • mfrom: (3280 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3281.
  • Revision ID: john@arbash-meinel.com-20080315135109-7v9gimdidd1s7llr
[merge] bzr.dev 3280

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
        merger.merge_type = _mod_merge.Merge3Merger
353
353
        merger.do_merge()
354
354
 
 
355
    def test_merge3_will_detect_cherrypick(self):
 
356
        this_tree = self.make_branch_and_tree('this')
 
357
        self.build_tree_contents([('this/file', "a\n")])
 
358
        this_tree.add('file')
 
359
        this_tree.commit('rev1')
 
360
        other_tree = this_tree.bzrdir.sprout('other').open_workingtree()
 
361
        self.build_tree_contents([('other/file', "a\nb\n")])
 
362
        other_tree.commit('rev2b', rev_id='rev2b')
 
363
        self.build_tree_contents([('other/file', "a\nb\nc\n")])
 
364
        other_tree.commit('rev3b', rev_id='rev3b')
 
365
        this_tree.lock_write()
 
366
        self.addCleanup(this_tree.unlock)
 
367
 
 
368
        merger = _mod_merge.Merger.from_revision_ids(progress.DummyProgress(),
 
369
            this_tree, 'rev3b', 'rev2b', other_tree.branch)
 
370
        merger.merge_type = _mod_merge.Merge3Merger
 
371
        merger.do_merge()
 
372
        self.assertFileEqual('a\n'
 
373
                             '<<<<<<< TREE\n'
 
374
                             '=======\n'
 
375
                             'c\n'
 
376
                             '>>>>>>> MERGE-SOURCE\n',
 
377
                             'this/file')
 
378
 
355
379
    def test_make_merger(self):
356
380
        this_tree = self.make_branch_and_tree('this')
357
381
        this_tree.commit('rev1', rev_id='rev1')