diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -81,9 +81,7 @@ from mercurial.i18n import _ from mercurial.node import bin def prompt(ui, prompt, default=None, rest=':'): - if not ui.interactive(): - if default is not None: - return default + if not ui.interactive() and default is None: raise util.Abort(_("%s Please enter a valid value" % (prompt + rest))) if default: prompt += ' [%s]' % default diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -1776,6 +1776,7 @@ test multi-byte domain parsing: $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0 This patch series consists of 1 patches. + Cc: Writing [PATCH] test ... @@ -1820,11 +1821,13 @@ test outgoing: $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t comparing with ../t searching for changes + From [test]: test This patch series consists of 8 patches. Write the introductory message for the patch series. + Cc: Displaying [PATCH 0 of 8] test ... Content-Type: text/plain; charset="us-ascii" @@ -2092,8 +2095,10 @@ dest#branch URIs: $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test comparing with ../t searching for changes + From [test]: test This patch series consists of 1 patches. + Cc: Displaying [PATCH] test ... Content-Type: text/plain; charset="us-ascii"