Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
11106:213ca9ffcddb | 11107:9c72c5c094aa |
---|---|
2660 r = q.qrepo() | 2660 r = q.qrepo() |
2661 if not r: | 2661 if not r: |
2662 raise util.Abort('no queue repository') | 2662 raise util.Abort('no queue repository') |
2663 return orig(r.ui, r, *args, **kwargs) | 2663 return orig(r.ui, r, *args, **kwargs) |
2664 | 2664 |
2665 def summary(orig, ui, repo, *args, **kwargs): | |
2666 r = orig(ui, repo, *args, **kwargs) | |
2667 q = repo.mq | |
2668 m = [] | |
2669 a, u = len(q.applied), len(q.unapplied(repo)) | |
2670 if a: | |
2671 m.append(_("%d applied") % a) | |
2672 if u: | |
2673 m.append(_("%d unapplied") % u) | |
2674 if m: | |
2675 ui.write("mq: %s\n" % ', '.join(m)) | |
2676 else: | |
2677 ui.note("mq: (empty queue)\n") | |
2678 return r | |
2679 | |
2665 def uisetup(ui): | 2680 def uisetup(ui): |
2666 mqopt = [('', 'mq', None, _("operate on patch repository"))] | 2681 mqopt = [('', 'mq', None, _("operate on patch repository"))] |
2667 | 2682 |
2668 extensions.wrapcommand(commands.table, 'import', mqimport) | 2683 extensions.wrapcommand(commands.table, 'import', mqimport) |
2684 extensions.wrapcommand(commands.table, 'summary', summary) | |
2669 | 2685 |
2670 entry = extensions.wrapcommand(commands.table, 'init', mqinit) | 2686 entry = extensions.wrapcommand(commands.table, 'init', mqinit) |
2671 entry[1].extend(mqopt) | 2687 entry[1].extend(mqopt) |
2672 | 2688 |
2673 norepo = commands.norepo.split(" ") | 2689 norepo = commands.norepo.split(" ") |