Show More
@@ -18,16 +18,22 b' def unidiff(a, ad, b, bd, fn, r=None, te' | |||
|
18 | 18 | |
|
19 | 19 | if not text and (util.binary(a) or util.binary(b)): |
|
20 | 20 | l = ['Binary file %s has changed\n' % fn] |
|
21 |
elif a |
|
|
21 | elif not a: | |
|
22 | 22 | b = b.splitlines(1) |
|
23 | l1 = "--- %s\t%s\n" % ("/dev/null", epoch) | |
|
23 | if a is None: | |
|
24 | l1 = "--- %s\t%s\n" % ("/dev/null", epoch) | |
|
25 | else: | |
|
26 | l1 = "--- %s\t%s\n" % ("a/" + fn, ad) | |
|
24 | 27 | l2 = "+++ %s\t%s\n" % ("b/" + fn, bd) |
|
25 | 28 | l3 = "@@ -0,0 +1,%d @@\n" % len(b) |
|
26 | 29 | l = [l1, l2, l3] + ["+" + e for e in b] |
|
27 |
elif b |
|
|
30 | elif not b: | |
|
28 | 31 | a = a.splitlines(1) |
|
29 | 32 | l1 = "--- %s\t%s\n" % ("a/" + fn, ad) |
|
30 | l2 = "+++ %s\t%s\n" % ("/dev/null", epoch) | |
|
33 | if b is None: | |
|
34 | l2 = "+++ %s\t%s\n" % ("/dev/null", epoch) | |
|
35 | else: | |
|
36 | l2 = "+++ %s\t%s\n" % ("b/" + fn, bd) | |
|
31 | 37 | l3 = "@@ -1,%d +0,0 @@\n" % len(a) |
|
32 | 38 | l = [l1, l2, l3] + ["-" + e for e in a] |
|
33 | 39 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now