##// END OF EJS Templates
diffhelpers: naming and whitespace cleanup
Yuya Nishihara -
r37588:c4c8d0d1 default
parent child Browse files
Show More
@@ -1372,7 +1372,7 b' class hunk(object):'
1372 def _fixnewline(self, lr):
1372 def _fixnewline(self, lr):
1373 l = lr.readline()
1373 l = lr.readline()
1374 if l.startswith('\ '):
1374 if l.startswith('\ '):
1375 diffhelpers.fix_newline(self.hunk, self.a, self.b)
1375 diffhelpers.fixnewline(self.hunk, self.a, self.b)
1376 else:
1376 else:
1377 lr.push(l)
1377 lr.push(l)
1378
1378
@@ -23,7 +23,7 b' def addlines(fp, hunk, lena, lenb, a, b)'
23 for i in xrange(num):
23 for i in xrange(num):
24 s = fp.readline()
24 s = fp.readline()
25 if s == "\\ No newline at end of file\n":
25 if s == "\\ No newline at end of file\n":
26 fix_newline(hunk, a, b)
26 fixnewline(hunk, a, b)
27 continue
27 continue
28 if s == "\n":
28 if s == "\n":
29 # Some patches may be missing the control char
29 # Some patches may be missing the control char
@@ -39,7 +39,7 b' def addlines(fp, hunk, lena, lenb, a, b)'
39 a.append(s)
39 a.append(s)
40 return 0
40 return 0
41
41
42 def fix_newline(hunk, a, b):
42 def fixnewline(hunk, a, b):
43 """Fix up the last lines of a and b when the patch has no newline at EOF"""
43 """Fix up the last lines of a and b when the patch has no newline at EOF"""
44 l = hunk[-1]
44 l = hunk[-1]
45 # tolerate CRLF in last line
45 # tolerate CRLF in last line
@@ -55,7 +55,6 b' def fix_newline(hunk, a, b):'
55 hunk[-1] = hline
55 hunk[-1] = hline
56 return 0
56 return 0
57
57
58
59 def testhunk(a, b, bstart):
58 def testhunk(a, b, bstart):
60 """Compare the lines in a with the lines in b
59 """Compare the lines in a with the lines in b
61
60
General Comments 0
You need to be logged in to leave comments. Login now