X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/3faeaeb18acf7653134371a98364d195ca28ed31..ca8b854cbf353ed87fd9284d50f69229bf40e22d:/stgit/commands/unhide.py diff --git a/stgit/commands/unhide.py b/stgit/commands/unhide.py index 74e4743..b6a2297 100644 --- a/stgit/commands/unhide.py +++ b/stgit/commands/unhide.py @@ -24,10 +24,10 @@ from stgit import stack, git help = 'unhide a hidden patch in the series' -usage = """%prog [options] [] +usage = """%prog [options] -Unhide a hidden range of patches or the current one if hidden so that -they are shown in the plain 'series' command output.""" +Unhide a hidden range of patches so that they are shown in the plain +'series' command output.""" options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')] @@ -35,14 +35,13 @@ options = [make_option('-b', '--branch', def func(parser, options, args): """Unhide a range of patches in the series """ - if not args: - patches = [crt_series.get_current()] + if args: + # parsing all the patches for a more meaningful error reporting + all_patches = crt_series.get_applied() + crt_series.get_unapplied() \ + + crt_series.get_hidden() + patches = parse_patches(args, all_patches) else: - applied = crt_series.get_applied() - unapplied = crt_series.get_unapplied() - patches = parse_patches(args, applied + unapplied, len(applied)) - - patches = [p for p in patches if p in crt_series.get_hidden()] + parser.error('No patches specified') for patch in patches: crt_series.unhide_patch(patch)