##// END OF EJS Templates
patchbomb: prompt with ui.prompt()...
Patrick Mezard -
r5641:4d6b630d default
parent child Browse files
Show More
@@ -115,16 +115,12 b' def patchbomb(ui, repo, *revs, **opts):'
115 '''
115 '''
116
116
117 def prompt(prompt, default = None, rest = ': ', empty_ok = False):
117 def prompt(prompt, default = None, rest = ': ', empty_ok = False):
118 try:
118 if not ui.interactive:
119 # readline gives raw_input editing capabilities, but is not
119 return default
120 # present on windows
121 import readline
122 except ImportError: pass
123
124 if default: prompt += ' [%s]' % default
120 if default: prompt += ' [%s]' % default
125 prompt += rest
121 prompt += rest
126 while True:
122 while True:
127 r = raw_input(prompt)
123 r = ui.prompt(prompt, default=default)
128 if r: return r
124 if r: return r
129 if default is not None: return default
125 if default is not None: return default
130 if empty_ok: return r
126 if empty_ok: return r
General Comments 0
You need to be logged in to leave comments. Login now