patchbomb: prompt with ui.prompt()
Avoid Windows raw_input() issue introduced by
a3fe91b4f6eb.
Found by Steve Borho <steve@borho.org>.
--- a/hgext/patchbomb.py Sun Dec 09 20:46:32 2007 +0100
+++ b/hgext/patchbomb.py Mon Dec 10 22:41:18 2007 +0100
@@ -115,16 +115,12 @@
'''
def prompt(prompt, default = None, rest = ': ', empty_ok = False):
- try:
- # readline gives raw_input editing capabilities, but is not
- # present on windows
- import readline
- except ImportError: pass
-
+ if not ui.interactive:
+ return default
if default: prompt += ' [%s]' % default
prompt += rest
while True:
- r = raw_input(prompt)
+ r = ui.prompt(prompt, default=default)
if r: return r
if default is not None: return default
if empty_ok: return r