comparison mercurial/wireprotov1server.py @ 45885:600aec73f309

errors: format "abort: " text in a new Abort.format() method This remove some duplication we had. Differential Revision: https://phab.mercurial-scm.org/D9348
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 20 Nov 2020 09:17:38 -0800
parents 80f32ec8653a
children 89a2afe31e82
comparison
equal deleted inserted replaced
45884:98399dd1b96c 45885:600aec73f309
683 except error.Abort as exc: 683 except error.Abort as exc:
684 # The old code we moved used procutil.stderr directly. 684 # The old code we moved used procutil.stderr directly.
685 # We did not change it to minimise code change. 685 # We did not change it to minimise code change.
686 # This need to be moved to something proper. 686 # This need to be moved to something proper.
687 # Feel free to do it. 687 # Feel free to do it.
688 procutil.stderr.write(b"abort: %s\n" % exc.message) 688 procutil.stderr.write(exc.format())
689 if exc.hint is not None:
690 procutil.stderr.write(b"(%s)\n" % exc.hint)
691 procutil.stderr.flush() 689 procutil.stderr.flush()
692 return wireprototypes.pushres( 690 return wireprototypes.pushres(
693 0, output.getvalue() if output else b'' 691 0, output.getvalue() if output else b''
694 ) 692 )
695 except error.PushRaced: 693 except error.PushRaced: