diff --git a/mercurial/exchange.py b/mercurial/exchange.py
index f392066d127ca624275f7e3bcbabc2ce07ff0164_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5..3fd5f05a5b876d35991e920c7ce61f5bea9dffdb_bWVyY3VyaWFsL2V4Y2hhbmdlLnB5 100644
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -897,8 +897,10 @@
     if 'bookmarks' in pushop.stepsdone:
         return
     b2caps = bundle2.bundle2caps(pushop.remote)
-    if 'pushkey' not in b2caps:
-        return
+    if 'pushkey' in b2caps:
+        return _pushb2bookmarkspushkey(pushop, bundler)
+
+def _pushb2bookmarkspushkey(pushop, bundler):
     pushop.stepsdone.add('bookmarks')
     part2book = []
     enc = pushkey.encode