Patchwork [08,of,15,V2] push: move bundle2-pushkey based bookmarks exchange in its own function

login
register
mail settings
Submitter Boris Feld
Date Nov. 2, 2017, 1:18 p.m.
Message ID <1d6e6f7bf4dd82ebb78e.1509628685@FB>
Download mbox | patch
Permalink /patch/25336/
State Accepted
Headers show

Comments

Boris Feld - Nov. 2, 2017, 1:18 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1508088176 -7200
#      Sun Oct 15 19:22:56 2017 +0200
# Node ID 1d6e6f7bf4dd82ebb78e5c5934c8ddf370dfec86
# Parent  3ac21e61b800b660eaf2835eb44ef8d216a92025
# EXP-Topic b2.bookmarks
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1d6e6f7bf4dd
push: move bundle2-pushkey based bookmarks exchange in its own function

We are about to introduce an alternative way to push bookmark over bundle2.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -896,8 +896,10 @@  def _pushb2bookmarks(pushop, bundler):
     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