chiark
/
gitweb
/
~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a new option to "stg applied" and "stg unapplied" that provides a count
[stgit]
/
stgit
/
commands
/
applied.py
diff --git
a/stgit/commands/applied.py
b/stgit/commands/applied.py
index d568cd60c5759cfd84d4148f3c3d5bf9f5b85d41..f131d6242fe9d74a58920473229eb4fa1ab86219 100644
(file)
--- a/
stgit/commands/applied.py
+++ b/
stgit/commands/applied.py
@@
-32,7
+32,10
@@
stack. They are listed in the order in which they were pushed, the
last one being the current (topmost) patch."""
options = [make_option('-b', '--branch',
last one being the current (topmost) patch."""
options = [make_option('-b', '--branch',
- help = 'use BRANCH instead of the default one')]
+ help = 'use BRANCH instead of the default one'),
+ make_option('-c', '--count',
+ help = 'print the number of applied patches',
+ action = 'store_true')]
def func(parser, options, args):
def func(parser, options, args):
@@
-41,5
+44,10
@@
def func(parser, options, args):
if len(args) != 0:
parser.error('incorrect number of arguments')
if len(args) != 0:
parser.error('incorrect number of arguments')
- for p in crt_series.get_applied():
- print p
+ applied = crt_series.get_applied()
+
+ if options.count:
+ print len(applied)
+ else:
+ for p in applied:
+ print p