~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_core.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-05 04:18:29 UTC
  • mfrom: (1551.8.40 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20061005041829-4f10f01c0c5ba3ac
Fix diff3 merges to not indicate conflicts on clean merges

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
            new_inventory[file_id] = path
165
165
        return new_inventory
166
166
 
167
 
    def cleanup(self):
 
167
    def unlock(self):
168
168
        self.base.unlock()
169
169
        self.this.unlock()
170
170
        self.other.unlock()
 
171
 
 
172
    def cleanup(self):
 
173
        self.unlock()
171
174
        rmtree(self.dir)
172
175
 
173
176
 
283
286
        builder.add_file("5", "TREE_ROOT", "name7", "a\nb\nc\nd\ne\nf\n", True)
284
287
        builder.change_contents("5", other="a\nz\nc\nd\ne\nf\n", 
285
288
                                     this="a\nb\nc\nd\ne\nz\n")
286
 
        builder.merge(merge_factory)
287
 
        self.assertEqual(builder.this.get_file("1").read(), "text4" )
288
 
        self.assertEqual(builder.this.get_file("2").read(), "text2" )
289
 
        self.assertEqual(builder.this.get_file("5").read(), 
290
 
                         "a\nz\nc\nd\ne\nz\n")
291
 
        self.assertIs(builder.this.is_executable("1"), True)
292
 
        self.assertIs(builder.this.is_executable("2"), False)
293
 
        self.assertIs(builder.this.is_executable("3"), True)
 
289
        conflicts = builder.merge(merge_factory)
 
290
        try:
 
291
            self.assertEqual([], conflicts)
 
292
            self.assertEqual("text4", builder.this.get_file("1").read())
 
293
            self.assertEqual("text2", builder.this.get_file("2").read())
 
294
            self.assertEqual("a\nz\nc\nd\ne\nz\n", 
 
295
                             builder.this.get_file("5").read())
 
296
            self.assertTrue(builder.this.is_executable("1"))
 
297
            self.assertFalse(builder.this.is_executable("2"))
 
298
            self.assertTrue(builder.this.is_executable("3"))
 
299
        except:
 
300
            builder.unlock()
 
301
            raise
294
302
        return builder
295
303
 
296
304
    def contents_test_conflicts(self, merge_factory):