changeset 22340:394a17de6a2d

obsmarker: produce a reply part for markers received through bundle2
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 25 Aug 2014 18:35:39 +0200
parents 9680da73cfe0
children 2d16b39601b5
files mercurial/bundle2.py
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)