comparison mercurial/formatter.py @ 32830:470820c2418d

formatter: open raw template file in posix semantics This should have no effect, but seems good for code consistency.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 06 May 2017 14:48:47 +0900
parents 8016fe56a29e
children 11e667a8fcba
comparison
equal deleted inserted replaced
32829:8016fe56a29e 32830:470820c2418d
397 # perhaps it's a path to a map or a template 397 # perhaps it's a path to a map or a template
398 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl): 398 if ('/' in tmpl or '\\' in tmpl) and os.path.isfile(tmpl):
399 # is it a mapfile for a style? 399 # is it a mapfile for a style?
400 if os.path.basename(tmpl).startswith("map-"): 400 if os.path.basename(tmpl).startswith("map-"):
401 return None, os.path.realpath(tmpl) 401 return None, os.path.realpath(tmpl)
402 with open(tmpl, 'rb') as f: 402 with util.posixfile(tmpl, 'rb') as f:
403 tmpl = f.read() 403 tmpl = f.read()
404 return tmpl, None 404 return tmpl, None
405 405
406 # constant string? 406 # constant string?
407 return tmpl, None 407 return tmpl, None