X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fcee87cf868f18a3d684c3ba71232574f92c7b11..681f805ef4688c7ea450f5e72a15dad818809734:/stgit/commands/unapplied.py diff --git a/stgit/commands/unapplied.py b/stgit/commands/unapplied.py index 5d7564a..cbac052 100644 --- a/stgit/commands/unapplied.py +++ b/stgit/commands/unapplied.py @@ -25,9 +25,16 @@ from stgit import stack, git help = 'print the unapplied patches' -usage = '%prog' +usage = """%prog [options] -options = [] +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', + 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): @@ -36,5 +43,10 @@ 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