Show More
@@ -240,9 +240,7 b' def unidiff(a, ad, b, bd, fn1, fn2, opts' | |||||
240 | l3 = "@@ -1,%d +0,0 @@\n" % len(a) |
|
240 | l3 = "@@ -1,%d +0,0 @@\n" % len(a) | |
241 | l = [l1, l2, l3] + ["-" + e for e in a] |
|
241 | l = [l1, l2, l3] + ["-" + e for e in a] | |
242 | else: |
|
242 | else: | |
243 | al = splitnewlines(a) |
|
243 | l = list(_unidiff(a, b, opts=opts)) | |
244 | bl = splitnewlines(b) |
|
|||
245 | l = list(_unidiff(a, b, al, bl, opts=opts)) |
|
|||
246 | if not l: |
|
244 | if not l: | |
247 | return "" |
|
245 | return "" | |
248 |
|
246 | |||
@@ -257,8 +255,9 b' def unidiff(a, ad, b, bd, fn1, fn2, opts' | |||||
257 |
|
255 | |||
258 | # creates a headerless unified diff |
|
256 | # creates a headerless unified diff | |
259 | # t1 and t2 are the text to be diffed |
|
257 | # t1 and t2 are the text to be diffed | |
260 | # l1 and l2 are the text broken up into lines |
|
258 | def _unidiff(t1, t2, opts=defaultopts): | |
261 | def _unidiff(t1, t2, l1, l2, opts=defaultopts): |
|
259 | l1 = splitnewlines(t1) | |
|
260 | l2 = splitnewlines(t2) | |||
262 | def contextend(l, len): |
|
261 | def contextend(l, len): | |
263 | ret = l + opts.context |
|
262 | ret = l + opts.context | |
264 | if ret > len: |
|
263 | if ret > len: |
General Comments 0
You need to be logged in to leave comments.
Login now