comparison mercurial/mdiff.py @ 272:467cea2bf2d8

diff: use tab to separate date from filename -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff: use tab to separate date from filename manifest hash: 73812de990e0e787320c11f7bd83c4ca91a52c4c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCpdDxywK+sNU5EO8RAhKwAKCFcUa/p6ALbjoOl4I8VKJknZtu7gCdFvoE HQn1iq4gnJoeurB7YLMRpqc= =ltYP -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 07 Jun 2005 08:53:05 -0800
parents 4c1d7072d5cd
children 777e388c06d6
comparison
equal deleted inserted replaced
271:35acefbf0ae6 272:467cea2bf2d8
24 l3 = "@@ -1,%d +0,0 @@\n" % len(a) 24 l3 = "@@ -1,%d +0,0 @@\n" % len(a)
25 l = [l1, l2, l3] + ["-" + e for e in a] 25 l = [l1, l2, l3] + ["-" + e for e in a]
26 else: 26 else:
27 a = a.splitlines(1) 27 a = a.splitlines(1)
28 b = b.splitlines(1) 28 b = b.splitlines(1)
29 l = list(difflib.unified_diff(a, b, "a/" + fn, "b/" + fn, ad, bd)) 29 l = list(difflib.unified_diff(a, b, "a/" + fn, "b/" + fn))
30 # difflib uses a space, rather than a tab
31 l[0] = l[0][:-2] + "\t" + ad + "\n"
32 l[1] = l[1][:-2] + "\t" + bd + "\n"
30 33
31 for ln in xrange(len(l)): 34 for ln in xrange(len(l)):
32 if l[ln][-1] != '\n': 35 if l[ln][-1] != '\n':
33 l[ln] += "\n\ No newline at end of file\n" 36 l[ln] += "\n\ No newline at end of file\n"
34 37