of patches rather than a list.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
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):
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
options = [make_option('-b', '--branch',
help = 'use BRANCH instead of the default one'),
+ make_option('-c', '--count',
+ help = 'print the number of patches in the series',
+ action = 'store_true'),
make_option('-d', '--description',
help = 'show a short description for each patch',
action = 'store_true'),
applied = crt_series.get_applied()
unapplied = crt_series.get_unapplied()
+ if options.count:
+ print len(applied) + len(unapplied)
+ return
+
if options.short:
if len(applied) > 5:
applied = applied[-6:]
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):
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