~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
211
211
        self.failUnlessExists('sub/a.txt.OTHER')
212
212
        self.failUnlessExists('sub/a.txt.BASE')
213
213
 
 
214
    def test_conflict_leaves_base_this_other_files(self):
 
215
        tree, other = self.create_conflicting_branches()
 
216
        self.run_bzr('merge ../other', working_dir='tree',
 
217
                     retcode=1)
 
218
        self.assertFileEqual('a\nb\nc\n', 'tree/fname.BASE')
 
219
        self.assertFileEqual('a\nB\nD\n', 'tree/fname.OTHER')
 
220
        self.assertFileEqual('a\nB\nC\n', 'tree/fname.THIS')
 
221
 
 
222
    def test_weave_conflict_leaves_base_this_other_files(self):
 
223
        tree, other = self.create_conflicting_branches()
 
224
        self.run_bzr('merge ../other --weave', working_dir='tree',
 
225
                     retcode=1)
 
226
        self.assertFileEqual('a\nb\nc\n', 'tree/fname.BASE')
 
227
        self.assertFileEqual('a\nB\nD\n', 'tree/fname.OTHER')
 
228
        self.assertFileEqual('a\nB\nC\n', 'tree/fname.THIS')
 
229
 
214
230
    def test_merge_remember(self):
215
231
        """Merge changes from one branch to another, test submit location."""
216
232
        tree_a = self.make_branch_and_tree('branch_a')
589
605
        self.run_bzr('merge -d this other -r0..')
590
606
        self.failUnlessExists('this/other_file')
591
607
 
 
608
    def test_merge_interactive_unlocks_branch(self):
 
609
        this = self.make_branch_and_tree('this')
 
610
        other = self.make_branch_and_tree('other')
 
611
        other.commit('empty commit')
 
612
        self.run_bzr('merge -i -d this other')
 
613
        this.lock_write()
 
614
        this.unlock()
 
615
 
 
616
    def test_merge_reversed_revision_range(self):
 
617
        tree = self.make_branch_and_tree(".")
 
618
        for f in ("a", "b"):
 
619
            self.build_tree([f])
 
620
            tree.add(f)
 
621
            tree.commit("added "+f)
 
622
        for context in (".", "", "a"):
 
623
            self.run_bzr("merge -r 1..0 " + context)
 
624
            self.failIfExists("a")
 
625
            tree.revert()
 
626
            self.failUnlessExists("a")
 
627
 
592
628
 
593
629
class TestMergeForce(tests.TestCaseWithTransport):
594
630