equal
deleted
inserted
replaced
35 elif s.startswith('-'): |
35 elif s.startswith('-'): |
36 a.append(s) |
36 a.append(s) |
37 else: |
37 else: |
38 b.append(s[1:]) |
38 b.append(s[1:]) |
39 a.append(s) |
39 a.append(s) |
40 return 0 |
|
41 |
40 |
42 def fixnewline(hunk, a, b): |
41 def fixnewline(hunk, a, b): |
43 """Fix up the last lines of a and b when the patch has no newline at EOF""" |
42 """Fix up the last lines of a and b when the patch has no newline at EOF""" |
44 l = hunk[-1] |
43 l = hunk[-1] |
45 # tolerate CRLF in last line |
44 # tolerate CRLF in last line |
51 if hline.startswith((' ', '+')): |
50 if hline.startswith((' ', '+')): |
52 b[-1] = hline[1:] |
51 b[-1] = hline[1:] |
53 if hline.startswith((' ', '-')): |
52 if hline.startswith((' ', '-')): |
54 a[-1] = hline |
53 a[-1] = hline |
55 hunk[-1] = hline |
54 hunk[-1] = hline |
56 return 0 |
|
57 |
55 |
58 def testhunk(a, b, bstart): |
56 def testhunk(a, b, bstart): |
59 """Compare the lines in a with the lines in b |
57 """Compare the lines in a with the lines in b |
60 |
58 |
61 a is assumed to have a control char at the start of each line, this char |
59 a is assumed to have a control char at the start of each line, this char |