##// END OF EJS Templates
patchbomb: introduce a 'patchbomb.confirm' option...
Pierre-Yves David -
r23488:11b21573 default
parent child Browse files
Show More
@@ -52,6 +52,9 b' overwritten by command line flags like -'
52 intro=auto # include introduction message if more than 1 patch (default)
52 intro=auto # include introduction message if more than 1 patch (default)
53 intro=never # never include an introduction message
53 intro=never # never include an introduction message
54 intro=always # always include an introduction message
54 intro=always # always include an introduction message
55
56 You can set patchbomb to always ask for confirmation by setting
57 ``patchbomb.confirm`` to true.
55 '''
58 '''
56
59
57 import os, errno, socket, tempfile, cStringIO
60 import os, errno, socket, tempfile, cStringIO
@@ -430,9 +433,10 b' def patchbomb(ui, repo, *revs, **opts):'
430 for each patchbomb message, so you can verify everything is alright.
433 for each patchbomb message, so you can verify everything is alright.
431
434
432 In case email sending fails, you will find a backup of your series
435 In case email sending fails, you will find a backup of your series
433 introductory message in ``.hg/last-email.txt``. The inclusion the
436 introductory message in ``.hg/last-email.txt``.
434 introduction can also be control using the ``patchbomb.intro`` option. (see
437
435 hg help patchbomb for details)
438 The default behavior of this command can be customized through
439 configuration. (See :hg:`help patchbomb` for details)
436
440
437 Examples::
441 Examples::
438
442
@@ -553,7 +557,10 b' def patchbomb(ui, repo, *revs, **opts):'
553 bcc = getaddrs('Bcc') or []
557 bcc = getaddrs('Bcc') or []
554 replyto = getaddrs('Reply-To')
558 replyto = getaddrs('Reply-To')
555
559
556 if opts.get('diffstat') or opts.get('confirm'):
560 confirm = ui.configbool('patchbomb', 'confirm')
561 confirm |= bool(opts.get('diffstat') or opts.get('confirm'))
562
563 if confirm:
557 ui.write(_('\nFinal summary:\n\n'), label='patchbomb.finalsummary')
564 ui.write(_('\nFinal summary:\n\n'), label='patchbomb.finalsummary')
558 ui.write(('From: %s\n' % sender), label='patchbomb.from')
565 ui.write(('From: %s\n' % sender), label='patchbomb.from')
559 for addr in showaddrs:
566 for addr in showaddrs:
@@ -86,6 +86,26 b' Mercurial-patchbomb/.* -> Mercurial-patc'
86 abort: patchbomb canceled
86 abort: patchbomb canceled
87 [255]
87 [255]
88
88
89 $ hg --config ui.interactive=1 --config patchbomb.confirm=true email -n -f quux -t foo -c bar -r tip<<EOF
90 > n
91 > EOF
92 this patch series consists of 1 patches.
93
94
95 Final summary:
96
97 From: quux
98 To: foo
99 Cc: bar
100 Subject: [PATCH] a
101 a | 1 +
102 1 files changed, 1 insertions(+), 0 deletions(-)
103
104 are you sure you want to send (yn)? n
105 abort: patchbomb canceled
106 [255]
107
108
89 Test diff.git is respected
109 Test diff.git is respected
90 $ hg --config diff.git=True email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
110 $ hg --config diff.git=True email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
91 this patch series consists of 1 patches.
111 this patch series consists of 1 patches.
General Comments 0
You need to be logged in to leave comments. Login now