bundles: turn nbchanges int into a bytestr using pycompat.bytestr

Fixes some python 3 failures.
This commit is contained in:
Augie Fackler 2017-09-15 18:38:36 -04:00
parent 20e593170c
commit fdaf985a63
2 changed files with 4 additions and 3 deletions

View File

@ -1444,7 +1444,7 @@ def _addpartsfromopts(ui, repo, bundler, source, outgoing, opts):
part = bundler.newpart('changegroup', data=cg.getchunks())
part.addparam('version', cg.version)
if 'clcount' in cg.extras:
part.addparam('nbchanges', str(cg.extras['clcount']),
part.addparam('nbchanges', '%d' % cg.extras['clcount'],
mandatory=False)
if opts.get('phases') and repo.revs('%ln and secret()',
outgoing.missingheads):
@ -1520,7 +1520,7 @@ def writebundle(ui, cg, filename, bundletype, vfs=None, compression=None,
part = bundle.newpart('changegroup', data=cg.getchunks())
part.addparam('version', cg.version)
if 'clcount' in cg.extras:
part.addparam('nbchanges', str(cg.extras['clcount']),
part.addparam('nbchanges', '%d' % cg.extras['clcount'],
mandatory=False)
chunkiter = bundle.getchunks()
else:

View File

@ -1640,7 +1640,8 @@ def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None,
part = bundler.newpart('changegroup', data=cgstream)
if cgversions:
part.addparam('version', version)
part.addparam('nbchanges', str(len(outgoing.missing)), mandatory=False)
part.addparam('nbchanges', '%d' % len(outgoing.missing),
mandatory=False)
if 'treemanifest' in repo.requirements:
part.addparam('treemanifest', '1')