comparison mercurial/hg.py @ 17900:47fb48060e36 stable

openpath: specify binary mode and use util.posixfile follow-up to 0e2846b2482c
author Adrian Buehlmann <adrian@cadifra.com>
date Thu, 01 Nov 2012 13:46:03 +0100
parents 17c030014ddf
children 7f5dab94e48c
comparison
equal deleted inserted replaced
17899:e0f63ac6fcf3 17900:47fb48060e36
90 return repo.local() 90 return repo.local()
91 91
92 def openpath(ui, path): 92 def openpath(ui, path):
93 '''open path with open if local, url.open if remote''' 93 '''open path with open if local, url.open if remote'''
94 if islocal(path): 94 if islocal(path):
95 return open(util.urllocalpath(path)) 95 return util.posixfile(util.urllocalpath(path), 'rb')
96 else: 96 else:
97 return url.open(ui, path) 97 return url.open(ui, path)
98 98
99 def _peerorrepo(ui, path, create=False): 99 def _peerorrepo(ui, path, create=False):
100 """return a repository object for the specified path""" 100 """return a repository object for the specified path"""