Patchwork [07,of,10] py3: mark all string literals in test-command-template.t as bytes

login
register
mail settings
Submitter Yuya Nishihara
Date March 2, 2018, 12:26 a.m.
Message ID <ebad609de255394be78d.1519950386@mimosa>
Download mbox | patch
Permalink /patch/28631/
State Accepted
Headers show

Comments

Yuya Nishihara - March 2, 2018, 12:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1519944205 18000
#      Thu Mar 01 17:43:25 2018 -0500
# Node ID ebad609de255394be78d234e76a61426776e54ae
# Parent  1d65b2d4de6f87f079ae9d29843ee5e8fb675a23
py3: mark all string literals in test-command-template.t as bytes

# skip-blame because just b'' prefixes

Patch

diff --git a/tests/revnamesext.py b/tests/revnamesext.py
--- a/tests/revnamesext.py
+++ b/tests/revnamesext.py
@@ -7,12 +7,12 @@  from mercurial import (
 )
 
 def reposetup(ui, repo):
-    names = {'r%d' % rev: repo[rev].node() for rev in repo}
+    names = {b'r%d' % rev: repo[rev].node() for rev in repo}
     namemap = lambda r, name: names.get(name)
-    nodemap = lambda r, node: ['r%d' % repo[node].rev()]
+    nodemap = lambda r, node: [b'r%d' % repo[node].rev()]
 
-    ns = namespaces.namespace('revnames', templatename='revname',
-                              logname='revname',
+    ns = namespaces.namespace(b'revnames', templatename=b'revname',
+                              logname=b'revname',
                               listnames=lambda r: names.keys(),
                               namemap=namemap, nodemap=nodemap)
     repo.names.addnamespace(ns)
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -4622,9 +4622,9 @@  Test that template function in extension
   > 
   > templatefunc = registrar.templatefunc()
   > 
-  > @templatefunc('custom()')
+  > @templatefunc(b'custom()')
   > def custom(context, mapping, args):
-  >     return 'custom'
+  >     return b'custom'
   > EOF
   $ cat <<EOF > .hg/hgrc
   > [extensions]