evolve: add bytes and new marker data when processing part
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 20 May 2014 15:01:33 -0700
changeset 958 6d18a1ab496c
parent 957 2cde59f3cb5d
child 959 d39a5c8c82ad
evolve: add bytes and new marker data when processing part This will helps use to keep printing useful message when pulling through bundle2.
hgext/evolve.py
--- a/hgext/evolve.py	Tue May 20 13:41:27 2014 -0700
+++ b/hgext/evolve.py	Tue May 20 15:01:33 2014 -0700
@@ -2373,7 +2373,12 @@
 def handleobsmarkerv1(op, inpart):
     """add a stream of obsmarker to the repo"""
     tr = op.gettransaction()
-    op.repo.obsstore.mergemarkers(tr, inpart.read())
+    obsdata = inpart.read()
+    totalsize = len(obsdata)
+    old = len(op.repo.obsstore._all)
+    op.repo.obsstore.mergemarkers(tr, obsdata)
+    new = len(op.repo.obsstore._all) - old
+    op.records.add('evo_obsmarkers', {'new': new, 'bytes': totalsize})
 
 def _buildpullobsmerkersboundaries(pullop):
     """small funtion returning the argument for pull markers call