tests: define norepo in command decorator
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 04 May 2014 22:07:45 -0700
changeset 21773 26d2fb899637
parent 21772 5a4d1a6c605f
child 21774 b280d0b60bc3
tests: define norepo in command decorator
tests/test-commandserver.py
tests/test-extension.t
tests/test-help.t
tests/test-progress.t
--- a/tests/test-commandserver.py	Sun May 04 22:03:11 2014 -0700
+++ b/tests/test-commandserver.py	Sun May 04 22:07:45 2014 -0700
@@ -341,10 +341,9 @@
     check(mqoutsidechanges)
     dbg = open('dbgui.py', 'w')
     dbg.write('from mercurial import cmdutil, commands\n'
-              'commands.norepo += " debuggetpass"\n'
               'cmdtable = {}\n'
               'command = cmdutil.command(cmdtable)\n'
-              '@command("debuggetpass")\n'
+              '@command("debuggetpass", norepo=True)\n'
               'def debuggetpass(ui):\n'
               '    ui.write("%s\\n" % ui.getpass())\n')
     dbg.close()
--- a/tests/test-extension.t	Sun May 04 22:03:11 2014 -0700
+++ b/tests/test-extension.t	Sun May 04 22:07:45 2014 -0700
@@ -18,11 +18,10 @@
   > def foo(ui, *args, **kwargs):
   >     ui.write("Foo\\n")
   > 
-  > @command('bar', [], 'hg bar')
+  > @command('bar', [], 'hg bar', norepo=True)
   > def bar(ui, *args, **kwargs):
   >     ui.write("Bar\\n")
   > 
-  > commands.norepo += ' bar'
   > EOF
   $ abspath=`pwd`/foobar.py
 
@@ -481,11 +480,10 @@
   > command = cmdutil.command(cmdtable)
   > """multirevs extension
   > Big multi-line module docstring."""
-  > @command('multirevs', [], 'ARG')
+  > @command('multirevs', [], 'ARG', norepo=True)
   > def multirevs(ui, repo, arg, *args, **opts):
   >     """multirevs command"""
   >     pass
-  > commands.norepo += ' multirevs'
   > EOF
   $ echo "multirevs = multirevs.py" >> $HGRCPATH
 
@@ -537,12 +535,11 @@
   > cmdtable = {}
   > command = cmdutil.command(cmdtable)
   > 
-  > @command('debugextensions', [], 'hg debugextensions')
+  > @command('debugextensions', [], 'hg debugextensions', norepo=True)
   > def debugextensions(ui):
   >     "yet another debug command"
   >     ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
   > 
-  > commands.norepo += " debugextensions"
   > EOF
   $ echo "debugissue811 = $debugpath" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
@@ -631,11 +628,10 @@
   > command = cmdutil.command(cmdtable)
   > class Bogon(Exception): pass
   > 
-  > @command('throw', [], 'hg throw')
+  > @command('throw', [], 'hg throw', norepo=True)
   > def throw(ui, **opts):
   >     """throws an exception"""
   >     raise Bogon()
-  > commands.norepo += " throw"
   > EOF
 No declared supported version, extension complains:
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
--- a/tests/test-help.t	Sun May 04 22:03:11 2014 -0700
+++ b/tests/test-help.t	Sun May 04 22:07:45 2014 -0700
@@ -639,12 +639,12 @@
   >     [('', 'longdesc', 3, 'x'*90),
   >     ('n', '', None, 'normal desc'),
   >     ('', 'newline', '', 'line1\nline2')],
-  >     'hg nohelp')
+  >     'hg nohelp',
+  >     norepo=True)
   > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
   > def nohelp(ui, *args, **kwargs):
   >     pass
   > 
-  > commands.norepo += ' nohelp'
   > EOF
   $ echo '[extensions]' >> $HGRCPATH
   $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
--- a/tests/test-progress.t	Sun May 04 22:03:11 2014 -0700
+++ b/tests/test-progress.t	Sun May 04 22:07:45 2014 -0700
@@ -18,7 +18,8 @@
   >     [('', 'total', '', 'override for total'),
   >     ('', 'nested', False, 'show nested results'),
   >     ('', 'parallel', False, 'show parallel sets of results')],
-  >     'hg loop LOOPS')
+  >     'hg loop LOOPS',
+  >     norepo=True)
   > def loop(ui, loops, **opts):
   >     loops = int(loops)
   >     total = None
@@ -46,7 +47,6 @@
   >               'nested', None, 'nested.done', 'nestnum', nested_steps)
   >     ui.progress('loop', None, 'loop.done', 'loopnum', total)
   > 
-  > commands.norepo += " loop"
   > EOF
 
   $ cp $HGRCPATH $HGRCPATH.orig