[llvm] r367761 - Fixup r367321 "Ask confirmation when `git llvm push` will push multiple commits"

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 3 11:53:52 PDT 2019


Author: mehdi_amini
Date: Sat Aug  3 11:53:52 2019
New Revision: 367761

URL: http://llvm.org/viewvc/llvm-project?rev=367761&view=rev
Log:
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.

Modified:
    llvm/trunk/utils/git-svn/git-llvm

Modified: llvm/trunk/utils/git-svn/git-llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/git-svn/git-llvm?rev=367761&r1=367760&r2=367761&view=diff
==============================================================================
--- llvm/trunk/utils/git-svn/git-llvm (original)
+++ llvm/trunk/utils/git-svn/git-llvm Sat Aug  3 11:53:52 2019
@@ -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:




More information about the llvm-commits mailing list