from stgit.commands import common
from stgit.lib import transaction
from stgit import argparse
+from stgit.argparse import opt
help = 'Push or pop patches to the given one'
kind = 'stack'
line becomes current."""
args = [argparse.other_applied_patches, argparse.unapplied_patches]
-options = []
+options = argparse.keep_option()
directory = common.DirectoryHasRepositoryLib()
stack = directory.repository.current_stack
iw = stack.repository.default_iw
- trans = transaction.StackTransaction(stack, 'goto')
+ clean_iw = (not options.keep and iw) or None
+ trans = transaction.StackTransaction(stack, 'goto',
+ check_clean_iw = clean_iw)
if patch in trans.applied:
to_pop = set(trans.applied[trans.applied.index(patch)+1:])
assert not trans.pop_patches(lambda pn: pn in to_pop)