D3564: py3: add b'' prefixes in tests/test-extension.t

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue May 15 16:41:45 EDT 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  1. skip-blame because just b'' prefixes

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3564

AFFECTED FILES
  tests/test-extension.t

CHANGE DETAILS

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -460,7 +460,7 @@
   >     result.append(absdetail)
   >     result.append(legacydetail)
   >     result.append(proxied.detail)
-  >     ui.write('LIB: %s\n' % '\nLIB: '.join(result))
+  >     ui.write(b'LIB: %s\n' % '\nLIB: '.join(result))
   > EOF
 
 Examine module importing.
@@ -1283,7 +1283,7 @@
 
 If the extensions declare outdated versions, accuse the older extension first:
   $ echo "from mercurial import util" >> older.py
-  $ echo "util.version = lambda:'2.2'" >> older.py
+  $ echo "util.version = lambda:b'2.2'" >> older.py
   $ echo "testedwith = b'1.9.3'" >> older.py
   $ echo "testedwith = b'2.1.1'" >> throw.py
   $ rm -f throw.pyc throw.pyo
@@ -1388,7 +1388,7 @@
   Enabled extensions:
   
     throw  external  1.2.3
-  $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
+  $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
   $ rm -f throw.pyc throw.pyo
   $ rm -Rf __pycache__
   $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
@@ -1678,7 +1678,7 @@
   > def exbookmarks(orig, *args, **opts):
   >     return orig(*args, **opts)
   > def uisetup(ui):
-  >     synopsis = ' GREPME [--foo] [-x]'
+  >     synopsis = b' GREPME [--foo] [-x]'
   >     docstring = '''
   >     GREPME make sure that this is in the help!
   >     '''
@@ -1713,9 +1713,9 @@
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command(b'dummy', [('', 'opt', u'value', u'help')], 'ext [OPTIONS]')
+  > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
   > def ext(*args, **opts):
-  >     print(opts['opt'])
+  >     print(opts[b'opt'])
   > EOF
   $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
   > [extensions]



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list