mercurial/diffhelper.py
changeset 45154 10f48720ef95
parent 43077 687b865b95ad
child 46819 d4ba4d51f85f
--- a/mercurial/diffhelper.py	Fri Jul 17 02:31:42 2020 -0700
+++ b/mercurial/diffhelper.py	Fri Jul 17 03:53:19 2020 -0700
@@ -14,6 +14,8 @@
     pycompat,
 )
 
+MISSING_NEWLINE_MARKER = b'\\ No newline at end of file\n'
+
 
 def addlines(fp, hunk, lena, lenb, a, b):
     """Read lines from fp into the hunk
@@ -32,7 +34,7 @@
             s = fp.readline()
             if not s:
                 raise error.ParseError(_(b'incomplete hunk'))
-            if s == b"\\ No newline at end of file\n":
+            if s == MISSING_NEWLINE_MARKER:
                 fixnewline(hunk, a, b)
                 continue
             if s == b'\n' or s == b'\r\n':