graphlog: use cmdutil.command decorator
authorAdrian Buehlmann <adrian@cadifra.com>
Thu, 12 May 2011 20:27:35 +0200
changeset 14311 9bbac962f4dd
parent 14310 c16ec14d44b6
child 14312 ba883fa211f3
graphlog: use cmdutil.command decorator
hgext/graphlog.py
--- a/hgext/graphlog.py	Thu May 12 20:14:42 2011 +0200
+++ b/hgext/graphlog.py	Thu May 12 20:27:35 2011 +0200
@@ -19,6 +19,9 @@
 from mercurial import cmdutil, commands, extensions
 from mercurial import hg, util, graphmod
 
+cmdtable = {}
+command = cmdutil.command(cmdtable)
+
 ASCIIDATA = 'ASC'
 
 def asciiedges(type, char, lines, seen, rev, parents):
@@ -302,6 +305,13 @@
             ascii(ui, state, type, char, lines, coldata)
     displayer.close()
 
+@command('glog',
+    [('l', 'limit', '',
+     _('limit number of changes displayed'), _('NUM')),
+    ('p', 'patch', False, _('show patch')),
+    ('r', 'rev', [], _('show the specified revision or range'), _('REV')),
+    ] + templateopts,
+    _('hg glog [OPTION]... [FILE]'))
 def graphlog(ui, repo, *pats, **opts):
     """show revision history alongside an ASCII revision graph
 
@@ -385,15 +395,3 @@
         return orig(*args, **kwargs)
     entry = extensions.wrapcommand(table, cmd, graph)
     entry[1].append(('G', 'graph', None, _("show the revision DAG")))
-
-cmdtable = {
-    "glog":
-        (graphlog,
-         [('l', 'limit', '',
-           _('limit number of changes displayed'), _('NUM')),
-          ('p', 'patch', False, _('show patch')),
-          ('r', 'rev', [],
-           _('show the specified revision or range'), _('REV')),
-         ] + templateopts,
-         _('hg glog [OPTION]... [FILE]')),
-}