X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/2406f7d16cad24d396b3e8ea5605813f4011b5a6..f46f4413587c2941a555aa6014c3e306bbd67fd6:/stgit/commands/pop.py diff --git a/stgit/commands/pop.py b/stgit/commands/pop.py index 23aeeb3..7c260a6 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('--keep', + help = 'keep the current working directory', + action = 'store_true')] def func(parser, options, args): @@ -45,9 +48,10 @@ 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() + check_conflicts() + check_head_top_equal() applied = crt_series.get_applied() if not applied: @@ -74,6 +78,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()