Mercurial > evolve
comparison hgext/evolve.py @ 1037:bddee73b361e
evolve: add "absolescence" in front of markers in the message
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 08 Aug 2014 17:34:22 -0700 |
parents | 70de12b7721a |
children | 45c4739e85dc |
comparison
equal
deleted
inserted
replaced
1036:70de12b7721a | 1037:bddee73b361e |
---|---|
2401 return | 2401 return |
2402 obsdata = pushobsmarkerStringIO() | 2402 obsdata = pushobsmarkerStringIO() |
2403 _encodemarkersstream(obsdata, markers) | 2403 _encodemarkersstream(obsdata, markers) |
2404 obsdata.seek(0) | 2404 obsdata.seek(0) |
2405 obsdata.ui = repo.ui | 2405 obsdata.ui = repo.ui |
2406 obsexcmsg(repo.ui, "pushing %i markers (%i bytes)\n" | 2406 obsexcmsg(repo.ui, "pushing %i obsolescence markers (%i bytes)\n" |
2407 % (len(markers), len(obsdata.getvalue())), | 2407 % (len(markers), len(obsdata.getvalue())), |
2408 True) | 2408 True) |
2409 bundler.newpart('EVOLVE:B2X:OBSMARKERV1', data=obsdata) | 2409 bundler.newpart('EVOLVE:B2X:OBSMARKERV1', data=obsdata) |
2410 def callback(op): | 2410 def callback(op): |
2411 obsexcprg(repo.ui, None) | 2411 obsexcprg(repo.ui, None) |
2476 elif remote.capable('_evoext_b2x_obsmarkers_0'): | 2476 elif remote.capable('_evoext_b2x_obsmarkers_0'): |
2477 obsdata = pushobsmarkerStringIO() | 2477 obsdata = pushobsmarkerStringIO() |
2478 _encodemarkersstream(obsdata, markers) | 2478 _encodemarkersstream(obsdata, markers) |
2479 obsdata.seek(0) | 2479 obsdata.seek(0) |
2480 obsdata.ui = repo.ui | 2480 obsdata.ui = repo.ui |
2481 obsexcmsg(repo.ui, "pushing %i markers (%i bytes)\n" | 2481 obsexcmsg(repo.ui, "pushing %i obsolescence markers (%i bytes)\n" |
2482 % (len(markers), len(obsdata.getvalue())), | 2482 % (len(markers), len(obsdata.getvalue())), |
2483 True) | 2483 True) |
2484 bundler = bundle2.bundle20(pushop.ui, {}) | 2484 bundler = bundle2.bundle20(pushop.ui, {}) |
2485 capsblob = bundle2.encodecaps(pushop.repo.bundle2caps) | 2485 capsblob = bundle2.encodecaps(pushop.repo.bundle2caps) |
2486 bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsblob)) | 2486 bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsblob)) |
2499 elif remote.capable('_evoext_pushobsmarkers_0'): | 2499 elif remote.capable('_evoext_pushobsmarkers_0'): |
2500 obsdata = pushobsmarkerStringIO() | 2500 obsdata = pushobsmarkerStringIO() |
2501 _encodemarkersstream(obsdata, markers) | 2501 _encodemarkersstream(obsdata, markers) |
2502 obsdata.seek(0) | 2502 obsdata.seek(0) |
2503 obsdata.ui = repo.ui | 2503 obsdata.ui = repo.ui |
2504 obsexcmsg(repo.ui, "pushing %i markers (%i bytes)\n" | 2504 obsexcmsg(repo.ui, "pushing %i obsolescence markers (%i bytes)\n" |
2505 % (len(markers), len(obsdata.getvalue())), | 2505 % (len(markers), len(obsdata.getvalue())), |
2506 True) | 2506 True) |
2507 remote.evoext_pushobsmarkers_0(obsdata) | 2507 remote.evoext_pushobsmarkers_0(obsdata) |
2508 obsexcprg(repo.ui, None) | 2508 obsexcprg(repo.ui, None) |
2509 else: | 2509 else: |
2510 rslts = [] | 2510 rslts = [] |
2511 remotedata = _pushkeyescape(markers).items() | 2511 remotedata = _pushkeyescape(markers).items() |
2512 totalbytes = sum(len(d) for k,d in remotedata) | 2512 totalbytes = sum(len(d) for k,d in remotedata) |
2513 sentbytes = 0 | 2513 sentbytes = 0 |
2514 obsexcmsg(repo.ui, "pushing %i markers in %i pushkey payload (%i bytes)\n" | 2514 obsexcmsg(repo.ui, "pushing %i obsolescence markers in %i pushkey payload (%i bytes)\n" |
2515 % (len(markers), len(remotedata), totalbytes), | 2515 % (len(markers), len(remotedata), totalbytes), |
2516 True) | 2516 True) |
2517 for key, data in remotedata: | 2517 for key, data in remotedata: |
2518 obsexcprg(repo.ui, sentbytes, item=key, unit="bytes", | 2518 obsexcprg(repo.ui, sentbytes, item=key, unit="bytes", |
2519 total=totalbytes) | 2519 total=totalbytes) |