Patchwork [3,of,5,stable] py3: use `%d` for int in % formatting

login
register
mail settings
Submitter Manuel Jacob
Date June 16, 2020, 1:50 a.m.
Message ID <23c7b0389ff76d99d4fb.1592272228@tmp>
Download mbox | patch
Permalink /patch/46510/
State Accepted
Headers show

Comments

Manuel Jacob - June 16, 2020, 1:50 a.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1592184863 -7200
#      Mon Jun 15 03:34:23 2020 +0200
# Branch stable
# Node ID 23c7b0389ff76d99d4fb245092720b7229b66544
# Parent  343142bb73bafe1ad2a244905e63770fb31a0ee0
# EXP-Topic convert-svn
py3: use `%d` for int in % formatting

On Python 3, `%s` is an alias to `%b`, which requires that the object implements
`__bytes__()`, which is not the case for `int`.

Patch

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -773,7 +773,7 @@ 
         self.convertfp.flush()
 
     def revid(self, revnum, module=None):
-        return b'svn:%s%s@%s' % (self.uuid, module or self.module, revnum)
+        return b'svn:%s%s@%d' % (self.uuid, module or self.module, revnum)
 
     def revnum(self, rev):
         return int(rev.split(b'@')[-1])