diff options
Diffstat (limited to 'git_review/cmd.py')
-rw-r--r-- | git_review/cmd.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/git_review/cmd.py b/git_review/cmd.py index ea09278..5b65812 100644 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -373,9 +373,17 @@ def set_hooks_commit_msg(remote, target_file): userhost = hostname # OS independent target file scp_target_file = target_file.replace(os.sep, "/") + + # Get scp options + scp_out = run_command("scp") + scp_opts = scp_out[scp_out.index("[") + 2:scp_out.index("]")] + cmd = ["scp", userhost + ":hooks/commit-msg", scp_target_file] if port is not None: cmd.insert(1, "-P%s" % port) + # Force scp protocol if the -O option is available + if "O" in scp_opts: + cmd.insert(1, "-O") if VERBOSE: hook_url = 'scp://%s%s/hooks/commit-msg' \ @@ -1005,7 +1013,10 @@ def assert_one_change(remote, branch, yes, have_hook): "branches (for independent changes).") print("\nThe outstanding commits are:\n\n%s\n\n" "Do you really want to submit the above commits?" % output) - yes_no = input("Type 'yes' to confirm, other to cancel: ") + try: + yes_no = input("Type 'yes' to confirm, other to cancel: ") + except KeyboardInterrupt: + yes_no = "no" if yes_no.lower().strip() != "yes": print("Aborting.") sys.exit(1) |