diff mercurial/templatekw.py @ 32992:8779d35c168d

py3: use pycompat.bytestr() in place of str()
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 21 Jun 2017 02:20:34 +0530
parents 20ca19e6c74e
children f66be4caeaab
line wrap: on
line diff
--- a/mercurial/templatekw.py	Wed Jun 21 02:13:34 2017 +0530
+++ b/mercurial/templatekw.py	Wed Jun 21 02:20:34 2017 +0530
@@ -622,7 +622,8 @@
     repo = args['repo']
     ctx = args['ctx']
     pctxs = scmutil.meaningfulparents(repo, ctx)
-    prevs = [str(p.rev()) for p in pctxs]  # ifcontains() needs a list of str
+    # ifcontains() needs a list of str
+    prevs = [pycompat.bytestr(p.rev()) for p in pctxs]
     parents = [[('rev', p.rev()),
                 ('node', p.hex()),
                 ('phase', p.phasestr())]
@@ -651,7 +652,8 @@
     be evaluated"""
     args = pycompat.byteskwargs(args)
     repo = args['ctx'].repo()
-    revs = [str(r) for r in revs]  # ifcontains() needs a list of str
+    # ifcontains() needs a list of str
+    revs = [pycompat.bytestr(r) for r in revs]
     f = _showlist(name, revs, args)
     return _hybrid(f, revs,
                    lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},