~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Regression test for "stg import"
[stgit]
/
stgit
/
commands
/
refresh.py
diff --git
a/stgit/commands/refresh.py
b/stgit/commands/refresh.py
index
20b7546
..
610d18a
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'),
@@
-62,14
+65,17
@@
options = [make_option('-f', '--force',
help = 'use COMMNAME as the committer name'),
make_option('--commemail',
help = 'use COMMEMAIL as the committer ' \
help = 'use COMMNAME as the committer name'),
make_option('--commemail',
help = 'use COMMEMAIL as the committer ' \
- 'e-mail')]
+ 'e-mail'),
+ make_option('--sign',
+ help = 'add Signed-off-by line',
+ action = 'store_true'),
+ make_option('--ack',
+ help = 'add Acked-by line',
+ action = 'store_true')]
def func(parser, options, args):
def func(parser, options, args):
- if config.has_option('stgit', 'autoresolved'):
- autoresolved = config.get('stgit', 'autoresolved')
- else:
- autoresolved = 'no'
+ autoresolved = config.get('stgit', 'autoresolved')
if autoresolved != 'yes':
check_conflicts()
if autoresolved != 'yes':
check_conflicts()
@@
-81,14
+87,29
@@
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)
+ if options.sign:
+ sign_str = 'Signed-off-by'
+ elif options.ack:
+ sign_str = 'Acked-by'
+ else:
+ sign_str = None
+
if git.local_changes() \
or not crt_series.head_top_equal() \
or options.edit or options.message \
or options.authname or options.authemail or options.authdate \
if git.local_changes() \
or not crt_series.head_top_equal() \
or options.edit or options.message \
or options.authname or options.authemail or options.authdate \
- or options.commname or options.commemail:
+ or options.commname or options.commemail \
+ or options.sign or options.ack:
print 'Refreshing patch "%s"...' % patch,
sys.stdout.flush()
print 'Refreshing patch "%s"...' % patch,
sys.stdout.flush()
@@
-102,7
+123,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, sign_str = sign_str)
print 'done'
else:
print 'done'
else: