# HG changeset patch # User Pierre-Yves David # Date 1408984539 -7200 # Node ID 394a17de6a2d8bc7506f26c4405a2b6b941ff3fd # Parent 9680da73cfe0fc760bf5f2fc0dfa8c7782e00806 obsmarker: produce a reply part for markers received through bundle2 diff -r 9680da73cfe0 -r 394a17de6a2d mercurial/bundle2.py --- a/mercurial/bundle2.py Mon Aug 25 18:26:56 2014 +0200 +++ b/mercurial/bundle2.py Mon Aug 25 18:35:39 2014 +0200 @@ -908,3 +908,15 @@ if new: op.repo.ui.status(_('%i new obsolescence markers\n') % new) op.records.add('obsmarkers', {'new': new}) + if op.reply is not None: + rpart = op.reply.newpart('b2x:reply:obsmarkers') + rpart.addparam('in-reply-to', str(inpart.id), mandatory=False) + rpart.addparam('new', '%i' % new, mandatory=False) + + +@parthandler('b2x:reply:obsmarkers', ('new', 'in-reply-to')) +def handlepushkeyreply(op, inpart): + """retrieve the result of a pushkey request""" + ret = int(inpart.params['new']) + partid = int(inpart.params['in-reply-to']) + op.records.add('obsmarkers', {'new': ret}, partid)