changeset 33:fa743d5b8698

Use the @command decorator in verlist.py
author mr
date Tue, 06 Mar 2018 09:18:50 -0800
parents eb125f25a40f
children 15882341bf0f
files tests/verlist.py
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tests/verlist.py	Tue Mar 06 09:18:45 2018 -0800
+++ b/tests/verlist.py	Tue Mar 06 09:18:50 2018 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 # 
 # This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 """
 
-from mercurial import commands
+from mercurial import cmdutil
 from mercurial import context
 from mercurial import ui
 from mercurial.i18n import _
@@ -73,6 +73,13 @@
         tags.append(lastmicro)
     return tags
 
+cmdtable = { }
+command = cmdutil.command(cmdtable)
+
+@command('verlist',
+         [('l', 'lastmicro', None,
+           _('list only the last micro version in a minor version family'))],
+         _('[rev_range] ...'))
 def verlist(ui, repo, *pats, **opts):
     """List the tags in a repo, separated by spaces.
 
@@ -94,11 +101,3 @@
         tags = _lastmicro(tags)
     ui.write(' '.join(tags))
     ui.write('\n')
-
-cmdtable = {
-    '^verlist':
-        (verlist,
-         [('l', 'lastmicro', None,
-           _('list only the last micro version in a minor version family'))],
-         _('[rev_range] ...'))
-    }