X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/6b1e01119114f9ebf4e047485f089b7c58823710..d884c4d8fd0a990d0746c7964bfd979a625c7ab2:/stgit/commands/pop.py diff --git a/stgit/commands/pop.py b/stgit/commands/pop.py index 23aeeb3..645eebd 100644 --- a/stgit/commands/pop.py +++ b/stgit/commands/pop.py @@ -36,7 +36,10 @@ options = [make_option('-a', '--all', help = 'pop all the applied patches', action = 'store_true'), make_option('-n', '--number', type = 'int', - help = 'pop the specified number of patches')] + help = 'pop the specified number of patches'), + make_option('-k', '--keep', + help = 'keep the local changes', + action = 'store_true')] def func(parser, options, args): @@ -45,10 +48,12 @@ def func(parser, options, args): if len(args) > 1: parser.error('incorrect number of arguments') - check_local_changes() check_conflicts() check_head_top_equal() + if not options.keep: + check_local_changes() + applied = crt_series.get_applied() if not applied: raise CmdException, 'No patches applied' @@ -74,6 +79,6 @@ def func(parser, options, args): if patches == []: raise CmdException, 'No patches to pop' - pop_patches(patches) + pop_patches(patches, options.keep) print_crt_patch()