~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
/
unapplied.py
diff --git
a/stgit/commands/unapplied.py
b/stgit/commands/unapplied.py
index
4a14456
..
cbac052
100644
(file)
--- a/
stgit/commands/unapplied.py
+++ b/
stgit/commands/unapplied.py
@@
-31,7
+31,10
@@
List the patches from the series which are not pushed onto the stack.
They are listed in the reverse order in which they were popped."""
options = [make_option('-b', '--branch',
They are listed in the reverse order in which they were popped."""
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 unapplied patches',
+ action = 'store_true')]
def func(parser, options, args):
def func(parser, options, args):
@@
-40,5
+43,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_unapplied():
- print p
+ unapplied = crt_series.get_unapplied()
+
+ if options.count:
+ print len(unapplied)
+ else:
+ for p in unapplied:
+ print p