~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add --keep option to pop
[stgit]
/
stgit
/
commands
/
pop.py
diff --git
a/stgit/commands/pop.py
b/stgit/commands/pop.py
index
23aeeb3
..
7c260a6
100644
(file)
--- 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 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):
def func(parser, options, args):
@@
-45,9
+48,10
@@
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_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:
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'
if patches == []:
raise CmdException, 'No patches to pop'
- pop_patches(patches)
+ pop_patches(patches
, options.keep
)
print_crt_patch()
print_crt_patch()