changeset 37570:c4c8d0d1267f

diffhelpers: naming and whitespace cleanup
author Yuya Nishihara <yuya@tcha.org>
date Mon, 09 Apr 2018 20:52:54 +0900
parents 2025bf60adb2
children 0ea8b9576d7c
files mercurial/patch.py mercurial/pure/diffhelpers.py
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Mon Apr 09 20:51:23 2018 +0900
+++ b/mercurial/patch.py	Mon Apr 09 20:52:54 2018 +0900
@@ -1372,7 +1372,7 @@
     def _fixnewline(self, lr):
         l = lr.readline()
         if l.startswith('\ '):
-            diffhelpers.fix_newline(self.hunk, self.a, self.b)
+            diffhelpers.fixnewline(self.hunk, self.a, self.b)
         else:
             lr.push(l)
 
--- a/mercurial/pure/diffhelpers.py	Mon Apr 09 20:51:23 2018 +0900
+++ b/mercurial/pure/diffhelpers.py	Mon Apr 09 20:52:54 2018 +0900
@@ -23,7 +23,7 @@
         for i in xrange(num):
             s = fp.readline()
             if s == "\\ No newline at end of file\n":
-                fix_newline(hunk, a, b)
+                fixnewline(hunk, a, b)
                 continue
             if s == "\n":
                 # Some patches may be missing the control char
@@ -39,7 +39,7 @@
                 a.append(s)
     return 0
 
-def fix_newline(hunk, a, b):
+def fixnewline(hunk, a, b):
     """Fix up the last lines of a and b when the patch has no newline at EOF"""
     l = hunk[-1]
     # tolerate CRLF in last line
@@ -55,7 +55,6 @@
     hunk[-1] = hline
     return 0
 
-
 def testhunk(a, b, bstart):
     """Compare the lines in a with the lines in b