tests/autodiff.py
changeset 21254 51e5c793a9f4
parent 17956 a08775ec89f2
child 23692 f78192115229
--- 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]...'),
-}