Issue664

Title hg process may exit with an apparently-zero status on failure.
Priority bug Status resolved
Superseder Nosy List ThomasAH, kupfer, mpm, sommerfeld
Assigned To mpm Topics release

Created on 2007-07-31.21:22:16 by sommerfeld, last changed 2007-12-25.13:17:40 by ThomasAH.

Messages
msg4691 (view) Author: ThomasAH Date: 2007-12-25.13:17:40
in main (not stable) as 0c608a8d9c5f and works fine
msg4518 (view) Author: mpm Date: 2007-12-08.08:15:04
I'll push a patch to set the return code for unresolved files to 1 shortly.
msg3713 (view) Author: ThomasAH Date: 2007-08-04.13:57:43
Yes, just returning 0 or 1 is enough.

mpm, I think you introduced this in 56f99f5aab34 (August 2006)

Could this be changed for 0.9.5 or is the change too much for -stable?
msg3663 (view) Author: mpm Date: 2007-07-31.21:43:10
We really shouldn't be returning counts.
msg3662 (view) Author: sommerfeld Date: 2007-07-31.21:22:12
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.
History
Date User Action Args
2007-12-25 13:17:40ThomasAHsetstatus: testing -> resolved
nosy: mpm, ThomasAH, kupfer, sommerfeld
messages: + msg4691
2007-12-08 08:15:04mpmsetstatus: chatting -> testing
nosy: mpm, ThomasAH, kupfer, sommerfeld
messages: + msg4518
2007-08-24 16:50:24ThomasAHsettopic: + release
nosy: mpm, ThomasAH, kupfer, sommerfeld
2007-08-20 20:54:39kupfersetnosy: + kupfer
2007-08-04 13:57:44ThomasAHsetnosy: + ThomasAH
messages: + msg3713
assignedto: mpm
2007-07-31 21:43:10mpmsetstatus: unread -> chatting
nosy: + mpm
messages: + msg3663
2007-07-31 21:22:16sommerfeldcreate