Patchwork D6025: remotefilelog: fix format str, blobsize isn't always a #, can be "(missing)"

login
register
mail settings
Submitter phabricator
Date Feb. 25, 2019, 11:59 p.m.
Message ID <differential-rev-PHID-DREV-khxnjew2725ejgt6ihwf-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/38935/
State Superseded
Headers show

Comments

phabricator - Feb. 25, 2019, 11:59 p.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/debugcommands.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 26, 2019, 2:40 p.m.
pulkit added inline comments.

INLINE COMMENTS

> debugcommands.py:279
>                  blobsize = "(missing)"
> -            ui.write("%s  %s  %s%d\n" % (
> +            ui.write("%s  %s  %s%s\n" % (
>                  hashformatter(node),

It was changed to `%d` because `%s % int` does not work on Python 3. I think `%s % pycompat.bytestr(blobsize)` should work on both python versions.

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Feb. 26, 2019, 9:46 p.m.
spectral marked an inline comment as done.
spectral added inline comments.

INLINE COMMENTS

> pulkit wrote in debugcommands.py:279
> It was changed to `%d` because `%s % int` does not work on Python 3. I think `%s % pycompat.bytestr(blobsize)` should work on both python versions.

Changed to use pycompat.bytestr

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers
Cc: pulkit, 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
@@ -276,7 +276,7 @@ 
                 totalblobsize += blobsize
             else:
                 blobsize = "(missing)"
-            ui.write("%s  %s  %s%d\n" % (
+            ui.write("%s  %s  %s%s\n" % (
                 hashformatter(node),
                 hashformatter(deltabase),
                 ('%d' % deltalen).ljust(14),