# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1498075147 -19800 # Node ID f66be4caeaab4afbe61c548eff65796d3c7c9bd8 # Parent 80a5d237a4aef55430f0108958b68278c8b630f3 py3: use "%d" % val for int rather than pycompat.bytestr Earlier I used pycompat.bytestr() to convert integers to bytes, but we can do b"%d" % val to convert that int to bytes. b'' is already added by the transformer. Thanks to Yuya for suggesting this. diff -r 80a5d237a4ae -r f66be4caeaab mercurial/commands.py --- a/mercurial/commands.py Fri Jun 23 10:59:05 2017 -0700 +++ b/mercurial/commands.py Thu Jun 22 01:29:07 2017 +0530 @@ -2774,8 +2774,7 @@ ('+'.join([hexfunc(p.node()) for p in parents]), changed)] if num: output.append("%s%s" % - ('+'.join([pycompat.bytestr(p.rev()) for p in parents]), - changed)) + ('+'.join(["%d" % p.rev() for p in parents]), changed)) else: if default or id: output = [hexfunc(ctx.node())] diff -r 80a5d237a4ae -r f66be4caeaab mercurial/templatekw.py --- a/mercurial/templatekw.py Fri Jun 23 10:59:05 2017 -0700 +++ b/mercurial/templatekw.py Thu Jun 22 01:29:07 2017 +0530 @@ -623,7 +623,7 @@ ctx = args['ctx'] pctxs = scmutil.meaningfulparents(repo, ctx) # ifcontains() needs a list of str - prevs = [pycompat.bytestr(p.rev()) for p in pctxs] + prevs = ["%d" % p.rev() for p in pctxs] parents = [[('rev', p.rev()), ('node', p.hex()), ('phase', p.phasestr())] @@ -653,7 +653,7 @@ args = pycompat.byteskwargs(args) repo = args['ctx'].repo() # ifcontains() needs a list of str - revs = [pycompat.bytestr(r) for r in revs] + revs = ["%d" % r for r in revs] f = _showlist(name, revs, args) return _hybrid(f, revs, lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},