This option is similar to the one for the pop command.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
--to' commands. There is no '--undo' option for 'goto'. Use the 'push'
command for this."""
--to' commands. There is no '--undo' option for 'goto'. Use the 'push'
command for this."""
+options = [make_option('-k', '--keep',
+ help = 'keep the local changes when popping patches',
+ action = 'store_true')]
def func(parser, options, args):
def func(parser, options, args):
if len(args) != 1:
parser.error('incorrect number of arguments')
if len(args) != 1:
parser.error('incorrect number of arguments')
check_conflicts()
check_head_top_equal()
check_conflicts()
check_head_top_equal()
+ if not options.keep:
+ check_local_changes()
+
applied = crt_series.get_applied()
unapplied = crt_series.get_unapplied()
patch = args[0]
applied = crt_series.get_applied()
unapplied = crt_series.get_unapplied()
patch = args[0]
if patch in applied:
applied.reverse()
patches = applied[:applied.index(patch)]
if patch in applied:
applied.reverse()
patches = applied[:applied.index(patch)]
+ pop_patches(patches, options.keep)
+ if options.keep:
+ raise CmdException, 'Cannot use --keep with patch pushing'
patches = unapplied[:unapplied.index(patch)+1]
push_patches(patches)
else:
patches = unapplied[:unapplied.index(patch)+1]
push_patches(patches)
else: