Mercurial > hg
comparison mercurial/dispatch.py @ 48186:6edc8800dbc3
dispatch: use detailed exit code 250 for keyboard interrupt
Among our users at Google, we're still seeing several percent of
commands fail with exit code 255. I suspect keyboard interrupts is an
important remaining reason.
This is a resend of D10086 with some fixes for pager handling added
ahead of it.
Differential Revision: https://phab.mercurial-scm.org/D11628
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 02 Mar 2021 09:33:25 -0800 |
parents | 2f2107c01dee |
children | 8c34edb1ad10 |
comparison
equal
deleted
inserted
replaced
48185:2f2107c01dee | 48186:6edc8800dbc3 |
---|---|
314 # SIGPIPE was raised. we cannot print anything in this case. | 314 # SIGPIPE was raised. we cannot print anything in this case. |
315 pass | 315 pass |
316 except IOError as inst: | 316 except IOError as inst: |
317 if inst.errno != errno.EPIPE: | 317 if inst.errno != errno.EPIPE: |
318 raise | 318 raise |
319 ret = -1 | 319 if req.ui.configbool(b'ui', b'detailed-exit-code'): |
320 ret = 250 | |
321 else: | |
322 ret = -1 | |
320 finally: | 323 finally: |
321 duration = util.timer() - starttime | 324 duration = util.timer() - starttime |
322 try: | 325 try: |
323 req.ui.flush() # record blocked times | 326 req.ui.flush() # record blocked times |
324 except BaseException: | 327 except BaseException: |