py3: make sure commands name are bytes in tests
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 25 Jun 2017 08:20:05 +0530
changeset 33109 fce4ed2912bb
parent 33108 d9962854a4a2
child 33110 c4a20c9484e7
py3: make sure commands name are bytes in tests
tests/test-bad-extension.t
tests/test-bundle2-format.t
tests/test-chg.t
tests/test-commandserver.t
tests/test-devel-warnings.t
tests/test-encoding-align.t
tests/test-encoding-textwrap.t
tests/test-extension.t
tests/test-lock-badness.t
tests/test-logtoprocess.t
tests/test-obsolete.t
tests/test-pager-legacy.t
tests/test-pager.t
tests/test-profile.t
tests/test-progress.t
tests/test-rebuildstate.t
tests/test-resolve.t
tests/test-revset.t
tests/test-worker.t
--- a/tests/test-bad-extension.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-bad-extension.t	Sun Jun 25 08:20:05 2017 +0530
@@ -65,7 +65,7 @@
   > from mercurial import commands, extensions, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('showbadexts', norepo=True)
+  > @command(b'showbadexts', norepo=True)
   > def showbadexts(ui, *pats, **opts):
   >     ui.write('BADEXTS: %s\n' % ' '.join(sorted(extensions.notloaded())))
   > EOF
--- a/tests/test-bundle2-format.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-bundle2-format.t	Sun Jun 25 08:20:05 2017 +0530
@@ -70,7 +70,7 @@
   >             for val in op.reply.capabilities[cap]:
   >                 op.ui.write('debugreply:         %r\n' % val)
   > 
