cmdutil: normalize log message eols when reading from file
authorPatrick Mezard <pmezard@gmail.com>
Sat, 07 May 2011 21:12:33 +0200
changeset 14249 f4766e1bb0b3
parent 14248 25c68ac247c1
child 14250 34ec9b313638
cmdutil: normalize log message eols when reading from file This will be necessary once util.readfile() operates in binary mode. While changelog.add() already normalizes the message, doing so in logmessage() is required as ui.edit() or others expect messages with LF only.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat May 07 21:12:30 2011 +0200
+++ b/mercurial/cmdutil.py	Sat May 07 21:12:33 2011 +0200
@@ -91,7 +91,7 @@
             if logfile == '-':
                 message = sys.stdin.read()
             else:
-                message = util.readfile(logfile)
+                message = '\n'.join(util.readfile(logfile).splitlines())
         except IOError, inst:
             raise util.Abort(_("can't read commit message '%s': %s") %
                              (logfile, inst.strerror))