mercurial/patch.py
branchstable
changeset 37803 72f6498c040b
parent 37764 5e67c20915a7
child 38048 b403e87df069
--- a/mercurial/patch.py	Thu Apr 19 23:33:17 2018 +0900
+++ b/mercurial/patch.py	Fri Apr 20 20:48:10 2018 +0900
@@ -28,7 +28,7 @@
 )
 from . import (
     copies,
-    diffhelpers,
+    diffhelper,
     encoding,
     error,
     mail,
@@ -800,7 +800,7 @@
         # if there's skew we want to emit the "(offset %d lines)" even
         # when the hunk cleanly applies at start + skew, so skip the
         # fast case code
-        if self.skew == 0 and diffhelpers.testhunk(old, self.lines, oldstart):
+        if self.skew == 0 and diffhelper.testhunk(old, self.lines, oldstart):
             if self.remove:
                 self.backend.unlink(self.fname)
             else:
@@ -827,7 +827,7 @@
                     cand = [oldstart]
 
                 for l in cand:
-                    if not old or diffhelpers.testhunk(old, self.lines, l):
+                    if not old or diffhelper.testhunk(old, self.lines, l):
                         self.lines[l : l + len(old)] = new
                         self.offset += len(new) - len(old)
                         self.skew = l - orig_start
@@ -1259,8 +1259,8 @@
         self.starta = int(self.starta)
         self.startb = int(self.startb)
         try:
-            diffhelpers.addlines(lr, self.hunk, self.lena, self.lenb,
-                                 self.a, self.b)
+            diffhelper.addlines(lr, self.hunk, self.lena, self.lenb,
+                                self.a, self.b)
         except error.ParseError as e:
             raise PatchError(_("bad hunk #%d: %s") % (self.number, e))
         # if we hit eof before finishing out the hunk, the last line will
@@ -1379,7 +1379,7 @@
     def _fixnewline(self, lr):
         l = lr.readline()
         if l.startswith('\ '):
-            diffhelpers.fixnewline(self.hunk, self.a, self.b)
+            diffhelper.fixnewline(self.hunk, self.a, self.b)
         else:
             lr.push(l)