comparison tests/test-logtoprocess.t @ 32337:46ba2cdda476

registrar: move cmdutil.command to registrar module (API) cmdutil.command wasn't a member of the registrar framework only for a historical reason. Let's make that happen. This patch keeps cmdutil.command as an alias for extension compatibility.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jan 2016 23:07:20 +0900
parents 3844b3299a53
children 0afc4206d02b
comparison
equal deleted inserted replaced
32336:ff874d34c856 32337:46ba2cdda476
4 4
5 Test if logtoprocess correctly captures command-related log calls. 5 Test if logtoprocess correctly captures command-related log calls.
6 6
7 $ hg init 7 $ hg init
8 $ cat > $TESTTMP/foocommand.py << EOF 8 $ cat > $TESTTMP/foocommand.py << EOF
9 > from mercurial import cmdutil 9 > from mercurial import registrar
10 > from time import sleep 10 > from time import sleep
11 > cmdtable = {} 11 > cmdtable = {}
12 > command = cmdutil.command(cmdtable) 12 > command = registrar.command(cmdtable)
13 > @command('foo', []) 13 > @command('foo', [])
14 > def foo(ui, repo): 14 > def foo(ui, repo):
15 > ui.log('foo', 'a message: %(bar)s\n', bar='spam') 15 > ui.log('foo', 'a message: %(bar)s\n', bar='spam')
16 > EOF 16 > EOF
17 $ cp $HGRCPATH $HGRCPATH.bak 17 $ cp $HGRCPATH $HGRCPATH.bak