Patchwork D2895: py3: use "%d" % int instead of str(int)

login
register
mail settings
Submitter phabricator
Date March 19, 2018, 1:47 p.m.
Message ID <5d51befbc57120fb1adc75ffbb65b7d2@localhost.localdomain>
Download mbox | patch
Permalink /patch/29628/
State Not Applicable
Headers show

Comments

phabricator - March 19, 2018, 1:47 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1bf555cb680e: py3: use &quot;%d&quot; % int instead of str(int) (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2895?vs=7100&id=7113

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1133,7 +1133,7 @@ 
         fm.startitem()
         fm.write('branch', '%s', tag, label=label)
         rev = ctx.rev()
-        padsize = max(31 - len(str(rev)) - encoding.colwidth(tag), 0)
+        padsize = max(31 - len("%d" % rev) - encoding.colwidth(tag), 0)
         fmt = ' ' * padsize + ' %d:%s'
         fm.condwrite(not ui.quiet, 'rev node', fmt, rev, hexfunc(ctx.node()),
                      label='log.changeset changeset.%s' % ctx.phasestr())