changeset 14249:f4766e1bb0b3

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.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 07 May 2011 21:12:33 +0200
parents 25c68ac247c1
children 34ec9b313638
files mercurial/cmdutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))