From patchwork Tue Jun 16 01:50:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,5,stable] py3: use `%d` for int in % formatting From: Manuel Jacob X-Patchwork-Id: 46510 Message-Id: <23c7b0389ff76d99d4fb.1592272228@tmp> To: mercurial-devel@mercurial-scm.org Date: Tue, 16 Jun 2020 03:50:28 +0200 # HG changeset patch # User Manuel Jacob # 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`. 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])