Mercurial > hg
changeset 15166:9ec9dd8d1b24
patchbomb: drop loop in prompt
There are no longer any prompts that insist on being answered, so the
loop is no longer needed, nor is most of the other logic.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 28 Sep 2011 14:49:00 -0500 |
parents | 3a55cee825ba |
children | 8df4166b6f63 |
files | hgext/patchbomb.py |
diffstat | 1 files changed, 1 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/patchbomb.py Wed Sep 08 08:31:07 2010 +0200 +++ b/hgext/patchbomb.py Wed Sep 28 14:49:00 2011 -0500 @@ -59,17 +59,7 @@ def prompt(ui, prompt, default=None, rest=':'): if default: prompt += ' [%s]' % default - prompt += rest - while True: - result = ui.prompt(prompt, default=default) - if not ui.interactive(): - return result - if result is not None: - return result - elif default is not None: - return default - else: - ui.warn(_('Please enter a valid value.\n')) + return ui.prompt(prompt + rest, default) def introwanted(opts, number): '''is an introductory message apparently wanted?'''