comparison mercurial/scmutil.py @ 41420:b6673e9bdcf6

dispatch: quote filename in IOError as well It's explicitly added for OSError at 720308f741cb "dispatch: show empty filename in OSError aborts". Let's do the same for IOError.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Jan 2019 17:51:55 +0900
parents b5169e79c31c
children f83b230b7fb3
comparison
equal deleted inserted replaced
41419:b5169e79c31c 41420:b6673e9bdcf6
246 ui.error(_("abort: error: %s\n") % reason) 246 ui.error(_("abort: error: %s\n") % reason)
247 elif (util.safehasattr(inst, "args") 247 elif (util.safehasattr(inst, "args")
248 and inst.args and inst.args[0] == errno.EPIPE): 248 and inst.args and inst.args[0] == errno.EPIPE):
249 pass 249 pass
250 elif getattr(inst, "strerror", None): # common IOError 250 elif getattr(inst, "strerror", None): # common IOError
251 if getattr(inst, "filename", None): 251 if getattr(inst, "filename", None) is not None:
252 ui.error(_("abort: %s: %s\n") % ( 252 ui.error(_("abort: %s: '%s'\n") % (
253 encoding.strtolocal(inst.strerror), 253 encoding.strtolocal(inst.strerror),
254 stringutil.forcebytestr(inst.filename))) 254 stringutil.forcebytestr(inst.filename)))
255 else: 255 else:
256 ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror)) 256 ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror))
257 else: # suspicious IOError 257 else: # suspicious IOError