diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4426,7 +4426,7 @@ def push(ui, repo, dest=None, **opts): 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 --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1592,7 +1592,8 @@ class localrepository(repo.repository): 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 @@ class localrepository(repo.repository): 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 --git a/tests/test-mq-safety.t b/tests/test-mq-safety.t --- a/tests/test-mq-safety.t +++ b/tests/test-mq-safety.t @@ -173,6 +173,7 @@ Pushing applied patch with --force 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 --git a/tests/test-phases-exchange.t b/tests/test-phases-exchange.t --- a/tests/test-phases-exchange.t +++ b/tests/test-phases-exchange.t @@ -98,6 +98,7 @@ push from alpha to beta should update ph pushing to ../beta searching for changes no changes found + [1] $ hgph @ 3 public a-D - b555f63b6063 | @@ -372,6 +373,7 @@ Push back to alpha pushing to ../alpha searching for changes no changes found + [1] $ cd .. $ cd alpha $ hgph @@ -555,6 +557,7 @@ Pushing to Publish=True (common changese pushing to ../alpha searching for changes no changes found + [1] $ hgph o 6 public a-F - b740e3e5c05d | @@ -659,6 +662,7 @@ Pushing to Publish=True (common changese pushing to ../alpha searching for changes no changes found + [1] $ hgph o 9 public a-H - 967b449fbc94 | @@ -932,6 +936,7 @@ check that secret local on both side are pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg phase f54f1bb90ff3 2: draft diff --git a/tests/test-push-warn.t b/tests/test-push-warn.t --- a/tests/test-push-warn.t +++ b/tests/test-push-warn.t @@ -116,6 +116,7 @@ pushing to ../c searching for changes no changes found + [1] $ hg push -r 3 ../c pushing to ../c diff --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -185,6 +185,7 @@ test pushkeys and bookmarks searching for changes no changes found updating bookmark foo + [1] $ hg book -d foo $ hg in -B comparing with ssh://user@dummy/remote diff --git a/tests/test-subrepo-relative-path.t b/tests/test-subrepo-relative-path.t --- a/tests/test-subrepo-relative-path.t +++ b/tests/test-subrepo-relative-path.t @@ -96,6 +96,7 @@ subrepo paths with ssh urls no changes found searching for changes no changes found + [1] $ cat dummylog Got arguments 1:user@dummy 2:hg -R cloned serve --stdio diff --git a/tests/test-treediscovery-legacy.t b/tests/test-treediscovery-legacy.t --- a/tests/test-treediscovery-legacy.t +++ b/tests/test-treediscovery-legacy.t @@ -51,6 +51,7 @@ Both are empty: $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ tstop Base repo: @@ -110,6 +111,7 @@ Full clone: pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ cd .. Local is empty: @@ -140,6 +142,7 @@ Local is empty: $ 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 @@ Local is subset: pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ searching for changes diff --git a/tests/test-treediscovery.t b/tests/test-treediscovery.t --- a/tests/test-treediscovery.t +++ b/tests/test-treediscovery.t @@ -45,6 +45,7 @@ Both are empty: $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found + [1] $ tstop Base repo: @@ -104,6 +105,7 @@ Full clone: pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ cd .. Local is empty: @@ -130,6 +132,7 @@ Local is empty: $ 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 @@ Local is subset: pushing to http://localhost:$HGPORT/ searching for changes no changes found + [1] $ hg pull $remote pulling from http://localhost:$HGPORT/ searching for changes