~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

merge 2.0 branch rev 4647

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
 
375
375
    def test_directive_cherrypick(self):
376
376
        source = self.make_branch_and_tree('source')
 
377
        source.commit("nothing")
 
378
        # see https://bugs.edge.launchpad.net/bzr/+bug/409688 - trying to
 
379
        # cherrypick from one branch into another unrelated branch with a
 
380
        # different root id will give shape conflicts.  as a workaround we
 
381
        # make sure they share the same root id.
 
382
        target = source.bzrdir.sprout('target').open_workingtree()
377
383
        self.build_tree(['source/a'])
378
384
        source.add('a')
379
385
        source.commit('Added a', rev_id='rev1')
380
386
        self.build_tree(['source/b'])
381
387
        source.add('b')
382
388
        source.commit('Added b', rev_id='rev2')
383
 
        target = self.make_branch_and_tree('target')
384
389
        target.commit('empty commit')
385
390
        self.write_directive('directive', source.branch, 'target', 'rev2',
386
391
                             'rev1')
582
587
        self.addCleanup(this_tree.unlock)
583
588
        self.assertEqual([],
584
589
                         list(this_tree.iter_changes(this_tree.basis_tree())))
 
590
 
 
591
    def test_merge_missing_second_revision_spec(self):
 
592
        """Merge uses branch basis when the second revision is unspecified."""
 
593
        this = self.make_branch_and_tree('this')
 
594
        this.commit('rev1')
 
595
        other = self.make_branch_and_tree('other')
 
596
        self.build_tree(['other/other_file'])
 
597
        other.add('other_file')
 
598
        other.commit('rev1b')
 
599
        self.run_bzr('merge -d this other -r0..')
 
600
        self.failUnlessExists('this/other_file')