Mercurial > hg-stable
changeset 12196:e42bc7f66e25
patchbomb: use ui.promptchoice for diffstat to allow localization of choices
The extra check for ui.interacive from patchbomb's prompt function is not
needed here.
Format boolean prompt as in filemerge.py.
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Wed, 08 Sep 2010 08:31:07 +0200 |
parents | ee41be2bbf5a |
children | 540693065d40 |
files | hgext/patchbomb.py tests/test-patchbomb.t |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/patchbomb.py Fri Sep 03 23:34:37 2010 +0200 +++ b/hgext/patchbomb.py Wed Sep 08 08:31:07 2010 +0200 @@ -101,8 +101,8 @@ if summary: ui.write(summary, '\n') ui.write(s, '\n') - ans = prompt(ui, _('does the diffstat above look okay?'), 'y') - if not ans.lower().startswith('y'): + if ui.promptchoice(_('does the diffstat above look okay (yn)?'), + (_('&Yes'), _('&No'))): raise util.Abort(_('diffstat rejected')) return s
--- a/tests/test-patchbomb.t Fri Sep 03 23:34:37 2010 +0200 +++ b/tests/test-patchbomb.t Wed Sep 08 08:31:07 2010 +0200 @@ -337,6 +337,7 @@ c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) + does the diffstat above look okay (yn)? y Displaying [PATCH] test ... Content-Type: text/plain; charset="us-ascii" @@ -379,17 +380,20 @@ a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) + does the diffstat above look okay (yn)? y b b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) + does the diffstat above look okay (yn)? y Final summary: a | 1 + b | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) + does the diffstat above look okay (yn)? y Write the introductory message for the patch series.