changeset 32847:8016fe56a29e

formatter: open raw template file in binary mode (BC) I believe it was a mistake to open file in text mode. Now '\r' is preserved on Windows, but it should be okay to print '\r\n' as long as users live in such platform.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 06 May 2017 14:47:31 +0900
parents 526f9f12f707
children 470820c2418d
files mercurial/formatter.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/formatter.py	Sat May 06 14:40:22 2017 +0900
+++ b/mercurial/formatter.py	Sat May 06 14:47:31 2017 +0900
@@ -399,7 +399,7 @@
         # is it a mapfile for a style?
         if os.path.basename(tmpl).startswith("map-"):
             return None, os.path.realpath(tmpl)
-        with open(tmpl) as f:
+        with open(tmpl, 'rb') as f:
             tmpl = f.read()
         return tmpl, None