##// END OF EJS Templates
mq: switch to new summary hook mechanism
Bryan O'Sullivan -
r19212:d0ba7022 default
parent child Browse files
Show More
@@ -3533,8 +3533,7 def mqcommand(orig, ui, repo, *args, **k
3533 raise util.Abort(_('no queue repository'))
3533 raise util.Abort(_('no queue repository'))
3534 return orig(r.ui, r, *args, **kwargs)
3534 return orig(r.ui, r, *args, **kwargs)
3535
3535
3536 def summary(orig, ui, repo, *args, **kwargs):
3536 def summaryhook(ui, repo):
3537 r = orig(ui, repo, *args, **kwargs)
3538 q = repo.mq
3537 q = repo.mq
3539 m = []
3538 m = []
3540 a, u = len(q.applied), len(q.unapplied(repo))
3539 a, u = len(q.applied), len(q.unapplied(repo))
@@ -3548,7 +3547,6 def summary(orig, ui, repo, *args, **kwa
3548 else:
3547 else:
3549 # i18n: column positioning for "hg summary"
3548 # i18n: column positioning for "hg summary"
3550 ui.note(_("mq: (empty queue)\n"))
3549 ui.note(_("mq: (empty queue)\n"))
3551 return r
3552
3550
3553 def revsetmq(repo, subset, x):
3551 def revsetmq(repo, subset, x):
3554 """``mq()``
3552 """``mq()``
@@ -3567,7 +3565,7 def extsetup(ui):
3567 mqopt = [('', 'mq', None, _("operate on patch repository"))]
3565 mqopt = [('', 'mq', None, _("operate on patch repository"))]
3568
3566
3569 extensions.wrapcommand(commands.table, 'import', mqimport)
3567 extensions.wrapcommand(commands.table, 'import', mqimport)
3570 extensions.wrapcommand(commands.table, 'summary', summary)
3568 cmdutil.summaryhooks.add('mq', summaryhook)
3571
3569
3572 entry = extensions.wrapcommand(commands.table, 'init', mqinit)
3570 entry = extensions.wrapcommand(commands.table, 'init', mqinit)
3573 entry[1].extend(mqopt)
3571 entry[1].extend(mqopt)
General Comments 0
You need to be logged in to leave comments. Login now