Mercurial > hg
changeset 5671:b5605d88dc27
Make ui.prompt repeat on "unrecognized response" again (issue897)
(this was accidentally changed in ca0d02222d6a)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 27 Dec 2007 10:32:33 +0100 |
parents | 840e2b315c1f |
children | 8a65ea986755 |
files | mercurial/ui.py |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Wed Dec 26 22:47:16 2007 +0100 +++ b/mercurial/ui.py Thu Dec 27 10:32:33 2007 +0100 @@ -407,14 +407,15 @@ def prompt(self, msg, pat=None, default="y", matchflags=0): if not self.interactive: return default - try: - r = self._readline(msg + ' ') - if not pat or re.match(pat, r, matchflags): - return r - else: - self.write(_("unrecognized response\n")) - except EOFError: - raise util.Abort(_('response expected')) + while True: + try: + r = self._readline(msg + ' ') + if not pat or re.match(pat, r, matchflags): + return r + else: + self.write(_("unrecognized response\n")) + except EOFError: + raise util.Abort(_('response expected')) def getpass(self, prompt=None, default=None): if not self.interactive: return default