##// END OF EJS Templates
mq: add a line to hg summary
Matt Mackall -
r11107:9c72c5c0 default
parent child Browse files
Show More
@@ -2662,10 +2662,26 b' def mqcommand(orig, ui, repo, *args, **k'
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)
@@ -170,7 +170,9 b' COLUMNS=4 hg qseries --config ui.interac'
170 COLUMNS=20 hg qseries --config ui.interactive=true -vs
170 COLUMNS=20 hg qseries --config ui.interactive=true -vs
171 hg qpop
171 hg qpop
172 hg qseries -vs
172 hg qseries -vs
173 hg sum
173 hg qpush
174 hg qpush
175 hg sum
174
176
175 echo % qapplied
177 echo % qapplied
176 hg qapplied
178 hg qapplied
@@ -151,8 +151,20 b' popping test2.patch'
151 now at: test.patch
151 now at: test.patch
152 0 A test.patch: foo bar
152 0 A test.patch: foo bar
153 1 U test2.patch:
153 1 U test2.patch:
154 parent: 2:1d611e5a7244 qbase qtip test.patch tip
155 foo bar
156 branch: default
157 commit: (clean)
158 update: (current)
159 mq: 1 applied, 1 unapplied
154 applying test2.patch
160 applying test2.patch
155 now at: test2.patch
161 now at: test2.patch
162 parent: 3:333b5cb98635 qtip test2.patch tip
163 imported patch test2.patch
164 branch: default
165 commit: (clean)
166 update: (current)
167 mq: 2 applied
156 % qapplied
168 % qapplied
157 test.patch
169 test.patch
158 test2.patch
170 test2.patch
General Comments 0
You need to be logged in to leave comments. Login now