~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: 2009-11-13 19:19:11 UTC
  • mto: This revision was merged to the branch mainline in revision 4799.
  • Revision ID: john@arbash-meinel.com-20091113191911-nokhxxx8mllrrl6x
Intern the various strings that are part of the CHKInventory deserialization.

file_ids and revision_ids, in particular, are quite often repeated, so try to keep
a single copy of them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007 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
 
 
230
214
    def test_merge_remember(self):
231
215
        """Merge changes from one branch to another, test submit location."""
232
216
        tree_a = self.make_branch_and_tree('branch_a')
605
589
        self.run_bzr('merge -d this other -r0..')
606
590
        self.failUnlessExists('this/other_file')
607
591
 
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
 
 
628
592
 
629
593
class TestMergeForce(tests.TestCaseWithTransport):
630
594