mercurial/crecord.py
changeset 45154 10f48720ef95
parent 45153 8b6a446508c2
child 45682 d2e1dcd4490d
--- a/mercurial/crecord.py	Fri Jul 17 02:31:42 2020 -0700
+++ b/mercurial/crecord.py	Fri Jul 17 03:53:19 2020 -0700
@@ -20,6 +20,7 @@
     open,
 )
 from . import (
+    diffhelper,
     encoding,
     error,
     patch as patchmod,
@@ -416,7 +417,7 @@
         contextlen = (
             len(self.before) + len(self.after) + removedconvertedtocontext
         )
-        if self.after and self.after[-1] == b'\\ No newline at end of file\n':
+        if self.after and self.after[-1] == diffhelper.MISSING_NEWLINE_MARKER:
             contextlen -= 1
         fromlen = contextlen + self.removed
         tolen = contextlen + self.added
@@ -503,7 +504,7 @@
         noeol = False
         for line in self.changedlines:
             text = line.linetext
-            if line.linetext == b'\\ No newline at end of file\n':
+            if line.linetext == diffhelper.MISSING_NEWLINE_MARKER:
                 noeol = True
                 break
             if line.applied: