[PATCH] dispatch: don't clamp the range of the exit code twice

Kevin Bullock kbullock+mercurial at ringworld.org
Sun Mar 4 00:09:40 UTC 2018


# HG changeset patch
# User Kevin Bullock <kbullock+mercurial at ringworld.org>
# Date 1520121770 18000
#      Sat Mar 03 19:02:50 2018 -0500
# Node ID 53daf5db6dada7eade4de6d4c328b78feb0425cf
# Parent  c1af0dc644d4c109efee03786aca819a8ac7775c
dispatch: don't clamp the range of the exit code twice

We already limit the range to (0, 255) in the call to sys.exit(). The
duplicated operation can't possibly be hurting us, but let's clean it up
to avoid confusion.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -85,7 +85,7 @@ def run():
     req = request(pycompat.sysargv[1:])
     err = None
     try:
-        status = (dispatch(req) or 0) & 255
+        status = (dispatch(req) or 0)
     except error.StdioError as e:
         err = e
         status = -1


More information about the Mercurial-devel mailing list