From 4197d1c3667b74d7ddec9c5055e7acf342a40b4f Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 3 Aug 2019 18:53:52 +0000 Subject: [PATCH] Fixup r367321 "Ask confirmation when `git llvm push` will push multiple commits" I unfortunately commited an obsolete revision in r367321 that didn't have all the changes the reviewers suggested. llvm-svn: 367761 --- llvm/utils/git-svn/git-llvm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm index 9fa0ae1..43ec4fb 100755 --- a/llvm/utils/git-svn/git-llvm +++ b/llvm/utils/git-svn/git-llvm @@ -27,11 +27,6 @@ import time assert sys.version_info >= (2, 7) try: - exec("import __builtin__") # To avoid IDE's grammar check -except ImportError: - import builtins - -try: dict.iteritems except AttributeError: # Python 3 @@ -107,12 +102,12 @@ def die(msg): def ask_confirm(prompt): # Python 2/3 compatibility try: - input = eval("__builtin__.raw_input") + read_input = raw_input except NameError: - input = builtins.input + read_input = input while True: - query = input('%s (y/N): ' % (prompt)) + query = read_input('%s (y/N): ' % (prompt)) if query.lower() not in ['y','n', '']: print('Expect y or n!') continue @@ -477,7 +472,7 @@ def cmd_push(args): # Ask confirmation if multiple commits are about to be pushed if len(revs) != 1: - if not ask_confirm("Are you sure?"): + if not ask_confirm("Are you sure you want to create %d commits?" % len(revs)): die("Aborting") for r in revs: -- 2.7.4