Mercurial > hg
comparison tests/test-help.t @ 32545:37863db50414
tests: port test extension in test-help.t to python 3
The changes required herein suggest to me that we should probably
accept ascii-safe unicode strings for command name, flag name, etc.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sun, 28 May 2017 15:42:05 -0400 |
parents | 46ba2cdda476 |
children | cba4461aa0a0 |
comparison
equal
deleted
inserted
replaced
32544:e9f456183402 | 32545:37863db50414 |
---|---|
683 > from mercurial import commands, registrar | 683 > from mercurial import commands, registrar |
684 > | 684 > |
685 > cmdtable = {} | 685 > cmdtable = {} |
686 > command = registrar.command(cmdtable) | 686 > command = registrar.command(cmdtable) |
687 > | 687 > |
688 > @command('nohelp', | 688 > @command(b'nohelp', |
689 > [('', 'longdesc', 3, 'x'*90), | 689 > [(b'', b'longdesc', 3, b'x'*90), |
690 > ('n', '', None, 'normal desc'), | 690 > (b'n', b'', None, b'normal desc'), |
691 > ('', 'newline', '', 'line1\nline2')], | 691 > (b'', b'newline', b'', b'line1\nline2')], |
692 > 'hg nohelp', | 692 > b'hg nohelp', |
693 > norepo=True) | 693 > norepo=True) |
694 > @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')]) | 694 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) |
695 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')]) | 695 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) |
696 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')]) | 696 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) |
697 > def nohelp(ui, *args, **kwargs): | 697 > def nohelp(ui, *args, **kwargs): |
698 > pass | 698 > pass |
699 > | 699 > |
700 > def uisetup(ui): | 700 > def uisetup(ui): |
701 > ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext') | 701 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') |
702 > ui.setconfig('alias', 'hgalias', 'summary', 'helpext') | 702 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') |
703 > | 703 > |
704 > EOF | 704 > EOF |
705 $ echo '[extensions]' >> $HGRCPATH | 705 $ echo '[extensions]' >> $HGRCPATH |
706 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH | 706 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
707 | 707 |