changeset 33756:20ca19e6c74e

py3: use r'' to access values from kwargs where keys are str These are the cases where either args is again passed as keyword argument or 1 or 2 elements are accessed. So it's better to add an r'' to prevent it converting to bytes rather than doing the conversion of args.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 21 Jun 2017 02:13:34 +0530
parents 26e710f0468f
children 8779d35c168d
files mercurial/templatekw.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -286,7 +286,7 @@
     """String. The name of the branch on which the changeset was
     committed.
     """
-    return args['ctx'].branch()
+    return args[r'ctx'].branch()
 
 @templatekeyword('branches')
 def showbranches(**args):
@@ -332,8 +332,8 @@
 def showactivebookmark(**args):
     """String. The active bookmark, if it is
     associated with the changeset"""
-    active = args['repo']._activebookmark
-    if active and active in args['ctx'].bookmarks():
+    active = args[r'repo']._activebookmark
+    if active and active in args[r'ctx'].bookmarks():
         return active
     return ''
 
@@ -516,7 +516,7 @@
 def _showchangessincetag(repo, ctx, **args):
     offset = 0
     revs = [ctx.rev()]
-    tag = args['tag']
+    tag = args[r'tag']
 
     # The only() revset doesn't currently support wdir()
     if ctx.rev() is None:
@@ -527,14 +527,14 @@
 
 @templatekeyword('manifest')
 def showmanifest(**args):
-    repo, ctx, templ = args['repo'], args['ctx'], args['templ']
+    repo, ctx, templ = args[r'repo'], args[r'ctx'], args[r'templ']
     mnode = ctx.manifestnode()
     if mnode is None:
         # just avoid crash, we might want to use the 'ff...' hash in future
         return
     args = args.copy()
-    args.update({'rev': repo.manifestlog._revlog.rev(mnode),
-                 'node': hex(mnode)})
+    args.update({r'rev': repo.manifestlog._revlog.rev(mnode),
+                 r'node': hex(mnode)})
     return templ('manifest', **args)
 
 def shownames(namespace, **args):