# HG changeset patch # User Christian Ebert # Date 1283927467 -7200 # Node ID e42bc7f66e25d2308d31214cf6e34f8ffd8bad70 # Parent ee41be2bbf5afd310f038ef63365ea045c6b9b32 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. diff -r ee41be2bbf5a -r e42bc7f66e25 hgext/patchbomb.py --- 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 diff -r ee41be2bbf5a -r e42bc7f66e25 tests/test-patchbomb.t --- 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.