push: move bundle2-pushkey based bookmarks exchange in its own function
authorBoris Feld <boris.feld@octobus.net>
Sun, 15 Oct 2017 19:22:56 +0200
changeset 35271 3fd5f05a5b87
parent 35270 f392066d127c
child 35272 ae79d878702b
push: move bundle2-pushkey based bookmarks exchange in its own function We are about to introduce an alternative way to push bookmark over bundle2.
mercurial/exchange.py
--- a/mercurial/exchange.py	Tue Oct 17 12:07:24 2017 +0200
+++ b/mercurial/exchange.py	Sun Oct 15 19:22:56 2017 +0200
@@ -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