patchbomb: show prompt and selection in non-interactive mode
Akin to 01ada7b1861d for the custom patchbomb prompt.
--- a/hgext/patchbomb.py Wed Sep 08 08:31:07 2010 +0200
+++ b/hgext/patchbomb.py Wed Sep 08 08:31:07 2010 +0200
@@ -81,9 +81,7 @@
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
--- a/tests/test-patchbomb.t Wed Sep 08 08:31:07 2010 +0200
+++ b/tests/test-patchbomb.t Wed Sep 08 08:31:07 2010 +0200
@@ -1776,6 +1776,7 @@
$ 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 @@
$ 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 @@
$ 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"