Patchwork [5,of,9,py3] summary: don't explicitly str() something we're about to %s

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2017, 5:22 p.m.
Message ID <6a8d884aa9d76d72cace.1489339334@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19172/
State Superseded
Headers show

Comments

Augie Fackler - March 12, 2017, 5:22 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489283906 18000
#      Sat Mar 11 20:58:26 2017 -0500
# Node ID 6a8d884aa9d76d72cace577c20ad42b7d208551c
# Parent  3863a163a20c34a52ff5d391d4391b01bc029de1
summary: don't explicitly str() something we're about to %s

str() is wrong on Python 3 here, and %s implicitly calls str() anyway,
so this was just extra dancing for no reason.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4812,7 +4812,7 @@  def summary(ui, repo, **opts):
         # label with log.changeset (instead of log.parent) since this
         # shows a working directory parent *changeset*:
         # i18n: column positioning for "hg summary"
-        ui.write(_('parent: %d:%s ') % (p.rev(), str(p)),
+        ui.write(_('parent: %d:%s ') % (p.rev(), p),
                  label=cmdutil._changesetlabels(p))
         ui.write(' '.join(p.tags()), label='log.tag')
         if p.bookmarks():