patchbomb: accept default if it is empty string
authorAlexander Solovyov <piranha@piranha.org.ua>
Sun, 25 Oct 2009 14:28:02 +0100
changeset 9648 6064de41b7e4
parent 9647 f69fd20d788d
child 9649 20b91f91f9ca
patchbomb: accept default if it is empty string This fixes Cc: prompt.
hgext/patchbomb.py
--- a/hgext/patchbomb.py	Sun Oct 25 14:24:39 2009 +0100
+++ b/hgext/patchbomb.py	Sun Oct 25 14:28:02 2009 +0100
@@ -76,9 +76,9 @@
 from mercurial.i18n import _
 from mercurial.node import bin
 
-def prompt(ui, prompt, default='', rest=':', empty_ok=False):
+def prompt(ui, prompt, default=None, rest=':'):
     if not ui.interactive():
-        if default or empty_ok:
+        if default is not None:
             return default
         raise util.Abort(_("%s Please enter a valid value" % (prompt+rest)))
     if default:
@@ -90,8 +90,6 @@
             return r
         if default is not None:
             return default
-        if empty_ok:
-            return r
         ui.warn(_('Please enter a valid value.\n'))
 
 def cdiffstat(ui, summary, patchlines):