~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_core.py

  • Committer: Aaron Bentley
  • Date: 2006-03-07 05:59:14 UTC
  • mfrom: (1558.1.20 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 1595.
  • Revision ID: aaron.bentley@utoronto.ca-20060307055914-a88728997afceb90
MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        for tt in (self.this_tt, self.base_tt, self.other_tt):
44
44
            new_file(tt)
45
45
 
46
 
    def merge(self, merge_type=Merge3Merger):
 
46
    def merge(self, merge_type=Merge3Merger, interesting_ids=None):
47
47
        self.base_tt.apply()
48
48
        self.base.commit('base commit')
49
49
        for tt, wt in ((self.this_tt, self.this), (self.other_tt, self.other)):
53
53
            assert len(wt.branch.revision_history()) == 2
54
54
        self.this.branch.fetch(self.other.branch)
55
55
        other_basis = self.other.branch.basis_tree()
56
 
        merger = merge_type(self.this, self.this, self.base, other_basis)
 
56
        merger = merge_type(self.this, self.this, self.base, other_basis, 
 
57
                            interesting_ids=interesting_ids)
57
58
        return merger.cooked_conflicts
58
59
 
59
60
    def list_transforms(self):
192
193
        conflicts = builder.merge()
193
194
        self.assertEqual(conflicts, [('path conflict', '1', 'name3', 'name2')])
194
195
        builder.cleanup()
 
196
 
 
197
    def test_merge_one(self):
 
198
        builder = MergeBuilder()
 
199
        builder.add_file("1", "TREE_ROOT", "name1", "hello1", True)
 
200
        builder.change_contents("1", other="text4")
 
201
        builder.add_file("2", "TREE_ROOT", "name2", "hello1", True)
 
202
        builder.change_contents("2", other="text4")
 
203
        builder.merge(interesting_ids=["1"])
 
204
        self.assertEqual(builder.this.get_file("1").read(), "text4" )
 
205
        self.assertEqual(builder.this.get_file("2").read(), "hello1" )
195
206
        
196
207
    def test_file_moves(self):
197
208
        """Test moves"""