D2621: tests: port test-log to Python 3
This revision was automatically updated to reflect the committed changes. Closed by commit rHG19e859cad54c: tests: port test-log to Python 3 (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2621?vs=6545=6549 REVISION DETAIL https://phab.mercurial-scm.org/D2621 AFFECTED FILES contrib/python3-whitelist tests/test-log.t CHANGE DETAILS diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -2016,33 +2016,31 @@ $ hg init problematicencoding $ cd problematicencoding - $ $PYTHON > setup.sh < print(u''' - > echo a > text - > hg add text - > hg --encoding utf-8 commit -u '\u30A2' -m none - > echo b > text - > hg --encoding utf-8 commit -u '\u30C2' -m none - > echo c > text - > hg --encoding utf-8 commit -u none -m '\u30A2' - > echo d > text - > hg --encoding utf-8 commit -u none -m '\u30C2' - > '''.encode('utf-8')) - > EOF + >>> with open('setup.sh', 'wb') as f: + ... f.write(u''' + ... echo a > text + ... hg add text + ... hg --encoding utf-8 commit -u '\u30A2' -m none + ... echo b > text + ... hg --encoding utf-8 commit -u '\u30C2' -m none + ... echo c > text + ... hg --encoding utf-8 commit -u none -m '\u30A2' + ... echo d > text + ... hg --encoding utf-8 commit -u none -m '\u30C2' + ... '''.encode('utf-8')) and None $ sh < setup.sh test in problematic encoding - $ $PYTHON > test.sh < print(u''' - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' - > '''.encode('cp932')) - > EOF + >>> with open('test.sh', 'wb') as f: + ... f.write(u''' + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' + ... '''.encode('cp932')) and None $ sh < test.sh 0 @@ -2255,14 +2253,14 @@ > from mercurial import namespaces > > def reposetup(ui, repo): - > foo = {'foo': repo[0].node()} + > foo = {b'foo': repo[0].node()} > names = lambda r: foo.keys() > namemap = lambda r, name: foo.get(name) > nodemap = lambda r, node: [name for name, n in foo.items() >if n == node] > ns = namespaces.namespace( - > "bars", templatename="bar", logname="barlog", - > colorname="barcolor", listnames=names, namemap=namemap, + > b"bars", templatename=b"bar", logname=b"barlog", + > colorname=b"barcolor", listnames=names, namemap=namemap, > nodemap=nodemap) > > repo.names.addnamespace(ns) diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -172,6 +172,7 @@ test-largefiles-small-disk.t test-locate.t test-lock-badness.t +test-log.t test-logexchange.t test-lrucachedict.py test-mactext.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2621: tests: port test-log to Python 3
durin42 updated this revision to Diff 6545. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2621?vs=6513=6545 REVISION DETAIL https://phab.mercurial-scm.org/D2621 AFFECTED FILES contrib/python3-whitelist tests/test-log.t CHANGE DETAILS diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -2016,33 +2016,31 @@ $ hg init problematicencoding $ cd problematicencoding - $ $PYTHON > setup.sh < print(u''' - > echo a > text - > hg add text - > hg --encoding utf-8 commit -u '\u30A2' -m none - > echo b > text - > hg --encoding utf-8 commit -u '\u30C2' -m none - > echo c > text - > hg --encoding utf-8 commit -u none -m '\u30A2' - > echo d > text - > hg --encoding utf-8 commit -u none -m '\u30C2' - > '''.encode('utf-8')) - > EOF + >>> with open('setup.sh', 'wb') as f: + ... f.write(u''' + ... echo a > text + ... hg add text + ... hg --encoding utf-8 commit -u '\u30A2' -m none + ... echo b > text + ... hg --encoding utf-8 commit -u '\u30C2' -m none + ... echo c > text + ... hg --encoding utf-8 commit -u none -m '\u30A2' + ... echo d > text + ... hg --encoding utf-8 commit -u none -m '\u30C2' + ... '''.encode('utf-8')) and None $ sh < setup.sh test in problematic encoding - $ $PYTHON > test.sh < print(u''' - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' - > '''.encode('cp932')) - > EOF + >>> with open('test.sh', 'wb') as f: + ... f.write(u''' + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' + ... '''.encode('cp932')) and None $ sh < test.sh 0 @@ -2255,14 +2253,14 @@ > from mercurial import namespaces > > def reposetup(ui, repo): - > foo = {'foo': repo[0].node()} + > foo = {b'foo': repo[0].node()} > names = lambda r: foo.keys() > namemap = lambda r, name: foo.get(name) > nodemap = lambda r, node: [name for name, n in foo.items() >if n == node] > ns = namespaces.namespace( - > "bars", templatename="bar", logname="barlog", - > colorname="barcolor", listnames=names, namemap=namemap, + > b"bars", templatename=b"bar", logname=b"barlog", + > colorname=b"barcolor", listnames=names, namemap=namemap, > nodemap=nodemap) > > repo.names.addnamespace(ns) diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -172,6 +172,7 @@ test-largefiles-small-disk.t test-locate.t test-lock-badness.t +test-log.t test-logexchange.t test-lrucachedict.py test-mactext.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2621: tests: port test-log to Python 3
pulkit requested changes to this revision. pulkit added a comment. This revision now requires changes to proceed. Sorry, but this does not passes for me on Python 3.5 Do we consider supporting that? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2621 To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2621: tests: port test-log to Python 3
durin42 created this revision. Herald added a reviewer: pulkit. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Required some porting to >>> inline Python instead of using heredocs into $PYTHON. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2621 AFFECTED FILES contrib/python3-whitelist tests/test-log.t CHANGE DETAILS diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -2016,33 +2016,31 @@ $ hg init problematicencoding $ cd problematicencoding - $ $PYTHON > setup.sh < print(u''' - > echo a > text - > hg add text - > hg --encoding utf-8 commit -u '\u30A2' -m none - > echo b > text - > hg --encoding utf-8 commit -u '\u30C2' -m none - > echo c > text - > hg --encoding utf-8 commit -u none -m '\u30A2' - > echo d > text - > hg --encoding utf-8 commit -u none -m '\u30C2' - > '''.encode('utf-8')) - > EOF + >>> with open('setup.sh', 'wb') as f: + ... f.write(u''' + ... echo a > text + ... hg add text + ... hg --encoding utf-8 commit -u '\u30A2' -m none + ... echo b > text + ... hg --encoding utf-8 commit -u '\u30C2' -m none + ... echo c > text + ... hg --encoding utf-8 commit -u none -m '\u30A2' + ... echo d > text + ... hg --encoding utf-8 commit -u none -m '\u30C2' + ... '''.encode('utf-8')) and None $ sh < setup.sh test in problematic encoding - $ $PYTHON > test.sh < print(u''' - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' - > echo - > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' - > '''.encode('cp932')) - > EOF + >>> with open('test.sh', 'wb') as f: + ... f.write(u''' + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2' + ... echo + ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2' + ... '''.encode('cp932')) and None $ sh < test.sh 0 @@ -2255,14 +2253,14 @@ > from mercurial import namespaces > > def reposetup(ui, repo): - > foo = {'foo': repo[0].node()} + > foo = {b'foo': repo[0].node()} > names = lambda r: foo.keys() > namemap = lambda r, name: foo.get(name) > nodemap = lambda r, node: [name for name, n in foo.items() >if n == node] > ns = namespaces.namespace( - > "bars", templatename="bar", logname="barlog", - > colorname="barcolor", listnames=names, namemap=namemap, + > b"bars", templatename=b"bar", logname=b"barlog", + > colorname=b"barcolor", listnames=names, namemap=namemap, > nodemap=nodemap) > > repo.names.addnamespace(ns) diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -172,6 +172,7 @@ test-largefiles-small-disk.t test-locate.t test-lock-badness.t +test-log.t test-logexchange.t test-lrucachedict.py test-mactext.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel