diff hgext/patchbomb.py @ 15165:3a55cee825ba

patchbomb: use prompt even in non-interactive mode This matches our pre-existing behavior from: changeset: 12197:540693065d40 user: Christian Ebert <blacktrash@gmx.net> files: hgext/patchbomb.py tests/test-patchbomb.t description: patchbomb: show prompt and selection in non-interactive mode changeset: 8940:01ada7b1861d user: Mads Kiilerich <mads@kiilerich.com> date: Sun Jun 21 03:13:38 2009 +0200 files: mercurial/ui.py tests/test-merge-prompt.out tests/test-merge-tools.out description: ui.prompt: Show prompt and selection in non-interactive mode
author Matt Mackall <mpm@selenic.com>
date Wed, 08 Sep 2010 08:31:07 +0200
parents 7bddec632821
children 9ec9dd8d1b24
line wrap: on
line diff
--- a/hgext/patchbomb.py	Tue Sep 27 22:38:47 2011 -0400
+++ b/hgext/patchbomb.py	Wed Sep 08 08:31:07 2010 +0200
@@ -57,13 +57,13 @@
 command = cmdutil.command(cmdtable)
 
 def prompt(ui, prompt, default=None, rest=':'):
-    if not ui.interactive():
-        return default
     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: