[PATCH 0 of 3] patchbomb: allow localization of promptchoice; add optional sending confirmation

Christian Ebert blacktrash at gmx.net
Fri Aug 27 11:01:49 CDT 2010


Hi,

This is another attempt to introduce a confirmation prompt before
sending a patchbomb.

1)
The first patch is purely cosmetic.

2)
Mads Kiilerich (thanks!) pointed out that the prompt function in
patchbomb does not allow localization of the choices and is
inconsistent with similar prompts e.g. in filemerge.py. Therefore
the second patch implements a custom promptchoice function
(returns default when ui.interactive() is false).

atm, this function could be simplified to something like (with
similar simplifications in the callers):

def promptbool(ui, msg):
    if not ui.interactive():
        return 0
    return ui.promptchoice(msg, (_('&Yes'), _('&No')))

So, if this would be the preferred way over strict mimicking
ui.promptchoice, let me know.

3)
The third patch introduces the --confirm option which will show
the message details with a boolean confirmation prompt.

As opposed to previous proposals, patchbomb aborts on a negative
answer to the prompt.


Patch queue available at:
http://www.blacktrash.org/hg/hg-queue/
Crew repo with queue on top:
http://www.blacktrash.org/hg/hg-crew-mq/

c


More information about the Mercurial-devel mailing list