Patchwork D5609: remotefilelog: fix some bytes/str portability issues for Python 3

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2019, 5:22 p.m.
Message ID <188b3783833a0e7b77c1aafd086bf479@localhost.localdomain>
Download mbox | patch
Permalink /patch/37828/
State Not Applicable
Headers show

Comments

phabricator - Jan. 16, 2019, 5:22 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG194e43c2bac9: remotefilelog: fix some bytes/str portability issues for Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5609?vs=13269&id=13289

REVISION DETAIL
  https://phab.mercurial-scm.org/D5609

AFFECTED FILES
  hgext/remotefilelog/basestore.py
  hgext/remotefilelog/debugcommands.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/debugcommands.py b/hgext/remotefilelog/debugcommands.py
--- a/hgext/remotefilelog/debugcommands.py
+++ b/hgext/remotefilelog/debugcommands.py
@@ -242,8 +242,8 @@ 
 
             ui.write(("Total:%s%s  %s (%s)\n") % (
                 "".ljust(2 * hashlen - len("Total:")),
-                str(totaldeltasize).ljust(12),
-                str(totalblobsize).ljust(9),
+                ('%d' % totaldeltasize).ljust(12),
+                ('%d' % totalblobsize).ljust(9),
                 deltastr
             ))
 
@@ -277,10 +277,10 @@ 
                 totalblobsize += blobsize
             else:
                 blobsize = "(missing)"
-            ui.write("%s  %s  %s%s\n" % (
+            ui.write("%s  %s  %s%d\n" % (
                 hashformatter(node),
                 hashformatter(deltabase),
-                str(deltalen).ljust(14),
+                ('%d' % deltalen).ljust(14),
                 blobsize))
 
         if filename is not None:
@@ -342,7 +342,7 @@ 
             "Delta Length".ljust(6),
         ))
 
-        ui.write("%s  %s  %s  %s\n" % (
+        ui.write("%s  %s  %s  %d\n" % (
             hashformatter(node),
             hashformatter(deltabasenode),
             nodemod.hex(hashlib.sha1(delta).digest()),
diff --git a/hgext/remotefilelog/basestore.py b/hgext/remotefilelog/basestore.py
--- a/hgext/remotefilelog/basestore.py
+++ b/hgext/remotefilelog/basestore.py
@@ -383,7 +383,7 @@ 
                 removedexcess += oldpathstat.st_size
             progress.complete()
 
-        ui.status(_("finished: removed %s of %s files (%0.2f GB to %0.2f GB)\n")
+        ui.status(_("finished: removed %d of %d files (%0.2f GB to %0.2f GB)\n")
                   % (removed, count,
                      float(originalsize) / 1024.0 / 1024.0 / 1024.0,
                      float(size) / 1024.0 / 1024.0 / 1024.0))