/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2009-09-09 15:43:52 UTC
  • mfrom: (4672.3.4 merge-strict)
  • mto: This revision was merged to the branch mainline in revision 4682.
  • Revision ID: v.ladeuil+lp@free.fr-20090909154352-zmyiya46nukx3vu7
Handle pending merges as uncommitted changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    branch,
26
26
    bzrdir,
27
27
    conflicts,
 
28
    errors,
28
29
    merge_directive,
29
30
    osutils,
30
31
    tests,
591
592
 
592
593
class TestMergeForce(tests.TestCaseWithTransport):
593
594
 
594
 
    def test_merge_force(self):
595
 
        tree_a = self.make_branch_and_tree('a')
 
595
    def setUp(self):
 
596
        super(TestMergeForce, self).setUp()
 
597
        self.tree_a = self.make_branch_and_tree('a')
596
598
        self.build_tree(['a/foo'])
597
 
        tree_a.add(['foo'])
598
 
        tree_a.commit('add file')
599
 
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
 
599
        self.tree_a.add(['foo'])
 
600
        self.tree_a.commit('add file')
 
601
        self.tree_b = self.tree_a.bzrdir.sprout('b').open_workingtree()
600
602
        self.build_tree_contents([('a/foo', 'change 1')])
601
 
        tree_a.commit('change file')
602
 
        tree_b.merge_from_branch(tree_a.branch)
603
 
        tree_a.commit('empty change to allow merge to run')
 
603
        self.tree_a.commit('change file')
 
604
        self.tree_b.merge_from_branch(self.tree_a.branch)
 
605
 
 
606
    def test_merge_force(self):
 
607
        self.tree_a.commit('empty change to allow merge to run')
 
608
        # Second merge on top if the uncommitted one
604
609
        self.run_bzr(['merge', '../a', '--force'], working_dir='b')
605
610
 
606
611
 
 
612
    def test_merge_with_uncommitted_changes(self):
 
613
        self.run_bzr_error(['Working tree .* has uncommitted changes'],
 
614
                           ['merge', '../a'], working_dir='b')
 
615
 
 
616
    def test_merge_with_pending_merges(self):
 
617
        # Revert the changes keeping the pending merge
 
618
        self.run_bzr(['revert', 'b'])
 
619
        self.run_bzr_error(['Working tree .* has uncommitted changes'],
 
620
                           ['merge', '../a'], working_dir='b')