##// END OF EJS Templates
Make ui.prompt repeat on "unrecognized response" again (issue897)...
Thomas Arendsen Hein -
r5671:b5605d88 default
parent child Browse files
Show More
@@ -407,14 +407,15 b' class ui(object):'
407
407
408 def prompt(self, msg, pat=None, default="y", matchflags=0):
408 def prompt(self, msg, pat=None, default="y", matchflags=0):
409 if not self.interactive: return default
409 if not self.interactive: return default
410 try:
410 while True:
411 r = self._readline(msg + ' ')
411 try:
412 if not pat or re.match(pat, r, matchflags):
412 r = self._readline(msg + ' ')
413 return r
413 if not pat or re.match(pat, r, matchflags):
414 else:
414 return r
415 self.write(_("unrecognized response\n"))
415 else:
416 except EOFError:
416 self.write(_("unrecognized response\n"))
417 raise util.Abort(_('response expected'))
417 except EOFError:
418 raise util.Abort(_('response expected'))
418
419
419 def getpass(self, prompt=None, default=None):
420 def getpass(self, prompt=None, default=None):
420 if not self.interactive: return default
421 if not self.interactive: return default
General Comments 0
You need to be logged in to leave comments. Login now