comparison mercurial/bundle2.py @ 34221:8e0358024a36

bundles: turn nbchanges int into a bytestr using pycompat.bytestr Fixes some python 3 failures.
author Augie Fackler <raf@durin42.com>
date Fri, 15 Sep 2017 18:38:36 -0400
parents 21c2df59a1da
children ab379eed2e31
comparison
equal deleted inserted replaced
34220:e3cd724231ff 34221:8e0358024a36
1442 cgversion = changegroup.safeversion(repo) 1442 cgversion = changegroup.safeversion(repo)
1443 cg = changegroup.makechangegroup(repo, outgoing, cgversion, source) 1443 cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
1444 part = bundler.newpart('changegroup', data=cg.getchunks()) 1444 part = bundler.newpart('changegroup', data=cg.getchunks())
1445 part.addparam('version', cg.version) 1445 part.addparam('version', cg.version)
1446 if 'clcount' in cg.extras: 1446 if 'clcount' in cg.extras:
1447 part.addparam('nbchanges', str(cg.extras['clcount']), 1447 part.addparam('nbchanges', '%d' % cg.extras['clcount'],
1448 mandatory=False) 1448 mandatory=False)
1449 if opts.get('phases') and repo.revs('%ln and secret()', 1449 if opts.get('phases') and repo.revs('%ln and secret()',
1450 outgoing.missingheads): 1450 outgoing.missingheads):
1451 part.addparam('targetphase', '%d' % phases.secret, mandatory=False) 1451 part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
1452 1452
1518 bundle = bundle20(ui) 1518 bundle = bundle20(ui)
1519 bundle.setcompression(compression, compopts) 1519 bundle.setcompression(compression, compopts)
1520 part = bundle.newpart('changegroup', data=cg.getchunks()) 1520 part = bundle.newpart('changegroup', data=cg.getchunks())
1521 part.addparam('version', cg.version) 1521 part.addparam('version', cg.version)
1522 if 'clcount' in cg.extras: 1522 if 'clcount' in cg.extras:
1523 part.addparam('nbchanges', str(cg.extras['clcount']), 1523 part.addparam('nbchanges', '%d' % cg.extras['clcount'],
1524 mandatory=False) 1524 mandatory=False)
1525 chunkiter = bundle.getchunks() 1525 chunkiter = bundle.getchunks()
1526 else: 1526 else:
1527 # compression argument is only for the bundle2 case 1527 # compression argument is only for the bundle2 case
1528 assert compression is None 1528 assert compression is None