comparison mercurial/debugcommands.py @ 37322:a67fd1fe5109

stringutil: drop escapedata() in favor of escapestr() They are quite similar. Let's choose one that uses standard Python escape.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Apr 2018 23:26:49 +0900
parents 2f859ad7ed8c
children e32dfff71529
comparison
equal deleted inserted replaced
37321:e826fe7a08c7 37322:a67fd1fe5109
2962 if 'PUSHFILE' in args: 2962 if 'PUSHFILE' in args:
2963 with open(args['PUSHFILE'], r'rb') as fh: 2963 with open(args['PUSHFILE'], r'rb') as fh:
2964 del args['PUSHFILE'] 2964 del args['PUSHFILE']
2965 res, output = peer._callpush(command, fh, 2965 res, output = peer._callpush(command, fh,
2966 **pycompat.strkwargs(args)) 2966 **pycompat.strkwargs(args))
2967 ui.status(_('result: %s\n') % stringutil.escapedata(res)) 2967 ui.status(_('result: %s\n') % stringutil.escapestr(res))
2968 ui.status(_('remote output: %s\n') % 2968 ui.status(_('remote output: %s\n') %
2969 stringutil.escapedata(output)) 2969 stringutil.escapestr(output))
2970 else: 2970 else:
2971 res = peer._call(command, **pycompat.strkwargs(args)) 2971 res = peer._call(command, **pycompat.strkwargs(args))
2972 ui.status(_('response: %s\n') % stringutil.pprint(res)) 2972 ui.status(_('response: %s\n') % stringutil.pprint(res))
2973 2973
2974 elif action == 'batchbegin': 2974 elif action == 'batchbegin':
2982 # to bypass this layer and normalize to commands + args. 2982 # to bypass this layer and normalize to commands + args.
2983 ui.status(_('sending batch with %d sub-commands\n') % 2983 ui.status(_('sending batch with %d sub-commands\n') %
2984 len(batchedcommands)) 2984 len(batchedcommands))
2985 for i, chunk in enumerate(peer._submitbatch(batchedcommands)): 2985 for i, chunk in enumerate(peer._submitbatch(batchedcommands)):
2986 ui.status(_('response #%d: %s\n') % 2986 ui.status(_('response #%d: %s\n') %
2987 (i, stringutil.escapedata(chunk))) 2987 (i, stringutil.escapestr(chunk)))
2988 2988
2989 batchedcommands = None 2989 batchedcommands = None
2990 2990
2991 elif action.startswith('httprequest '): 2991 elif action.startswith('httprequest '):
2992 if not opener: 2992 if not opener: