push: move bundle2-pushkey based bookmarks exchange in its own function
We are about to introduce an alternative way to push bookmark over bundle2.
--- 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