comparison tests/test-extension.t @ 38018:a9ffb4a577d0

py3: add b'' prefixes in tests/test-extension.t # skip-blame because just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3564
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 15 Feb 2018 17:15:21 +0530
parents 8ba0344f9fb1
children bdf344aea0ee
comparison
equal deleted inserted replaced
38017:6660b90805c6 38018:a9ffb4a577d0
458 > result.append(lused.detail) 458 > result.append(lused.detail)
459 > result.append(lfunc()) 459 > result.append(lfunc())
460 > result.append(absdetail) 460 > result.append(absdetail)
461 > result.append(legacydetail) 461 > result.append(legacydetail)
462 > result.append(proxied.detail) 462 > result.append(proxied.detail)
463 > ui.write('LIB: %s\n' % '\nLIB: '.join(result)) 463 > ui.write(b'LIB: %s\n' % '\nLIB: '.join(result))
464 > EOF 464 > EOF
465 465
466 Examine module importing. 466 Examine module importing.
467 467
468 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute) 468 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
1281 ** Mercurial Distributed SCM (*) (glob) 1281 ** Mercurial Distributed SCM (*) (glob)
1282 ** Extensions loaded: throw 1282 ** Extensions loaded: throw
1283 1283
1284 If the extensions declare outdated versions, accuse the older extension first: 1284 If the extensions declare outdated versions, accuse the older extension first:
1285 $ echo "from mercurial import util" >> older.py 1285 $ echo "from mercurial import util" >> older.py
1286 $ echo "util.version = lambda:'2.2'" >> older.py 1286 $ echo "util.version = lambda:b'2.2'" >> older.py
1287 $ echo "testedwith = b'1.9.3'" >> older.py 1287 $ echo "testedwith = b'1.9.3'" >> older.py
1288 $ echo "testedwith = b'2.1.1'" >> throw.py 1288 $ echo "testedwith = b'2.1.1'" >> throw.py
1289 $ rm -f throw.pyc throw.pyo 1289 $ rm -f throw.pyc throw.pyo
1290 $ rm -Rf __pycache__ 1290 $ rm -Rf __pycache__
1291 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ 1291 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1386 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 1386 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1387 1387
1388 Enabled extensions: 1388 Enabled extensions:
1389 1389
1390 throw external 1.2.3 1390 throw external 1.2.3
1391 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py 1391 $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
1392 $ rm -f throw.pyc throw.pyo 1392 $ rm -f throw.pyc throw.pyo
1393 $ rm -Rf __pycache__ 1393 $ rm -Rf __pycache__
1394 $ hg version -v --config extensions.throw=throw.py --config extensions.strip= 1394 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1395 Mercurial Distributed SCM (version *) (glob) 1395 Mercurial Distributed SCM (version *) (glob)
1396 (see https://mercurial-scm.org for more information) 1396 (see https://mercurial-scm.org for more information)
1676 $ cat > exthelp.py <<EOF 1676 $ cat > exthelp.py <<EOF
1677 > from mercurial import commands, extensions 1677 > from mercurial import commands, extensions
1678 > def exbookmarks(orig, *args, **opts): 1678 > def exbookmarks(orig, *args, **opts):
1679 > return orig(*args, **opts) 1679 > return orig(*args, **opts)
1680 > def uisetup(ui): 1680 > def uisetup(ui):
1681 > synopsis = ' GREPME [--foo] [-x]' 1681 > synopsis = b' GREPME [--foo] [-x]'
1682 > docstring = ''' 1682 > docstring = '''
1683 > GREPME make sure that this is in the help! 1683 > GREPME make sure that this is in the help!
1684 > ''' 1684 > '''
1685 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks, 1685 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks,
1686 > synopsis, docstring) 1686 > synopsis, docstring)
1711 1711
1712 $ cat > $TESTTMP/test_unicode_default_value.py << EOF 1712 $ cat > $TESTTMP/test_unicode_default_value.py << EOF
1713 > from mercurial import registrar 1713 > from mercurial import registrar
1714 > cmdtable = {} 1714 > cmdtable = {}
1715 > command = registrar.command(cmdtable) 1715 > command = registrar.command(cmdtable)
1716 > @command(b'dummy', [('', 'opt', u'value', u'help')], 'ext [OPTIONS]') 1716 > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
1717 > def ext(*args, **opts): 1717 > def ext(*args, **opts):
1718 > print(opts['opt']) 1718 > print(opts[b'opt'])
1719 > EOF 1719 > EOF
1720 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF 1720 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1721 > [extensions] 1721 > [extensions]
1722 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py 1722 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1723 > EOF 1723 > EOF