comparison mercurial/dispatch.py @ 31494:faf75a701aca

dispatch: ensure repr is bytes in _mayberepr Fixes command line arguments containing spaces on Python 3.
author Augie Fackler <augie@google.com>
date Sun, 19 Mar 2017 00:22:04 -0400
parents 7e9c7d1d65cb
children bc315e669a32
comparison
equal deleted inserted replaced
31493:7e9c7d1d65cb 31494:faf75a701aca
92 if inst.hint: 92 if inst.hint:
93 write(_("(%s)\n") % inst.hint) 93 write(_("(%s)\n") % inst.hint)
94 94
95 def _mayberepr(a): 95 def _mayberepr(a):
96 if ' ' in a: 96 if ' ' in a:
97 return repr(a) 97 return encoding.strtolocal(repr(a))
98 return a 98 return a
99 99
100 def _formatargs(args): 100 def _formatargs(args):
101 return ' '.join(_mayberepr(a) for a in args) 101 return ' '.join(_mayberepr(a) for a in args)
102 102