[PATCH] patchbomb: accept default if it is empty string. This fixes Cc: prompt

Alexander Solovyov piranha at piranha.org.ua
Thu Oct 22 17:04:56 UTC 2009


# HG changeset patch
# User Alexander Solovyov <piranha at piranha.org.ua>
# Date 1256230944 -10800
# Node ID 244f84e81f1a4843c41a86088f74e4859fb4354b
# Parent  1c34fca5d785ac725e7b482cfb48b65d2793e838
patchbomb: accept default if it is empty string. This fixes Cc: prompt

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -76,9 +76,9 @@ from mercurial import cmdutil, commands,
 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(_("%sPlease enter a valid value" % (prompt+rest)))
     if default:
@@ -90,8 +90,6 @@ def prompt(ui, prompt, default='', rest=
             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):



More information about the Mercurial-devel mailing list