diff -r dbf868623daf -r ad5f2b923b0d mercurial/exchange.py --- a/mercurial/exchange.py Sun Oct 15 15:01:03 2017 +0200 +++ b/mercurial/exchange.py Mon Nov 13 04:22:45 2017 +0100 @@ -13,6 +13,7 @@ from .i18n import _ from .node import ( + bin, hex, nullid, ) @@ -743,6 +744,22 @@ or pushop.outobsmarkers or pushop.outbookmarks) +@b2partsgenerator('check-bookmarks') +def _pushb2checkbookmarks(pushop, bundler): + """insert bookmark move checking""" + if not _pushing(pushop) or pushop.force: + return + b2caps = bundle2.bundle2caps(pushop.remote) + hasbookmarkcheck = 'bookmarks' in b2caps + if not (pushop.outbookmarks and hasbookmarkcheck): + return + data = [] + for book, old, new in pushop.outbookmarks: + old = bin(old) + data.append((book, old)) + checkdata = bookmod.binaryencode(data) + bundler.newpart('check:bookmarks', data=checkdata) + @b2partsgenerator('check-phases') def _pushb2checkphases(pushop, bundler): """insert phase move checking"""