--- a/hgext/eol.py Sat Jun 16 17:36:44 2018 +0900
+++ b/hgext/eol.py Sat Jun 16 17:53:51 2018 +0900
@@ -142,7 +142,7 @@
if ui.configbool('eol', 'only-consistent') and inconsistenteol(s):
return s
if (ui.configbool('eol', 'fix-trailing-newline')
- and s and s[-1] != '\n'):
+ and s and not s.endswith('\n')):
s = s + '\n'
return util.tolf(s)
@@ -153,7 +153,7 @@
if ui.configbool('eol', 'only-consistent') and inconsistenteol(s):
return s
if (ui.configbool('eol', 'fix-trailing-newline')
- and s and s[-1] != '\n'):
+ and s and not s.endswith('\n')):
s = s + '\n'
return util.tocrlf(s)