# HG changeset patch # User Matt Mackall # Date 2011-09-28 19:49:00 # Node ID 9ec9dd8d1b2454281e03eaa1a804ef3de7e1a7d9 # Parent 3a55cee825ba9762762cabb6809880d83afd880b 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. diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -59,17 +59,7 @@ command = cmdutil.command(cmdtable) 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?'''