changeset 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 e3cd724231ff
children 6193d810f7bb
files mercurial/bundle2.py mercurial/exchange.py
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Sep 16 11:09:08 2017 -0400
+++ b/mercurial/bundle2.py	Fri Sep 15 18:38:36 2017 -0400
@@ -1444,7 +1444,7 @@
     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 @@
         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:
--- a/mercurial/exchange.py	Sat Sep 16 11:09:08 2017 -0400
+++ b/mercurial/exchange.py	Fri Sep 15 18:38:36 2017 -0400
@@ -1640,7 +1640,8 @@
         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')