[PATCH 2 of 2] patchbomb: show prompt and selection in non-interactive mode
Christian Ebert
blacktrash at gmx.net
Mon Sep 6 14:49:58 CDT 2010
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1283801752 -7200
# Node ID c5be6c73600aa297069f72799c90eab34137e7f8
# Parent 989d0f01b6571aba086805c0b3b13758929d8054
patchbomb: show prompt and selection in non-interactive mode
Akin to 01ada7b1861d for the custom patchbomb prompt.
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -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
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 @@
$ 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"
More information about the Mercurial-devel
mailing list