Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 11107:9c72c5c094aa
mq: add a line to hg summary
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 05 May 2010 20:53:45 -0500 |
parents | 37d1b20168d1 |
children | 2e270443a2c6 |
line wrap: on
line diff
--- a/hgext/mq.py Fri May 07 14:07:30 2010 -0500 +++ b/hgext/mq.py Wed May 05 20:53:45 2010 -0500 @@ -2662,10 +2662,26 @@ 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) + q = repo.mq + m = [] + a, u = len(q.applied), len(q.unapplied(repo)) + if a: + m.append(_("%d applied") % a) + if u: + m.append(_("%d unapplied") % u) + if m: + ui.write("mq: %s\n" % ', '.join(m)) + else: + ui.note("mq: (empty queue)\n") + return r + def uisetup(ui): mqopt = [('', 'mq', None, _("operate on patch repository"))] extensions.wrapcommand(commands.table, 'import', mqimport) + extensions.wrapcommand(commands.table, 'summary', summary) entry = extensions.wrapcommand(commands.table, 'init', mqinit) entry[1].extend(mqopt)