py3: fix debugstablerangecache
authorJoerg Sonnenberger <joerg@bec.de>
Fri, 01 May 2020 21:05:37 +0200
changeset 5313 fbe07b1cf5d4
parent 5312 9035901412e6
child 5316 277b45cf0dda
py3: fix debugstablerangecache
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/stablerangecache.py	Wed Apr 29 00:44:14 2020 +0800
+++ b/hgext3rd/evolve/stablerangecache.py	Fri May 01 21:05:37 2020 +0200
@@ -436,18 +436,18 @@
     unfi = repo.unfiltered()
     revs = unfi.revs('all()')
     nbrevs = len(revs)
-    ui.write('number of revisions:  %12d\n' % nbrevs)
+    ui.write(b'number of revisions:  %12d\n' % nbrevs)
     heads = unfi.revs('heads(all())')
     nbheads = len(heads)
-    ui.write('number of heads:      %12d\n' % nbheads)
+    ui.write(b'number of heads:      %12d\n' % nbheads)
     merge = unfi.revs('merge()')
     nbmerge = len(merge)
-    ui.write('number of merge:      %12d (%3d%%)\n'
+    ui.write(b'number of merge:      %12d (%3d%%)\n'
              % (nbmerge, 100 * nbmerge / nbrevs))
     cache = unfi.stablerange
     allsubranges = stablerange.subrangesclosure(unfi, cache, heads)
     nbsubranges = len(allsubranges) - nbrevs # we remove leafs
-    ui.write('number of range:      %12d\n' % nbsubranges)
+    ui.write(b'number of range:      %12d\n' % nbsubranges)
     import collections
     subsizedistrib = collections.defaultdict(lambda: 0)
 
@@ -476,7 +476,7 @@
     for ss in sorted(subsizedistrib):
         ssc = subsizedistrib[ss]
         ssp = ssc * 100 // nbsubranges
-        ui.write('  with %3d subranges: %12d (%3d%%)\n' % (ss, ssc, ssp))
+        ui.write(b'  with %3d subranges: %12d (%3d%%)\n' % (ss, ssc, ssp))
 
     depth = repo.depthcache.get
     stdslice = 0
@@ -491,11 +491,11 @@
         else:
             oddslice += 1
 
-    ui.write('standard slice point cut: %12d (%3d%%)\n'
+    ui.write(b'standard slice point cut: %12d (%3d%%)\n'
              % (stdslice, stdslice * 100 // nbsubranges))
-    ui.write('other    slice point cut: %12d (%3d%%)\n'
+    ui.write(b'other    slice point cut: %12d (%3d%%)\n'
              % (oddslice, oddslice * 100 // nbsubranges))
-    ui.write('est. naive compact store: %12d bytes\n' % totalsize)
+    ui.write(b'est. naive compact store: %12d bytes\n' % totalsize)
 
 @eh.reposetup
 def setupcache(ui, repo):