1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

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
This commit is contained in:
Mehdi Amini 2019-08-03 18:53:52 +00:00
parent ac1153cb59
commit 136c9a9a93

View File

@ -26,11 +26,6 @@ import sys
import time import time
assert sys.version_info >= (2, 7) assert sys.version_info >= (2, 7)
try:
exec("import __builtin__") # To avoid IDE's grammar check
except ImportError:
import builtins
try: try:
dict.iteritems dict.iteritems
except AttributeError: except AttributeError:
@ -107,12 +102,12 @@ def die(msg):
def ask_confirm(prompt): def ask_confirm(prompt):
# Python 2/3 compatibility # Python 2/3 compatibility
try: try:
input = eval("__builtin__.raw_input") read_input = raw_input
except NameError: except NameError:
input = builtins.input read_input = input
while True: while True:
query = input('%s (y/N): ' % (prompt)) query = read_input('%s (y/N): ' % (prompt))
if query.lower() not in ['y','n', '']: if query.lower() not in ['y','n', '']:
print('Expect y or n!') print('Expect y or n!')
continue continue
@ -477,7 +472,7 @@ def cmd_push(args):
# Ask confirmation if multiple commits are about to be pushed # Ask confirmation if multiple commits are about to be pushed
if len(revs) != 1: 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") die("Aborting")
for r in revs: for r in revs: