Mercurial > public > mercurial-scm > hg
diff tests/autodiff.py @ 21254:51e5c793a9f4
tests: declare commands using decorator
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 04 May 2014 22:48:07 -0700 |
parents | a08775ec89f2 |
children | f78192115229 |
line wrap: on
line diff
--- a/tests/autodiff.py Sun May 04 21:33:14 2014 -0700 +++ b/tests/autodiff.py Sun May 04 22:48:07 2014 -0700 @@ -1,8 +1,14 @@ # Extension dedicated to test patch.diff() upgrade modes # # -from mercurial import scmutil, patch, util +from mercurial import cmdutil, scmutil, patch, util +cmdtable = {} +command = cmdutil.command(cmdtable) + +@command('autodiff', + [('', 'git', '', 'git upgrade mode (yes/no/auto/warn/abort)')], + '[OPTION]... [FILE]...') def autodiff(ui, repo, *pats, **opts): diffopts = patch.diffopts(ui, opts) git = opts.get('git', 'no') @@ -36,11 +42,3 @@ ui.write(chunk) for fn in sorted(brokenfiles): ui.write(('data lost for: %s\n' % fn)) - -cmdtable = { - "autodiff": - (autodiff, - [('', 'git', '', 'git upgrade mode (yes/no/auto/warn/abort)'), - ], - '[OPTION]... [FILE]...'), -}