# HG changeset patch # User Matt Mackall # Date 1327944729 21600 # Node ID 90f8b8dd0326c820a1db44b574d554d2554fa39e # Parent 04604d1a9fc374ed85ff912e13b9e00c458659ed push: return 1 if no changes found (issue3228) Currently we have the following return codes if nothing is found: commit incoming outgoing pull push intended 1 1 1 1 1 documented 1 1 1 0 1 actual 1 1 1 0 0 This fixes the lower-right entry. diff -r 04604d1a9fc3 -r 90f8b8dd0326 mercurial/commands.py --- a/mercurial/commands.py Mon Jan 30 11:26:20 2012 -0600 +++ b/mercurial/commands.py Mon Jan 30 11:32:09 2012 -0600 @@ -4426,7 +4426,7 @@ result = repo.push(other, opts.get('force'), revs=revs, newbranch=opts.get('new_branch')) - result = (result == 0) + result = not result if opts.get('bookmark'): rb = other.listkeys('bookmarks') diff -r 04604d1a9fc3 -r 90f8b8dd0326 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jan 30 11:26:20 2012 -0600 +++ b/mercurial/localrepo.py Mon Jan 30 11:32:09 2012 -0600 @@ -1592,7 +1592,8 @@ def push(self, remote, force=False, revs=None, newbranch=False): '''Push outgoing changesets (limited by revs) from the current repository to remote. Return an integer: - - 0 means HTTP error *or* nothing to push + - None means nothing to push + - 0 means HTTP error - 1 means we pushed and remote head count is unchanged *or* we have outgoing changesets but refused to push - other values as described by addchangegroup() @@ -1626,7 +1627,7 @@ if not outgoing.missing: # nothing to push scmutil.nochangesfound(self.ui, outgoing.excluded) - ret = 1 + ret = None else: # something to push if not force: diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-mq-safety.t --- a/tests/test-mq-safety.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-mq-safety.t Mon Jan 30 11:32:09 2012 -0600 @@ -173,6 +173,7 @@ pushing to ../forcepush2 searching for changes no changes found (ignored 1 secret changesets) + [1] $ hg phase --draft 'mq()' $ hg push --force -r default ../forcepush2 pushing to ../forcepush2 diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-phases-exchange.t --- a/tests/test-phases-exchange.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-phases-exchange.t Mon Jan 30 11:32:09 2012 -0600 @@ -98,6 +98,7 @@ pushing to ../beta searching for changes no changes found + [1] $ hgph @ 3 public a-D - b555f63b6063 | @@ -372,6 +373,7 @@ pushing to ../alpha searching for changes no changes found + [1] $ cd .. $ cd alpha $ hgph @@ -555,6 +557,7 @@ pushing to ../alpha searching for changes no changes found + [1] $ hgph o 6 public a-F - b740e3e5c05d | @@ -659,6 +662,7 @@ pushing to ../alpha searching for changes no changes found + [1] $ hgph o 9 public a-H - 967b449fbc94 | @@ -932,6 +936,7 @@ pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg phase f54f1bb90ff3 2: draft diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-push-warn.t --- a/tests/test-push-warn.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-push-warn.t Mon Jan 30 11:32:09 2012 -0600 @@ -116,6 +116,7 @@ pushing to ../c searching for changes no changes found + [1] $ hg push -r 3 ../c pushing to ../c diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-ssh.t --- a/tests/test-ssh.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-ssh.t Mon Jan 30 11:32:09 2012 -0600 @@ -185,6 +185,7 @@ searching for changes no changes found updating bookmark foo + [1] $ hg book -d foo $ hg in -B comparing with ssh://user@dummy/remote diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-subrepo-relative-path.t --- a/tests/test-subrepo-relative-path.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-subrepo-relative-path.t Mon Jan 30 11:32:09 2012 -0600 @@ -96,6 +96,7 @@ no changes found searching for changes no changes found + [1] $ cat dummylog Got arguments 1:user@dummy 2:hg -R cloned serve --stdio diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-treediscovery-legacy.t --- a/tests/test-treediscovery-legacy.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-treediscovery-legacy.t Mon Jan 30 11:32:09 2012 -0600 @@ -51,6 +51,7 @@ $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ tstop Base repo: @@ -110,6 +111,7 @@ pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ cd .. Local is empty: @@ -140,6 +142,7 @@ $ hg push $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ requesting all changes @@ -184,6 +187,7 @@ pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ searching for changes diff -r 04604d1a9fc3 -r 90f8b8dd0326 tests/test-treediscovery.t --- a/tests/test-treediscovery.t Mon Jan 30 11:26:20 2012 -0600 +++ b/tests/test-treediscovery.t Mon Jan 30 11:32:09 2012 -0600 @@ -45,6 +45,7 @@ $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ tstop Base repo: @@ -104,6 +105,7 @@ pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ cd .. Local is empty: @@ -130,6 +132,7 @@ $ hg push $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ requesting all changes @@ -172,6 +175,7 @@ pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ searching for changes