Mercurial > evolve
comparison hgext/evolve.py @ 958:6d18a1ab496c
evolve: add bytes and new marker data when processing part
This will helps use to keep printing useful message when pulling through
bundle2.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 20 May 2014 15:01:33 -0700 |
parents | 2cde59f3cb5d |
children | d39a5c8c82ad |
comparison
equal
deleted
inserted
replaced
957:2cde59f3cb5d | 958:6d18a1ab496c |
---|---|
2371 | 2371 |
2372 @bundle2.parthandler('evolve:b2x:obsmarkerv1') | 2372 @bundle2.parthandler('evolve:b2x:obsmarkerv1') |
2373 def handleobsmarkerv1(op, inpart): | 2373 def handleobsmarkerv1(op, inpart): |
2374 """add a stream of obsmarker to the repo""" | 2374 """add a stream of obsmarker to the repo""" |
2375 tr = op.gettransaction() | 2375 tr = op.gettransaction() |
2376 op.repo.obsstore.mergemarkers(tr, inpart.read()) | 2376 obsdata = inpart.read() |
2377 totalsize = len(obsdata) | |
2378 old = len(op.repo.obsstore._all) | |
2379 op.repo.obsstore.mergemarkers(tr, obsdata) | |
2380 new = len(op.repo.obsstore._all) - old | |
2381 op.records.add('evo_obsmarkers', {'new': new, 'bytes': totalsize}) | |
2377 | 2382 |
2378 def _buildpullobsmerkersboundaries(pullop): | 2383 def _buildpullobsmerkersboundaries(pullop): |
2379 """small funtion returning the argument for pull markers call | 2384 """small funtion returning the argument for pull markers call |
2380 may to contains 'heads' and 'common'. skip the key for None. | 2385 may to contains 'heads' and 'common'. skip the key for None. |
2381 | 2386 |