(reverting of commit
539fb2921209bd3fd6165baa057f76f474aa5cb4)
Make the push undoing a bit safer by asking the user to first clean
the local changes or conflicts rather than silently resetting them.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
def func(parser, options, args):
"""Pushes the given patch or all onto the series
"""
def func(parser, options, args):
"""Pushes the given patch or all onto the series
"""
- check_conflicts()
- check_local_changes()
- check_head_top_equal()
# If --undo is passed, do the work and exit
if options.undo:
# If --undo is passed, do the work and exit
if options.undo:
print 'Undoing the "%s" push...' % patch,
sys.stdout.flush()
print 'Undoing the "%s" push...' % patch,
sys.stdout.flush()
if crt_series.undo_push():
print 'done'
else:
if crt_series.undo_push():
print 'done'
else:
+ check_local_changes()
+ check_conflicts()
+ check_head_top_equal()
+
unapplied = crt_series.get_unapplied()
if not unapplied:
raise CmdException, 'No more patches to push'
unapplied = crt_series.get_unapplied()
if not unapplied:
raise CmdException, 'No more patches to push'
test_expect_success \
'Rollback the push' \
test_expect_success \
'Rollback the push' \
- "(cd bar && stg status --reset && stg push --undo
+ "(cd bar && stg push --undo
test_expect_success \
'Undo the previous push' \
'
test_expect_success \
'Undo the previous push' \
'
test_expect_success \
'Check the push "undo" log' \
'
test_expect_success \
'Check the push "undo" log' \
'
stg push --undo &&
stg log bar | grep -q -e "^undo "
'
stg push --undo &&
stg log bar | grep -q -e "^undo "
'