diff mercurial/mdiff.py @ 31720:6c80f985a13c

diff: slice over bytes to make sure conditions work normally Both of this are part of generating `hg diff` on python 3.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 26 Mar 2017 20:52:51 +0530
parents a7acda2de4b8
children ca3b4a2b7e54
line wrap: on
line diff
--- a/mercurial/mdiff.py	Wed Mar 29 20:19:26 2017 -0700
+++ b/mercurial/mdiff.py	Sun Mar 26 20:52:51 2017 +0530
@@ -229,7 +229,7 @@
 
     def checknonewline(lines):
         for text in lines:
-            if text[-1] != '\n':
+            if text[-1:] != '\n':
                 text += "\n\ No newline at end of file\n"
             yield text