Bug 3229 - Push doesn't return documented exit code.
Summary: Push doesn't return documented exit code.
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 04:22 UTC by David Sedlock
Modified: 2012-05-13 04:47 UTC (History)
5 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 David Sedlock 2012-01-30 04:22 UTC
$ hg help push
...
  Returns 0 if push was successful, 1 if nothing to push.
  
$ hg init team
$ hg clone team clone
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd clone
$ hg push; echo $?
pushing to C:\tmp\push_return_code\team
no changes found
0
$ touch file.txt; hg commit -A -m file
adding file.txt
$ hg push; echo $?
pushing to C:\tmp\push_return_code\team
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
0

Compare outgoing, which behaves as documented:

$ hg help out
...
    Returns 0 if there are outgoing changes, 1 otherwise.

$ hg out; echo $?
comparing with C:\tmp\push_return_code\team
searching for changes
no changes found
1
$ echo line>>file.txt; hg commit -m file
$ hg out; echo $?
comparing with C:\tmp\push_return_code\team
searching for changes
changeset:   1:58c9c9504e2f
tag:         tip
summary:     file
0
Comment 1 Matt Mackall 2012-01-30 10:08 UTC
Related email thread: http://markmail.org/message/ii65ruzgkkppguae
Comment 2 Pierre-Yves David 2012-01-30 12:15 UTC
Other side effect detected this cycle:

http://www.selenic.com/hg/rev/eb6867b98223
Comment 3 HG Bot 2012-01-30 15:00 UTC
Fixed by http://selenic.com/repo/hg/rev/90f8b8dd0326
Matt Mackall <mpm@selenic.com>
push: return 1 if no changes found (issue3228)

(please test the fix)
Comment 4 Bugzilla 2012-05-12 09:27 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:27 EDT  ---

This bug was previously known as _bug_ 3228 at http://mercurial.selenic.com/bts/issue3228