[PATCH 3 of 8] formatter: open raw template file in posix semantics

Yuya Nishihara yuya at tcha.org
Wed Jun 14 09:40:34 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1494049727 -32400
#      Sat May 06 14:48:47 2017 +0900
# Node ID b1c1aab629501208e0b84b2c604328eea4311d4c
# Parent  4642ef5a653b3daa3db1121e8bdd1351b98b28fc
formatter: open raw template file in posix semantics

This should have no effect, but seems good for code consistency.

diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -399,7 +399,7 @@ def lookuptemplate(ui, topic, tmpl):
         # is it a mapfile for a style?
         if os.path.basename(tmpl).startswith("map-"):
             return None, os.path.realpath(tmpl)
-        with open(tmpl, 'rb') as f:
+        with util.posixfile(tmpl, 'rb') as f:
             tmpl = f.read()
         return tmpl, None
 


More information about the Mercurial-devel mailing list