changeset 22656:c9276945eba3

pull: retrieve bookmarks through bundle2 We can retrieve any pushkey namespace through bundle2. So we also ask for bookmark data and use them to update the local repo.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 27 Sep 2014 01:59:56 -0700
parents f48ac29c2a9e
children f4e39ceb064a
files mercurial/exchange.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Sat Sep 27 01:37:56 2014 -0700
+++ b/mercurial/exchange.py	Sat Sep 27 01:59:56 2014 -0700
@@ -892,7 +892,7 @@
     kwargs['heads'] = pullop.heads or pullop.rheads
     kwargs['cg'] = pullop.fetch
     if 'b2x:listkeys' in remotecaps:
-        kwargs['listkeys'] = ['phase']
+        kwargs['listkeys'] = ['phase', 'bookmarks']
     if not pullop.fetch:
         pullop.repo.ui.status(_("no changes found\n"))
         pullop.cgresult = 0
@@ -922,6 +922,12 @@
         if namespace == 'phases':
             _pullapplyphases(pullop, value)
 
+    # processing bookmark update
+    for namespace, value in op.records['listkeys']:
+        if namespace == 'bookmarks':
+            pullop.remotebookmarks = value
+            _pullbookmarks(pullop)
+
 def _pullbundle2extraprepare(pullop, kwargs):
     """hook function so that extensions can extend the getbundle call"""
     pass