Bug 3611 - HG outgoing returns incorrect exit code with largefiles extension enabled
Summary: HG outgoing returns incorrect exit code with largefiles extension enabled
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: largefiles (show other bugs)
Version: earlier
Hardware: PC Windows
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-05 06:47 UTC by Martin
Modified: 2017-11-01 18:05 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2012-09-05 06:47 UTC
HG outgoing is documented as returning the following exit codes from "hg help out":

Returns 0 if there are outgoing changes, 1 otherwise.

However, a zero exit code is now being returned on our Windows computers when there are no outgoing changes to push. 

------------
To reproduce
------------

Enable largefiles extension.

Load a command prompt and navigate to a folder where you can perform the test. Run the following commands:

mkdir test
cd test
hg init
cd ..
hg clone test test2
cd test2
hg out
echo %ERRORLEVEL%

Note that the exit code returned is 0 and not 1 as documented. This does work as described if the largefiles extension is NOT enabled.

---------
Rationale
---------

This has caused problems with one of our automated builds which had a stage that would check that there are no outgoing changes not pushed to our master repository.

We have performed a work around using "hq out -q" to a temp file and then checking if this file is empty. This may be useful for anyone else who is also relying on the exit code for hg out until this can be properly fixed.
Comment 1 Matt Harbison 2012-09-06 00:45 UTC
Patch submitted here:

http://www.selenic.com/pipermail/mercurial-devel/2012-September/044030.html

Beware that there are other commands with similar issues- patches for them are also in that series.
Comment 2 HG Bot 2012-09-17 17:10 UTC
Fixed by http://selenic.com/repo/hg/rev/98d6a10bc401
Matt Harbison <matt_harbison@yahoo.com>
largefiles: preserve exit code from outgoing command (issue3611)

This maintains the exit codes documented in commands.py.

(please test the fix)