dispatch: exit with 8-bit exit code
The exit code returned from a program to the shell is unsigned 8-bit, but
Mercurial would sometimes try to exit with negative numbers or None. sys.exit
on Unix will convert that to 8-bit exit codes, but on Windows negative values
showed up as 0.
The exit code is now explicitly converted to unsigned 8-bit.
--- a/mercurial/dispatch.py Mon Nov 07 03:14:53 2011 +0100
+++ b/mercurial/dispatch.py Mon Nov 07 03:14:53 2011 +0100
@@ -24,7 +24,7 @@
def run():
"run the command in sys.argv"
- sys.exit(dispatch(request(sys.argv[1:])))
+ sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
def dispatch(req):
"run the command specified in req.args"