Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dev/merge_spark_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,14 @@ def run_cmd(cmd):
return subprocess.check_output(cmd.split(" ")).decode("utf-8")


def continue_maybe(prompt):
def continue_maybe(prompt, cherry=False):
result = bold_input("%s (y/N): " % prompt)
if result.lower() != "y":
if cherry:
try:
run_cmd("git cherry-pick --abort")
except Exception:
print_error("Unable to abort and get back to the state before cherry-pick")
fail("Okay, exiting")


Expand Down Expand Up @@ -234,9 +239,9 @@ def cherry_pick(pr_num, merge_hash, default_branch):
run_cmd("git cherry-pick -sx %s" % merge_hash)
except Exception as e:
msg = "Error cherry-picking: %s\nWould you like to manually fix-up this merge?" % e
continue_maybe(msg)
continue_maybe(msg, True)
msg = "Okay, please fix any conflicts and finish the cherry-pick. Finished?"
continue_maybe(msg)
continue_maybe(msg, True)

continue_maybe(
"Pick complete (local ref %s). Push to %s?" % (pick_branch_name, PUSH_REMOTE_NAME)
Expand Down