obsmarker: produce a reply part for markers received through bundle2
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 25 Aug 2014 18:35:39 +0200
changeset 22340 394a17de6a2d
parent 22339 9680da73cfe0
child 22341 2d16b39601b5
obsmarker: produce a reply part for markers received through bundle2
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)