File: ext-patchbomb.html

package info (click to toggle)
mercurial 7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 46,124 kB
  • sloc: python: 214,491; ansic: 56,606; tcl: 3,715; sh: 1,879; lisp: 1,483; cpp: 864; makefile: 792; javascript: 649; xml: 36
file content (283 lines) | stat: -rw-r--r-- 14,775 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>patchbomb</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="patchbomb">
<span id="ext-patchbomb"></span>
<h1 class="title">patchbomb</h1>

<div class="contents htmlonly topic" id="contents">
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p>
<ul class="simple">
<li><a class="reference internal" href="#description" id="toc-entry-1">Description</a></li>
<li><a class="reference internal" href="#commands" id="toc-entry-2">Commands</a><ul>
<li><a class="reference internal" href="#change-import-export" id="toc-entry-3">Change import/export</a></li>
</ul>
</li>
</ul>
</div>
<p>command to send changesets as (a series of) patch emails</p>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>The series is started off with a &quot;[PATCH 0 of N]&quot; introduction, which
describes the series as a whole.</p>
<p>Each patch email has a Subject line of &quot;[PATCH M of N] ...&quot;, using the
first line of the changeset description as the subject text. The
message contains two or three body parts:</p>
<ul class="simple">
<li>The changeset description.</li>
<li>[Optional] The result of running diffstat on the patch.</li>
<li>The patch itself, as generated by <a class="reference external" href="hg-export.html"><tt class="docutils literal">hg export</tt></a>.</li>
</ul>
<p>Each message refers to the first in the series using the In-Reply-To
and References headers, so they will show up as a sequence in threaded
mail and news readers, and in mail archives.</p>
<p>To configure other defaults, add a section like this to your
configuration file:</p>
<pre class="literal-block">
[email]
from = My Name &lt;my&#64;email&gt;
to = recipient1, recipient2, ...
cc = cc1, cc2, ...
bcc = bcc1, bcc2, ...
reply-to = address1, address2, ...
</pre>
<p>Use <tt class="docutils literal">[patchbomb]</tt> as configuration section name if you need to
override global <tt class="docutils literal">[email]</tt> address settings.</p>
<p>Then you can use the <a class="reference external" href="hg-email.html"><tt class="docutils literal">hg email</tt></a> command to mail a series of
changesets as a patchbomb.</p>
<p>You can also either configure the method option in the email section
to be a sendmail compatible mailer or fill out the [smtp] section so
that the patchbomb extension can automatically send patchbombs
directly from the commandline. See the [email] and [smtp] sections in
hgrc(5) for details.</p>
<p>By default, <a class="reference external" href="hg-email.html"><tt class="docutils literal">hg email</tt></a> will prompt for a <tt class="docutils literal">To</tt> or <tt class="docutils literal">CC</tt> header if
you do not supply one via configuration or the command line.  You can
override this to never prompt by configuring an empty value:</p>
<pre class="literal-block">
[email]
cc =
</pre>
<p>You can control the default inclusion of an introduction message with the
<tt class="docutils literal">patchbomb.intro</tt> configuration option. The configuration is always
overwritten by command line flags like --intro and --desc:</p>
<pre class="literal-block">
[patchbomb]
intro=auto   # include introduction message if more than 1 patch (default)
intro=never  # never include an introduction message
intro=always # always include an introduction message
</pre>
<p>You can specify a template for flags to be added in subject prefixes. Flags
specified by --flag option are exported as <tt class="docutils literal">{flags}</tt> keyword:</p>
<pre class="literal-block">
[patchbomb]
flagtemplate = &quot;{separate(' ',
                          ifeq(branch, 'default', '', branch|upper),
                          flags)}&quot;
