##// END OF EJS Templates
setup: improve support for prompts, we should not take care of case sensitivity here
marcink -
r505:8e95875b default
parent child Browse files
Show More
@@ -352,17 +352,17 b' def is_valid_repo_group(repo_group_name,'
352 return False
352 return False
353
353
354
354
355 def ask_ok(prompt, retries=4, complaint='Yes or no please!'):
355 def ask_ok(prompt, retries=4, complaint='[y]es or [n]o please!'):
356 while True:
356 while True:
357 ok = raw_input(prompt)
357 ok = raw_input(prompt)
358 if ok in ('y', 'ye', 'yes'):
358 if ok.lower() in ('y', 'ye', 'yes'):
359 return True
359 return True
360 if ok in ('n', 'no', 'nop', 'nope'):
360 if ok.lower() in ('n', 'no', 'nop', 'nope'):
361 return False
361 return False
362 retries = retries - 1
362 retries = retries - 1
363 if retries < 0:
363 if retries < 0:
364 raise IOError
364 raise IOError
365 print complaint
365 print(complaint)
366
366
367 # propagated from mercurial documentation
367 # propagated from mercurial documentation
368 ui_sections = [
368 ui_sections = [
General Comments 0
You need to be logged in to leave comments. Login now