-  > @command('bundle2',
+  > @command(b'bundle2',
   >          [('', 'param', [], 'stream level parameter'),
   >           ('', 'unknown', False, 'include an unknown mandatory part in the bundle'),
   >           ('', 'unknownparams', False, 'include an unknown part parameters in the bundle'),
@@ -169,7 +169,7 @@
   >     finally:
   >         file.flush()
   > 
-  > @command('unbundle2', [], '')
+  > @command(b'unbundle2', [], '')
   > def cmdunbundle2(ui, repo, replypath=None):
   >     """process a bundle2 stream from stdin on the current repo"""
   >     try:
@@ -200,7 +200,7 @@
   >             for chunk in op.reply.getchunks():
   >                 file.write(chunk)
   > 
-  > @command('statbundle2', [], '')
+  > @command(b'statbundle2', [], '')
   > def cmdstatbundle2(ui, repo):
   >     """print statistic on the bundle2 container read from stdin"""
   >     unbundler = bundle2.getunbundler(ui, sys.stdin)
--- a/tests/test-chg.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-chg.t	Sun Jun 25 08:20:05 2017 +0530
@@ -108,7 +108,7 @@
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('crash')
+  > @command(b'crash')
   > def pagercrash(ui, repo, *pats, **opts):
   >     ui.write('going to crash\n')
   >     raise Exception('.')
--- a/tests/test-commandserver.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-commandserver.t	Sun Jun 25 08:20:05 2017 +0530
@@ -575,16 +575,16 @@
   > from mercurial import commands, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command("debuggetpass", norepo=True)
+  > @command(b"debuggetpass", norepo=True)
   > def debuggetpass(ui):
   >     ui.write("%s\\n" % ui.getpass())
-  > @command("debugprompt", norepo=True)
+  > @command(b"debugprompt", norepo=True)
   > def debugprompt(ui):
   >     ui.write("%s\\n" % ui.prompt("prompt:"))
-  > @command("debugreadstdin", norepo=True)
+  > @command(b"debugreadstdin", norepo=True)
   > def debugreadstdin(ui):
   >     ui.write("read: %r\n" % sys.stdin.read(1))
-  > @command("debugwritestdout", norepo=True)
+  > @command(b"debugwritestdout", norepo=True)
   > def debugwritestdout(ui):
   >     os.write(1, "low-level stdout fd and\n")
   >     sys.stdout.write("stdout should be redirected to /dev/null\n")
--- a/tests/test-devel-warnings.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-devel-warnings.t	Sun Jun 25 08:20:05 2017 +0530
@@ -203,7 +203,7 @@
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > 
-  > @command('buggyconfig')
+  > @command(b'buggyconfig')
   > def cmdbuggyconfig(ui, repo):
   >     repo.ui.config('ui', 'quiet', False)
   >     repo.ui.config('ui', 'interactive', None)
--- a/tests/test-encoding-align.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-encoding-align.t	Sun Jun 25 08:20:05 2017 +0530
@@ -20,7 +20,7 @@
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > 
-  > @command('showoptlist',
+  > @command(b'showoptlist',
   >     [('s', 'opt1', '', 'short width'  + ' %(s)s' * 8, '%(s)s'),
   >     ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'),
   >     ('l', 'opt3', '', 'long width'   + ' %(l)s' * 8, '%(l)s')],
--- a/tests/test-encoding-textwrap.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-encoding-textwrap.t	Sun Jun 25 08:20:05 2017 +0530
@@ -12,7 +12,7 @@
   > command = registrar.command(cmdtable)
   > 
   > # Japanese full-width characters:
-  > @command('show_full_ja', [], '')
+  > @command(b'show_full_ja', [], '')
   > def show_full_ja(ui, **opts):
   >     u'''\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051
   > 
@@ -22,7 +22,7 @@
   >     '''
   > 
   > # Japanese half-width characters:
-  > @command('show_half_ja', [], '')
+  > @command(b'show_half_ja', [], '')
   > def show_half_ja(ui, *opts):
   >     u'''\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79
   > 
@@ -32,7 +32,7 @@
   >     '''
   > 
   > # Japanese ambiguous-width characters:
-  > @command('show_ambig_ja', [], '')
+  > @command(b'show_ambig_ja', [], '')
   > def show_ambig_ja(ui, **opts):
   >     u'''\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb
   > 
@@ -42,7 +42,7 @@
   >     '''
   > 
   > # Russian ambiguous-width characters:
-  > @command('show_ambig_ru', [], '')
+  > @command(b'show_ambig_ru', [], '')
   > def show_ambig_ru(ui, **opts):
   >     u'''\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
   > 
--- a/tests/test-extension.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-extension.t	Sun Jun 25 08:20:05 2017 +0530
@@ -12,10 +12,10 @@
   >     ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
   >     ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
   >     ui.flush()
-  > @command('foo', [], 'hg foo')
+  > @command(b'foo', [], 'hg foo')
   > def foo(ui, *args, **kwargs):
   >     ui.write("Foo\\n")
-  > @command('bar', [], 'hg bar', norepo=True)
+  > @command(b'bar', [], 'hg bar', norepo=True)
   > def bar(ui, *args, **kwargs):
   >     ui.write("Bar\\n")
   > EOF
@@ -408,12 +408,12 @@
   > # preceding import (= instantiate "demandmod" object instead of
   > # real "module" object) might hide problem of succeeding import.
   > 
-  > @command('showabsolute', [], norepo=True)
+  > @command(b'showabsolute', [], norepo=True)
   > def showabsolute(ui, *args, **opts):
   >     from absextroot import absolute
   >     ui.write('ABS: %s\n' % '\nABS: '.join(absolute.getresult()))
   > 
-  > @command('showrelative', [], norepo=True)
+  > @command(b'showrelative', [], norepo=True)
   > def showrelative(ui, *args, **opts):
   >     from . import relative
   >     ui.write('REL: %s\n' % '\nREL: '.join(relative.getresult()))
@@ -470,7 +470,7 @@
   > # demand import avoids failure of importing notexist here
   > import extlibroot.lsub1.lsub2.notexist
   > 
-  > @command('checkrelativity', [], norepo=True)
+  > @command(b'checkrelativity', [], norepo=True)
   > def checkrelativity(ui, *args, **opts):
   >     try:
   >         ui.write(extlibroot.lsub1.lsub2.notexist.text)
@@ -509,11 +509,11 @@
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('debugfoobar', [], 'hg debugfoobar')
+  > @command(b'debugfoobar', [], 'hg debugfoobar')
   > def debugfoobar(ui, repo, *args, **opts):
   >     "yet another debug command"
   >     pass
-  > @command('foo', [], 'hg foo')
+  > @command(b'foo', [], 'hg foo')
   > def foo(ui, repo, *args, **opts):
   >     """yet another foo command
   >     This command has been DEPRECATED since forever.
@@ -750,7 +750,7 @@
   > command = registrar.command(cmdtable)
   > """multirevs extension
   > Big multi-line module docstring."""
-  > @command('multirevs', [], 'ARG', norepo=True)
+  > @command(b'multirevs', [], 'ARG', norepo=True)
   > def multirevs(ui, repo, arg, *args, **opts):
   >     """multirevs command"""
   >     pass
@@ -825,11 +825,11 @@
   > from mercurial import commands, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('dodo', [], 'hg dodo')
+  > @command(b'dodo', [], 'hg dodo')
   > def dodo(ui, *args, **kwargs):
   >     """Does nothing"""
   >     ui.write("I do nothing. Yay\\n")
-  > @command('foofoo', [], 'hg foofoo')
+  > @command(b'foofoo', [], 'hg foofoo')
   > def foofoo(ui, *args, **kwargs):
   >     """Writes 'Foo foo'"""
   >     ui.write("Foo foo\\n")
@@ -936,11 +936,11 @@
   > from mercurial import commands, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('something', [], 'hg something')
+  > @command(b'something', [], 'hg something')
   > def something(ui, *args, **kwargs):
   >     """Does something"""
   >     ui.write("I do something. Yaaay\\n")
-  > @command('beep', [], 'hg beep')
+  > @command(b'beep', [], 'hg beep')
   > def beep(ui, *args, **kwargs):
   >     """Writes 'Beep beep'"""
   >     ui.write("Beep beep\\n")
@@ -1180,7 +1180,7 @@
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > class Bogon(Exception): pass
-  > @command('throw', [], 'hg throw', norepo=True)
+  > @command(b'throw', [], 'hg throw', norepo=True)
   > def throw(ui, **opts):
   >     """throws an exception"""
   >     raise Bogon()
@@ -1617,7 +1617,7 @@
   > from mercurial import cmdutil
   > cmdtable = {}
   > command = cmdutil.command(cmdtable)
-  > @command('foo', [], norepo=True)
+  > @command(b'foo', [], norepo=True)
   > def foo(ui):
   >     pass
   > EOF
--- a/tests/test-lock-badness.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-lock-badness.t	Sun Jun 25 08:20:05 2017 +0530
@@ -26,7 +26,7 @@
   >     l = repo._lock(repo.vfs, 'testlock', False, unlock, None, 'test lock')
   >     return l
   > 
-  > @command('testlockexc')
+  > @command(b'testlockexc')
   > def testlockexc(ui, repo):
   >     testlock = acquiretestlock(repo, True)
   >     try:
--- a/tests/test-logtoprocess.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-logtoprocess.t	Sun Jun 25 08:20:05 2017 +0530
@@ -12,7 +12,7 @@
   > from time import sleep
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('foo', [])
+  > @command(b'foo', [])
   > def foo(ui, repo):
   >     ui.log('foo', 'a message: %(bar)s\n', bar='spam')
   > EOF
--- a/tests/test-obsolete.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-obsolete.t	Sun Jun 25 08:20:05 2017 +0530
@@ -1107,7 +1107,7 @@
   > 
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command("amendtransient",[], _('hg amendtransient [rev]'))
+  > @command(b"amendtransient",[], _('hg amendtransient [rev]'))
   > def amend(ui, repo, *pats, **opts):
   >   def commitfunc(ui, repo, message, match, opts):
   >     return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
--- a/tests/test-pager-legacy.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-pager-legacy.t	Sun Jun 25 08:20:05 2017 +0530
@@ -217,7 +217,7 @@
   > from mercurial import registrar, commands
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('fortytwo', [], 'fortytwo', norepo=True)
+  > @command(b'fortytwo', [], 'fortytwo', norepo=True)
   > def fortytwo(ui, *opts):
   >     ui.write('42\n')
   >     return 42
--- a/tests/test-pager.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-pager.t	Sun Jun 25 08:20:05 2017 +0530
@@ -230,7 +230,7 @@
   > from mercurial import commands, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('fortytwo', [], 'fortytwo', norepo=True)
+  > @command(b'fortytwo', [], 'fortytwo', norepo=True)
   > def fortytwo(ui, *opts):
   >     ui.write('42\n')
   >     return 42
--- a/tests/test-profile.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-profile.t	Sun Jun 25 08:20:05 2017 +0530
@@ -68,7 +68,7 @@
   > from mercurial import registrar, commands
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('sleep', [], 'hg sleep')
+  > @command(b'sleep', [], 'hg sleep')
   > def sleep(ui, *args, **kwargs):
   >     time.sleep(0.1)
   > EOF
--- a/tests/test-progress.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-progress.t	Sun Jun 25 08:20:05 2017 +0530
@@ -14,7 +14,7 @@
   >         return self._time
   > time.time = incrementingtime()
   > 
-  > @command('loop',
+  > @command(b'loop',
   >     [('', 'total', '', 'override for total'),
   >     ('', 'nested', False, 'show nested results'),
   >     ('', 'parallel', False, 'show parallel sets of results')],
--- a/tests/test-rebuildstate.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-rebuildstate.t	Sun Jun 25 08:20:05 2017 +0530
@@ -3,7 +3,7 @@
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('debugadddrop',
+  > @command(b'debugadddrop',
   >   [('', 'drop', False, 'drop file from dirstate', 'FILE'),
   >    ('', 'normal-lookup', False, 'add file to dirstate', 'FILE')],
   >     'hg debugadddrop')
--- a/tests/test-resolve.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-resolve.t	Sun Jun 25 08:20:05 2017 +0530
@@ -88,7 +88,7 @@
   > from mercurial import merge, registrar, scmutil
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('markdriver',
+  > @command(b'markdriver',
   >   [('u', 'unmark', None, '')],
   >   'FILE...')
   > def markdriver(ui, repo, *pats, **opts):
--- a/tests/test-revset.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-revset.t	Sun Jun 25 08:20:05 2017 +0530
@@ -45,7 +45,7 @@
   > )
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('debugrevlistspec',
+  > @command(b'debugrevlistspec',
   >     [('', 'optimize', None, 'print parsed tree after optimizing'),
   >      ('', 'bin', None, 'unhexlify arguments')])
   > def debugrevlistspec(ui, repo, fmt, *args, **opts):
--- a/tests/test-worker.t	Sun Jun 25 03:11:55 2017 +0530
+++ b/tests/test-worker.t	Sun Jun 25 08:20:05 2017 +0530
@@ -31,7 +31,7 @@
   > }
   > cmdtable = {}
   > command = registrar.command(cmdtable)
-  > @command('test', [], 'hg test [COST] [FUNC]')
+  > @command(b'test', [], 'hg test [COST] [FUNC]')
   > def t(ui, repo, cost=1.0, func='runme'):
   >     cost = float(cost)
   >     func = functable[func]