comparison tests/test-obsolete.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 3546a771e376
children f432897a9f49
comparison
equal deleted inserted replaced
32336:ff874d34c856 32337:46ba2cdda476
1063 #endif 1063 #endif
1064 1064
1065 Test heads computation on pending index changes with obsolescence markers 1065 Test heads computation on pending index changes with obsolescence markers
1066 $ cd .. 1066 $ cd ..
1067 $ cat >$TESTTMP/test_extension.py << EOF 1067 $ cat >$TESTTMP/test_extension.py << EOF
1068 > from mercurial import cmdutil 1068 > from mercurial import cmdutil, registrar
1069 > from mercurial.i18n import _ 1069 > from mercurial.i18n import _
1070 > 1070 >
1071 > cmdtable = {} 1071 > cmdtable = {}
1072 > command = cmdutil.command(cmdtable) 1072 > command = registrar.command(cmdtable)
1073 > @command("amendtransient",[], _('hg amendtransient [rev]')) 1073 > @command("amendtransient",[], _('hg amendtransient [rev]'))
1074 > def amend(ui, repo, *pats, **opts): 1074 > def amend(ui, repo, *pats, **opts):
1075 > def commitfunc(ui, repo, message, match, opts): 1075 > def commitfunc(ui, repo, message, match, opts):
1076 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match) 1076 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
1077 > opts['message'] = 'Test' 1077 > opts['message'] = 'Test'