# HG changeset patch # User Patrick Mezard # Date 2007-12-10 21:41:18 # Node ID 4d6b630d393953a2ac913232658b3bfb5f05ce93 # Parent fe2e8122981992ef24a27af320a7b124c53d8aac patchbomb: prompt with ui.prompt() Avoid Windows raw_input() issue introduced by a3fe91b4f6eb. Found by Steve Borho . diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -115,16 +115,12 @@ def patchbomb(ui, repo, *revs, **opts): ''' 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