py3: use %d instead of %s when formatting an int into a bytestring stable
authorIan Moody <moz-ian@perix.co.uk>
Wed, 23 Oct 2019 23:00:58 +0100
branchstable
changeset 43321 a2ff3aff81d2
parent 43320 7b638d25b8e4
child 43322 7d912413a3ae
py3: use %d instead of %s when formatting an int into a bytestring The latter wasn't noticed before since no tests exercise --confirm at all, let alone on an existing DREV. The former is only hit during an intermittent network issue during amending at the end of a phabsend, so doesn't seem testable. Differential Revision: https://phab.mercurial-scm.org/D7153
hgext/phabricator.py
--- a/hgext/phabricator.py	Wed Oct 23 17:18:16 2019 +0200
+++ b/hgext/phabricator.py	Wed Oct 23 23:00:58 2019 +0100
@@ -1168,7 +1168,7 @@
                         writediffproperties(unfi[newnode], diffmap[old.node()])
                     except util.urlerr.urlerror:
                         ui.warnnoi18n(
-                            b'Failed to update metadata for D%s\n' % drevid
+                            b'Failed to update metadata for D%d\n' % drevid
                         )
                 # Remove local tags since it's no longer necessary
                 tagname = b'D%d' % drevid
@@ -1208,7 +1208,7 @@
         desc = ctx.description().splitlines()[0]
         oldnode, olddiff, drevid = oldmap.get(ctx.node(), (None, None, None))
         if drevid:
-            drevdesc = ui.label(b'D%s' % drevid, b'phabricator.drev')
+            drevdesc = ui.label(b'D%d' % drevid, b'phabricator.drev')
         else:
             drevdesc = ui.label(_(b'NEW'), b'phabricator.drev')