~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: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        self.failIfExists('bar')
90
90
        wt2 = WorkingTree.open('.') # opens branch2
91
91
        self.assertEqual([tip], wt2.get_parent_ids())
92
 
        
 
92
 
93
93
    def test_pending_with_null(self):
94
94
        """When base is forced to revno 0, parent_ids are set"""
95
95
        wt2 = self.test_unrelated()
96
96
        wt1 = WorkingTree.open('.')
97
97
        br1 = wt1.branch
98
98
        br1.fetch(wt2.branch)
99
 
        # merge all of branch 2 into branch 1 even though they 
 
99
        # merge all of branch 2 into branch 1 even though they
100
100
        # are not related.
101
101
        wt1.merge_from_branch(wt2.branch, wt2.last_revision(), 'null:')
102
102
        self.assertEqual([br1.last_revision(), wt2.branch.last_revision()],
150
150
        self.addCleanup(tree_b.unlock)
151
151
        tree_a.commit(message="hello again")
152
152
        log = StringIO()
153
 
        merge_inner(tree_b.branch, tree_a, tree_b.basis_tree(), 
 
153
        merge_inner(tree_b.branch, tree_a, tree_b.basis_tree(),
154
154
                    this_tree=tree_b, ignore_zero=True)
155
155
        log = self._get_log(keep_log_file=True)
156
156
        self.failUnless('All changes applied successfully.\n' not in log)
157
157
        tree_b.revert()
158
 
        merge_inner(tree_b.branch, tree_a, tree_b.basis_tree(), 
 
158
        merge_inner(tree_b.branch, tree_a, tree_b.basis_tree(),
159
159
                    this_tree=tree_b, ignore_zero=False)
160
160
        log = self._get_log(keep_log_file=True)
161
161
        self.failUnless('All changes applied successfully.\n' in log)
248
248
        self.assertEqual(tree_b.conflicts(),
249
249
                         [conflicts.ContentsConflict('file',
250
250
                          file_id='file-id')])
251
 
    
 
251
 
252
252
    def test_merge_type_registry(self):
253
253
        merge_type_option = option.Option.OPTIONS['merge-type']
254
 
        self.assertFalse('merge4' in [x[0] for x in 
 
254
        self.assertFalse('merge4' in [x[0] for x in
255
255
                        merge_type_option.iter_switches()])
256
256
        registry = _mod_merge.get_merge_type_registry()
257
257
        registry.register_lazy('merge4', 'bzrlib.merge', 'Merge4Merger',
258
258
                               'time-travelling merge')
259
 
        self.assertTrue('merge4' in [x[0] for x in 
 
259
        self.assertTrue('merge4' in [x[0] for x in
260
260
                        merge_type_option.iter_switches()])
261
261
        registry.remove('merge4')
262
 
        self.assertFalse('merge4' in [x[0] for x in 
 
262
        self.assertFalse('merge4' in [x[0] for x in
263
263
                        merge_type_option.iter_switches()])
264
264
 
265
265
    def test_merge_other_moves_we_deleted(self):
718
718
 
719
719
    def test_plan_merge_insert_order(self):
720
720
        """Weave merges are sensitive to the order of insertion.
721
 
        
 
721
 
722
722
        Specifically for overlapping regions, it effects which region gets put
723
723
        'first'. And when a user resolves an overlapping merge, if they use the
724
724
        same ordering, then the lines match the parents, if they don't only