[PATCH] graphlog: use cmdutil.command decorator

Adrian Buehlmann adrian at cadifra.com
Thu May 12 14:49:14 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1305224855 -7200
# Node ID ddef02916e8b22d9d566ec77639f543bd600dfb0
# Parent  2850f03e0261463cb7f8959b2fad8abfe07947fc
graphlog: use cmdutil.command decorator

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -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()
 
+ at 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]')),
-}


More information about the Mercurial-devel mailing list