##// END OF EJS Templates
patchbomb: accept default if it is empty string...
Alexander Solovyov -
r9648:6064de41 default
parent child Browse files
Show More
@@ -76,9 +76,9 b' from mercurial import cmdutil, commands,'
76 from mercurial.i18n import _
76 from mercurial.i18n import _
77 from mercurial.node import bin
77 from mercurial.node import bin
78
78
79 def prompt(ui, prompt, default='', rest=':', empty_ok=False):
79 def prompt(ui, prompt, default=None, rest=':'):
80 if not ui.interactive():
80 if not ui.interactive():
81 if default or empty_ok:
81 if default is not None:
82 return default
82 return default
83 raise util.Abort(_("%s Please enter a valid value" % (prompt+rest)))
83 raise util.Abort(_("%s Please enter a valid value" % (prompt+rest)))
84 if default:
84 if default:
@@ -90,8 +90,6 b" def prompt(ui, prompt, default='', rest="
90 return r
90 return r
91 if default is not None:
91 if default is not None:
92 return default
92 return default
93 if empty_ok:
94 return r
95 ui.warn(_('Please enter a valid value.\n'))
93 ui.warn(_('Please enter a valid value.\n'))
96
94
97 def cdiffstat(ui, summary, patchlines):
95 def cdiffstat(ui, summary, patchlines):
General Comments 0
You need to be logged in to leave comments. Login now