Mercurial > hg-stable
changeset 15165:3a55cee825ba
patchbomb: use prompt even in non-interactive mode
This matches our pre-existing behavior from:
changeset: 12197:540693065d40
user: Christian Ebert <blacktrash@gmx.net>
files: hgext/patchbomb.py tests/test-patchbomb.t
description:
patchbomb: show prompt and selection in non-interactive mode
changeset: 8940:01ada7b1861d
user: Mads Kiilerich <mads@kiilerich.com>
date: Sun Jun 21 03:13:38 2009 +0200
files: mercurial/ui.py tests/test-merge-prompt.out tests/test-merge-tools.out
description:
ui.prompt: Show prompt and selection in non-interactive mode
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 08 Sep 2010 08:31:07 +0200 |
parents | 7bddec632821 |
children | 9ec9dd8d1b24 |
files | hgext/patchbomb.py tests/test-patchbomb.t |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/patchbomb.py Tue Sep 27 22:38:47 2011 -0400 +++ b/hgext/patchbomb.py Wed Sep 08 08:31:07 2010 +0200 @@ -57,13 +57,13 @@ command = cmdutil.command(cmdtable) def prompt(ui, prompt, default=None, rest=':'): - if not ui.interactive(): - return default if default: prompt += ' [%s]' % default prompt += rest while True: result = ui.prompt(prompt, default=default) + if not ui.interactive(): + return result if result is not None: return result elif default is not None:
--- a/tests/test-patchbomb.t Tue Sep 27 22:38:47 2011 -0400 +++ b/tests/test-patchbomb.t Wed Sep 08 08:31:07 2010 +0200 @@ -1474,6 +1474,7 @@ > -r 0:1 | fixheaders This patch series consists of 2 patches. + Subject: [PATCH 0 of 2] Displaying [PATCH 1 of 2] a ... Content-Type: text/plain; charset="us-ascii" @@ -1883,6 +1884,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 ... @@ -1927,11 +1929,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" @@ -2199,8 +2203,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"