changeset 9648:6064de41b7e4

patchbomb: accept default if it is empty string This fixes Cc: prompt.
author Alexander Solovyov <piranha@piranha.org.ua>
date Sun, 25 Oct 2009 14:28:02 +0100
parents f69fd20d788d
children 20b91f91f9ca
files hgext/patchbomb.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):