bundle2: add an obsmarkers part handler
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 25 Aug 2014 18:08:22 +0200
changeset 22336 60786c8a2f70
parent 22335 7c4c19dfd484
child 22337 c380fe290290
bundle2: add an obsmarkers part handler This part contains a binary stream of obsolescence markers. Received markers are added to the repository.
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Mon Aug 25 16:24:40 2014 +0200
+++ b/mercurial/bundle2.py	Mon Aug 25 18:08:22 2014 +0200
@@ -899,3 +899,9 @@
     ret = int(inpart.params['return'])
     partid = int(inpart.params['in-reply-to'])
     op.records.add('pushkey', {'return': ret}, partid)
+
+@parthandler('b2x:obsmarkers')
+def handleobsmarker(op, inpart):
+    """add a stream of obsmarkers to the repo"""
+    tr = op.gettransaction()
+    op.repo.obsstore.mergemarkers(tr, inpart.read())