[issue664] hg process may exit with an apparently-zero status on failure.

Bill Sommerfeld mercurial-bugs at selenic.com
Tue Jul 31 16:22:16 CDT 2007


New submission from Bill Sommerfeld <sommerfeld at sun.com>:

on systems available to me, sys.exit(256) yields a zero (successful) process
exit status from the python interpreter.

certain hg subcommands return a count as their exit status (notably update,
which returns the number of unresolved files), and this gets passed directly to
sys.exit().

the sys.exit() documentation I've found:  http://docs.python.org/lib/module-sys.html
says: "Most systems require it to be in the range 0-127, and produce undefined
results otherwise."

seems like the sensible thing to do would be to clip a numeric value passed to
sys.exit to 127, either in cmdutil.runcatch(), commands.run(), or somewhere else.

----------
messages: 3662
nosy: sommerfeld
priority: bug
status: unread
title: hg process may exit with an apparently-zero status on failure.

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue664>
____________________________________________________



More information about the Mercurial-devel mailing list