diff mercurial/scmutil.py @ 46485:768056549737

errors: use exit code 40 for when a hook fails A hook can be used for checking inputs, state, configuration, security, etc., so it's unclear which of the existing exit codes to use. Let's instead add one specifically for failed hooks. I picked 40. Differential Revision: https://phab.mercurial-scm.org/D9910
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 29 Jan 2021 12:16:55 -0800
parents cb12658bf0e1
children aa2e38147e8b
line wrap: on
line diff
--- a/mercurial/scmutil.py	Fri Jan 29 12:50:10 2021 -0500
+++ b/mercurial/scmutil.py	Fri Jan 29 12:16:55 2021 -0800
@@ -229,6 +229,8 @@
             detailed_exit_code = 20
         elif isinstance(inst, error.ConfigError):
             detailed_exit_code = 30
+        elif isinstance(inst, error.HookAbort):
+            detailed_exit_code = 40
         elif isinstance(inst, error.SecurityError):
             detailed_exit_code = 150
         elif isinstance(inst, error.CanceledError):