comparison tests/test-revset2.t @ 41477:4caf56c33009

py3: have test-revset2.t write test scripts in a more portable way Fixes the test on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5763
author Augie Fackler <augie@google.com>
date Thu, 24 Jan 2019 16:07:32 -0500
parents 7ed611c60168
children f3365065ef1d
comparison
equal deleted inserted replaced
41476:fd2f1f0071b9 41477:4caf56c33009
1523 # u30C2 0x83 0x61(= 'a') 1523 # u30C2 0x83 0x61(= 'a')
1524 1524
1525 $ hg init problematicencoding 1525 $ hg init problematicencoding
1526 $ cd problematicencoding 1526 $ cd problematicencoding
1527 1527
1528 $ "$PYTHON" > setup.sh <<EOF 1528 $ "$PYTHON" <<EOF
1529 > print(u''' 1529 > open('setup.sh', 'wb').write(u'''
1530 > echo a > text 1530 > echo a > text
1531 > hg add text 1531 > hg add text
1532 > hg --encoding utf-8 commit -u '\u30A2' -m none 1532 > hg --encoding utf-8 commit -u '\u30A2' -m none
1533 > echo b > text 1533 > echo b > text
1534 > hg --encoding utf-8 commit -u '\u30C2' -m none 1534 > hg --encoding utf-8 commit -u '\u30C2' -m none
1539 > '''.encode('utf-8')) 1539 > '''.encode('utf-8'))
1540 > EOF 1540 > EOF
1541 $ sh < setup.sh 1541 $ sh < setup.sh
1542 1542
1543 test in problematic encoding 1543 test in problematic encoding
1544 $ "$PYTHON" > test.sh <<EOF 1544 $ "$PYTHON" <<EOF
1545 > print(u''' 1545 > open('test.sh', 'wb').write(u'''
1546 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' 1546 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
1547 > echo ==== 1547 > echo ====
1548 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' 1548 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
1549 > echo ==== 1549 > echo ====
1550 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' 1550 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'