--- a/mercurial/exchangev2.py Thu Aug 23 18:14:19 2018 -0700
+++ b/mercurial/exchangev2.py Wed Aug 29 17:03:19 2018 -0700
@@ -15,6 +15,7 @@
short,
)
from . import (
+ bookmarks,
mdiff,
phases,
pycompat,
@@ -51,6 +52,11 @@
phases.advanceboundary(repo, tr, phases.phasenames.index(phase),
csetres['nodesbyphase'][phase])
+ # Write bookmark updates.
+ bookmarks.updatefromremote(repo.ui, repo, csetres['bookmarks'],
+ remote.url(), pullop.gettransaction,
+ explicit=pullop.explicitbookmarks)
+
def _pullchangesetdiscovery(repo, remote, heads, abortwhenunrelated=True):
"""Determine which changesets need to be pulled."""
@@ -91,7 +97,7 @@
with remote.commandexecutor() as e:
objs = e.callcommand(b'changesetdata', {
b'noderange': [sorted(common), sorted(remoteheads)],
- b'fields': {b'parents', b'phase', b'revision'},
+ b'fields': {b'bookmarks', b'parents', b'phase', b'revision'},
}).result()
# The context manager waits on all response data when exiting. So
@@ -124,6 +130,7 @@
progress.increment()
nodesbyphase = {phase: set() for phase in phases.phasenames}
+ remotebookmarks = {}
# addgroup() expects a 7-tuple describing revisions. This normalizes
# the wire data to that format.
@@ -137,6 +144,9 @@
if b'phase' in cset:
nodesbyphase[cset[b'phase']].add(node)
+ for mark in cset.get(b'bookmarks', []):
+ remotebookmarks[mark] = node
+
# Some entries might only be metadata only updates.
if b'revisionsize' not in cset:
continue
@@ -164,4 +174,5 @@
return {
'added': added,
'nodesbyphase': nodesbyphase,
+ 'bookmarks': remotebookmarks,
}