X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fcee87cf868f18a3d684c3ba71232574f92c7b11..948dae344afd7633b7a074beb36113c1b46527eb:/stgit/commands/applied.py diff --git a/stgit/commands/applied.py b/stgit/commands/applied.py index 94b26c6..f131d62 100644 --- a/stgit/commands/applied.py +++ b/stgit/commands/applied.py @@ -25,9 +25,17 @@ from stgit import stack, git help = 'print the applied patches' -usage = '%prog' +usage = """%prog [options] -options = [] +List the patches from the series which were already pushed onto the +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', + 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): @@ -36,5 +44,10 @@ 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