mq: switch to new summary hook mechanism
authorBryan O'Sullivan <bryano@fb.com>
Tue, 14 May 2013 11:23:16 -0700
changeset 19212 d0ba7022c13b
parent 19211 3bfd7f1e7485
child 19213 f324a9b8d4bf
mq: switch to new summary hook mechanism
hgext/mq.py
--- a/hgext/mq.py	Tue May 14 11:23:15 2013 -0700
+++ b/hgext/mq.py	Tue May 14 11:23:16 2013 -0700
@@ -3533,8 +3533,7 @@
         raise util.Abort(_('no queue repository'))
     return orig(r.ui, r, *args, **kwargs)
 
-def summary(orig, ui, repo, *args, **kwargs):
-    r = orig(ui, repo, *args, **kwargs)
+def summaryhook(ui, repo):
     q = repo.mq
     m = []
     a, u = len(q.applied), len(q.unapplied(repo))
@@ -3548,7 +3547,6 @@
     else:
         # i18n: column positioning for "hg summary"
         ui.note(_("mq:     (empty queue)\n"))
-    return r
 
 def revsetmq(repo, subset, x):
     """``mq()``
@@ -3567,7 +3565,7 @@
     mqopt = [('', 'mq', None, _("operate on patch repository"))]
 
     extensions.wrapcommand(commands.table, 'import', mqimport)
-    extensions.wrapcommand(commands.table, 'summary', summary)
+    cmdutil.summaryhooks.add('mq', summaryhook)
 
     entry = extensions.wrapcommand(commands.table, 'init', mqinit)
     entry[1].extend(mqopt)