--- 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