498
498
self.assertContainsRe(diff, r"--- a/%s" % (omega_utf8,))
499
499
self.assertContainsRe(diff, r"\+\+\+ b/%s" % (omega_utf8,))
501
def test_unicode_filename(self):
502
"""Test when the filename are unicode."""
503
self.requireFeature(UnicodeFilename)
505
alpha, omega = u'\u03b1', u'\u03c9'
506
autf8, outf8 = alpha.encode('utf8'), omega.encode('utf8')
508
tree = self.make_branch_and_tree('tree')
509
self.build_tree_contents([('tree/ren_'+alpha, 'contents\n')])
510
tree.add(['ren_'+alpha], ['file-id-2'])
511
self.build_tree_contents([('tree/del_'+alpha, 'contents\n')])
512
tree.add(['del_'+alpha], ['file-id-3'])
513
self.build_tree_contents([('tree/mod_'+alpha, 'contents\n')])
514
tree.add(['mod_'+alpha], ['file-id-4'])
516
tree.commit('one', rev_id='rev-1')
518
tree.rename_one('ren_'+alpha, 'ren_'+omega)
519
tree.remove('del_'+alpha)
520
self.build_tree_contents([('tree/add_'+alpha, 'contents\n')])
521
tree.add(['add_'+alpha], ['file-id'])
522
self.build_tree_contents([('tree/mod_'+alpha, 'contents_mod\n')])
524
diff = self.get_diff(tree.basis_tree(), tree)
525
self.assertContainsRe(diff,
526
"=== renamed file 'ren_%s' => 'ren_%s'\n"%(autf8, outf8))
527
self.assertContainsRe(diff, "=== added file 'add_%s'"%autf8)
528
self.assertContainsRe(diff, "=== modified file 'mod_%s'"%autf8)
529
self.assertContainsRe(diff, "=== removed file 'del_%s'"%autf8)
531
502
class TestPatienceDiffLib(TestCase):