</pre>
<p>You can set patchbomb to always ask for confirmation by setting
<tt class="docutils literal">patchbomb.confirm</tt> to true.</p>
</div>
<div class="section" id="commands">
<h1><a class="toc-backref" href="#contents">Commands</a></h1>
<div class="section" id="change-import-export">
<h2><a class="toc-backref" href="#contents">Change import/export</a></h2>
<div class="section" id="email">
<h3>email</h3>
<p>send changesets by email:</p>
<pre class="literal-block">
hg email [OPTION]... [DEST]...
</pre>
<p>By default, diffs are sent in the format generated by
<a class="reference external" href="hg-export.html"><tt class="docutils literal">hg export</tt></a>, one per message. The series starts with a &quot;[PATCH 0
of N]&quot; introduction, which describes the series as a whole.</p>
<p>Each patch email has a Subject line of &quot;[PATCH M of N] ...&quot;, using
the first line of the changeset description as the subject text.
The message contains two or three parts. First, the changeset
description.</p>
<p>With the -d/--diffstat option, if the diffstat program is
installed, the result of running diffstat on the patch is inserted.</p>
<p>Finally, the patch itself, as generated by <a class="reference external" href="hg-export.html"><tt class="docutils literal">hg export</tt></a>.</p>
<p>With the -d/--diffstat or --confirm options, you will be presented
with a final summary of all messages and asked for confirmation before
the messages are sent.</p>
<p>By default the patch is included as text in the email body for
easy reviewing. Using the -a/--attach option will instead create
an attachment for the patch. With -i/--inline an inline attachment
will be created. You can include a patch both as text in the email
body and as a regular or an inline attachment by combining the
-a/--attach or -i/--inline with the --body option.</p>
<p>With -B/--bookmark changesets reachable by the given bookmark are
selected.</p>
<p>With -o/--outgoing, emails will be generated for patches not found
in the destination repository (or only those which are ancestors
of the specified revisions if any are provided)</p>
<p>With -b/--bundle, changesets are selected as for --outgoing, but a
single email containing a binary Mercurial bundle as an attachment
will be sent. Use the <tt class="docutils literal">patchbomb.bundletype</tt> config option to
control the bundle type as with <a class="reference external" href="hg-bundle.html"><tt class="docutils literal">hg bundle <span class="pre">--type</span></tt></a>.</p>
<p>With -m/--mbox, instead of previewing each patchbomb message in a
pager or sending the messages directly, it will create a UNIX
mailbox file with the patch emails. This mailbox file can be
previewed with any mail user agent which supports UNIX mbox
files.</p>
<p>With -n/--test, all steps will run, but mail will not be sent.
You will be prompted for an email recipient address, a subject and
an introductory message describing the patches of your patchbomb.
Then when all is done, patchbomb messages are displayed.</p>
<p>In case email sending fails, you will find a backup of your series
introductory message in <tt class="docutils literal"><span class="pre">.hg/last-email.txt</span></tt>.</p>
<p>The default behavior of this command can be customized through
configuration. (See <a class="reference external" href="ext-patchbomb.html"><tt class="docutils literal">hg help patchbomb</tt></a> for details)</p>
<p>Examples:</p>
<pre class="literal-block">
hg email -r 3000          # send patch 3000 only
hg email -r 3000 -r 3001  # send patches 3000 and 3001
hg email -r 3000:3005     # send patches 3000 through 3005
hg email 3000             # send patch 3000 (deprecated)

hg email -o               # send all patches not in default
hg email -o DEST          # send all patches not in DEST
hg email -o -r 3000       # send all ancestors of 3000 not in default
hg email -o -r 3000 DEST  # send all ancestors of 3000 not in DEST

hg email -B feature       # send all ancestors of feature bookmark

hg email -b               # send bundle of all patches not in default
hg email -b DEST          # send bundle of all patches not in DEST
hg email -b -r 3000       # bundle of all ancestors of 3000 not in default
hg email -b -r 3000 DEST  # bundle of all ancestors of 3000 not in DEST

hg email -o -m mbox &amp;&amp;    # generate an mbox file...
  mutt -R -f mbox         # ... and view it with mutt
hg email -o -m mbox &amp;&amp;    # generate an mbox file ...
  formail -s sendmail \   # ... and use formail to send from the mbox
    -bm -t &lt; mbox         # ... using sendmail
</pre>
<p>Before using this command, you will need to enable email in your
hgrc. See the [email] section in hgrc(5) for details.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--plain</span></kbd></td>
<td>omit hg patch header</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--outgoing</span></kbd></td>
<td>send changes not found in the target repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bundle</span></kbd></td>
<td>send changes not in target as a binary bundle</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--bookmark <var>&lt;BOOKMARK&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>send changes only reachable by given bookmark</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--bundlename <var>&lt;NAME&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>name of the bundle attachment file (default: bundle)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-r</span>, <span class="option">--rev <var>&lt;REV[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>a revision to send</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force</span></kbd></td>
<td>run even when remote repository is unrelated (with -b/--bundle)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--base <var>&lt;REV[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>a base changeset to specify instead of a destination (with -b/--bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--intro</span></kbd></td>
<td>send an introduction email for a single patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--body</span></kbd></td>
<td>send patches as inline message text (default)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--attach</span></kbd></td>
<td>send patches as attachments</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--inline</span></kbd></td>
<td>send patches as inline attachments</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--bcc <var>&lt;EMAIL[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>email addresses of blind carbon copy recipients</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--cc <var>&lt;EMAIL[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>email addresses of copy recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--confirm</span></kbd></td>
<td>ask for confirmation before sending</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--diffstat</span></kbd></td>
<td>add diffstat output to messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--date <var>&lt;DATE&gt;</var></span></kbd></td>
<td>use the given date as the sending date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--desc <var>&lt;FILE&gt;</var></span></kbd></td>
<td>use the given file as the series description</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-f</span>, <span class="option">--from <var>&lt;EMAIL&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>email address of sender</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--test</span></kbd></td>
<td>print messages that would be sent</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--mbox <var>&lt;FILE&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>write messages to mbox file instead of sending them</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--reply-to <var>&lt;EMAIL[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>email addresses replies should be sent to</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--subject <var>&lt;TEXT&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>subject of first message (intro or single patch)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--in-reply-to <var>&lt;MSGID&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>message identifier to reply to</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--flag <var>&lt;FLAG[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>flags to add in subject prefixes</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t</span>, <span class="option">--to <var>&lt;EMAIL[+]&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>email addresses of recipients</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-e</span>, <span class="option">--ssh <var>&lt;CMD&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>specify ssh command to use</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--remotecmd <var>&lt;CMD&gt;</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
</div>
</div>
</div>
</body>
</html>