~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the '--undo' option to 'refresh'
[stgit]
/
stgit
/
commands
/
refresh.py
diff --git
a/stgit/commands/refresh.py
b/stgit/commands/refresh.py
index
c5f390f
..
306e7b3
100644
(file)
--- a/
stgit/commands/refresh.py
+++ b/
stgit/commands/refresh.py
@@
-47,6
+47,9
@@
options = [make_option('-f', '--force',
make_option('-s', '--showpatch',
help = 'show the patch content in the editor buffer',
action = 'store_true'),
make_option('-s', '--showpatch',
help = 'show the patch content in the editor buffer',
action = 'store_true'),
+ make_option('--undo',
+ help = 'revert the commit generated by the last refresh',
+ action = 'store_true'),
make_option('-m', '--message',
help = 'use MESSAGE as the patch ' \
'description'),
make_option('-m', '--message',
help = 'use MESSAGE as the patch ' \
'description'),
@@
-78,6
+81,13
@@
def func(parser, options, args):
if not options.force:
check_head_top_equal()
if not options.force:
check_head_top_equal()
+ if options.undo:
+ print 'Undoing the "%s" refresh...' % patch,
+ sys.stdout.flush()
+ crt_series.undo_refresh()
+ print 'done'
+ return
+
if options.author:
options.authname, options.authemail = name_email(options.author)
if options.author:
options.authname, options.authemail = name_email(options.author)
@@
-99,7
+109,8
@@
def func(parser, options, args):
author_email = options.authemail,
author_date = options.authdate,
committer_name = options.commname,
author_email = options.authemail,
author_date = options.authdate,
committer_name = options.commname,
- committer_email = options.commemail)
+ committer_email = options.commemail,
+ backup = True)
print 'done'
else:
print 'done'
else: