diff --git a/mercurial/commands.py b/mercurial/commands.py
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..90f8b8dd0326c820a1db44b574d554d2554fa39e_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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 --git a/mercurial/localrepo.py b/mercurial/localrepo.py
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_bWVyY3VyaWFsL2xvY2FscmVwby5weQ==..90f8b8dd0326c820a1db44b574d554d2554fa39e_bWVyY3VyaWFsL2xvY2FscmVwby5weQ== 100644
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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 --git a/tests/test-mq-safety.t b/tests/test-mq-safety.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC1tcS1zYWZldHkudA==..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC1tcS1zYWZldHkudA== 100644
--- a/tests/test-mq-safety.t
+++ b/tests/test-mq-safety.t
@@ -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 --git a/tests/test-phases-exchange.t b/tests/test-phases-exchange.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC1waGFzZXMtZXhjaGFuZ2UudA==..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC1waGFzZXMtZXhjaGFuZ2UudA== 100644
--- a/tests/test-phases-exchange.t
+++ b/tests/test-phases-exchange.t
@@ -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 --git a/tests/test-push-warn.t b/tests/test-push-warn.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC1wdXNoLXdhcm4udA==..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC1wdXNoLXdhcm4udA== 100644
--- 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
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC1zc2gudA==..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC1zc2gudA== 100644
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -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 --git a/tests/test-subrepo-relative-path.t b/tests/test-subrepo-relative-path.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC1zdWJyZXBvLXJlbGF0aXZlLXBhdGgudA==..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC1zdWJyZXBvLXJlbGF0aXZlLXBhdGgudA== 100644
--- a/tests/test-subrepo-relative-path.t
+++ b/tests/test-subrepo-relative-path.t
@@ -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 --git a/tests/test-treediscovery-legacy.t b/tests/test-treediscovery-legacy.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC10cmVlZGlzY292ZXJ5LWxlZ2FjeS50..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC10cmVlZGlzY292ZXJ5LWxlZ2FjeS50 100644
--- a/tests/test-treediscovery-legacy.t
+++ b/tests/test-treediscovery-legacy.t
@@ -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 --git a/tests/test-treediscovery.t b/tests/test-treediscovery.t
index 04604d1a9fc374ed85ff912e13b9e00c458659ed_dGVzdHMvdGVzdC10cmVlZGlzY292ZXJ5LnQ=..90f8b8dd0326c820a1db44b574d554d2554fa39e_dGVzdHMvdGVzdC10cmVlZGlzY292ZXJ5LnQ= 100644
--- a/tests/test-treediscovery.t
+++ b/tests/test-treediscovery.t
@@ -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