From: Catalin Marinas Date: Thu, 7 Dec 2006 22:02:42 +0000 (+0000) Subject: [Revert] Make 'push --undo' safer X-Git-Tag: v0.13~128 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/53f76663a55fc98d43d283dbef2306aac880d771?ds=inline [Revert] Make 'push --undo' safer (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 --- diff --git a/stgit/commands/push.py b/stgit/commands/push.py index b6e24d9..a636ad2 100644 --- a/stgit/commands/push.py +++ b/stgit/commands/push.py @@ -57,9 +57,6 @@ options = [make_option('-a', '--all', 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: @@ -69,6 +66,7 @@ def func(parser, options, args): print 'Undoing the "%s" push...' % patch, sys.stdout.flush() + resolved_all() if crt_series.undo_push(): print 'done' else: @@ -77,6 +75,10 @@ def func(parser, options, args): return + check_local_changes() + check_conflicts() + check_head_top_equal() + unapplied = crt_series.get_unapplied() if not unapplied: raise CmdException, 'No more patches to push' diff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh index 433e452..7847a38 100755 --- a/t/t1200-push-modified.sh +++ b/t/t1200-push-modified.sh @@ -51,7 +51,7 @@ test_expect_failure \ test_expect_success \ 'Rollback the push' \ - "(cd bar && stg status --reset && stg push --undo + "(cd bar && stg push --undo ) " diff --git a/t/t1202-push-undo.sh b/t/t1202-push-undo.sh index 45dabb4..335b554 100755 --- a/t/t1202-push-undo.sh +++ b/t/t1202-push-undo.sh @@ -49,7 +49,6 @@ test_expect_failure \ test_expect_success \ 'Undo the previous push' \ ' - stg status --reset && stg push --undo ' diff --git a/t/t1400-patch-history.sh b/t/t1400-patch-history.sh index 34162f4..59dc134 100755 --- a/t/t1400-patch-history.sh +++ b/t/t1400-patch-history.sh @@ -81,7 +81,6 @@ test_expect_success \ test_expect_success \ 'Check the push "undo" log' \ ' - stg status --reset && stg push --undo && stg log bar | grep -q -e "^undo " '