Show More
@@ -223,13 +223,15 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
223 | pass |
|
223 | pass | |
224 | os.rmdir(tmpdir) |
|
224 | os.rmdir(tmpdir) | |
225 |
|
225 | |||
226 | if not opts['test']: |
|
226 | really_sending = not (opts['test'] or opts['mbox']) | |
|
227 | ||||
|
228 | if really_sending: | |||
227 | mail.validateconfig(ui) |
|
229 | mail.validateconfig(ui) | |
228 |
|
230 | |||
229 | if not (revs or opts.get('rev') or opts.get('outgoing')): |
|
231 | if not (revs or opts.get('rev') or opts.get('outgoing')): | |
230 | raise util.Abort(_('specify at least one changeset with -r or -o')) |
|
232 | raise util.Abort(_('specify at least one changeset with -r or -o')) | |
231 |
|
233 | |||
232 |
c |
|
234 | cmdutil.setremoteconfig(ui, opts) | |
233 | if opts.get('outgoing') and opts.get('bundle'): |
|
235 | if opts.get('outgoing') and opts.get('bundle'): | |
234 | raise util.Abort(_("--outgoing mode always on with --bundle; do not re-specify --outgoing")) |
|
236 | raise util.Abort(_("--outgoing mode always on with --bundle; do not re-specify --outgoing")) | |
235 |
|
237 | |||
@@ -250,7 +252,10 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
250 | opts['revs'] = revs |
|
252 | opts['revs'] = revs | |
251 |
|
253 | |||
252 | # start |
|
254 | # start | |
253 | start_time = util.makedate() |
|
255 | if opts.get('date'): | |
|
256 | start_time = util.parsedate(opts['date']) | |||
|
257 | else: | |||
|
258 | start_time = util.makedate() | |||
254 |
|
259 | |||
255 | def genmsgid(id): |
|
260 | def genmsgid(id): | |
256 | return '<%s.%s@%s>' % (id[:20], int(start_time[0]), socket.getfqdn()) |
|
261 | return '<%s.%s@%s>' % (id[:20], int(start_time[0]), socket.getfqdn()) | |
@@ -351,7 +356,7 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
351 |
|
356 | |||
352 | ui.write('\n') |
|
357 | ui.write('\n') | |
353 |
|
358 | |||
354 | if not opts['test'] and not opts['mbox']: |
|
359 | if really_sending: | |
355 | mailer = mail.connect(ui) |
|
360 | mailer = mail.connect(ui) | |
356 | parent = None |
|
361 | parent = None | |
357 |
|
362 | |||
@@ -405,6 +410,7 b' cmdtable = {' | |||||
405 | ('', 'bcc', [], 'email addresses of blind copy recipients'), |
|
410 | ('', 'bcc', [], 'email addresses of blind copy recipients'), | |
406 | ('c', 'cc', [], 'email addresses of copy recipients'), |
|
411 | ('c', 'cc', [], 'email addresses of copy recipients'), | |
407 | ('d', 'diffstat', None, 'add diffstat output to messages'), |
|
412 | ('d', 'diffstat', None, 'add diffstat output to messages'), | |
|
413 | ('', 'date', '', _('use the given date as the sending date')), | |||
408 | ('g', 'git', None, _('use git extended diff format')), |
|
414 | ('g', 'git', None, _('use git extended diff format')), | |
409 | ('f', 'from', '', 'email address of sender'), |
|
415 | ('f', 'from', '', 'email address of sender'), | |
410 | ('', 'plain', None, 'omit hg patch header'), |
|
416 | ('', 'plain', None, 'omit hg patch header'), |
@@ -14,4 +14,7 b' echo b > b' | |||||
14 | hg commit -Amb -d '2 0' |
|
14 | hg commit -Amb -d '2 0' | |
15 |
|
15 | |||
16 | hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test 0:tip | \ |
|
16 | hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test 0:tip | \ | |
17 |
sed -e 's/\(Message-Id:.*@\ |
|
17 | sed -e 's/\(Message-Id:.*@\).*/\1/' | \ | |
|
18 | sed -e 's/\(In-Reply-To:.*@\).*/\1/' | |||
|
19 | ||||
|
20 | hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip |
@@ -1,134 +1,109 b'' | |||||
1 | adding a |
|
1 | adding a | |
2 | hg email: option --date not recognized |
|
2 | Content-Type: text/plain; charset="us-ascii" | |
3 | hg email [OPTION]... [DEST]... |
|
3 | MIME-Version: 1.0 | |
4 |
|
4 | Content-Transfer-Encoding: 7bit | ||
5 | send changesets by email |
|
5 | Subject: [PATCH] a | |
6 |
|
6 | X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab | ||
7 | By default, diffs are sent in the format generated by hg export, |
|
7 | Message-Id: <8580ff50825a50c8f716.60@ | |
8 | one per message. The series starts with a "[PATCH 0 of N]" |
|
8 | Date: Thu, 01 Jan 1970 00:01:00 +0000 | |
9 | introduction, which describes the series as a whole. |
|
9 | From: quux | |
|
10 | To: foo | |||
|
11 | Cc: bar | |||
10 |
|
12 | |||
11 | Each patch email has a Subject line of "[PATCH M of N] ...", using |
|
13 | # HG changeset patch | |
12 | the first line of the changeset description as the subject text. |
|
14 | # User test | |
13 | The message contains two or three body parts. First, the rest of |
|
15 | # Date 1 0 | |
14 | the changeset description. Next, (optionally) if the diffstat |
|
16 | # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab | |
15 | program is installed, the result of running diffstat on the patch. |
|
17 | # Parent 0000000000000000000000000000000000000000 | |
16 | Finally, the patch itself, as generated by "hg export". |
|
18 | a | |
17 |
|
||||
18 | With --outgoing, emails will be generated for patches not |
|
|||
19 | found in the destination repository (or only those which are |
|
|||
20 | ancestors of the specified revisions if any are provided) |
|
|||
21 |
|
19 | |||
22 | With --bundle, changesets are selected as for --outgoing, |
|
20 | diff -r 000000000000 -r 8580ff50825a a | |
23 | but a single email containing a binary Mercurial bundle as an |
|
21 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
24 | attachment will be sent. |
|
22 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
25 |
|
23 | @@ -0,0 +1,1 @@ | ||
26 | Examples: |
|
24 | +a | |
27 |
|
||||
28 | hg email -r 3000 # send patch 3000 only |
|
|||
29 | hg email -r 3000 -r 3001 # send patches 3000 and 3001 |
|
|||
30 | hg email -r 3000:3005 # send patches 3000 through 3005 |
|
|||
31 | hg email 3000 # send patch 3000 (deprecated) |
|
|||
32 |
|
25 | |||
33 | hg email -o # send all patches not in default |
|
26 | This patch series consists of 1 patches. | |
34 | hg email -o DEST # send all patches not in DEST |
|
|||
35 | hg email -o -r 3000 # send all ancestors of 3000 not in default |
|
|||
36 | hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST |
|
|||
37 |
|
27 | |||
38 | hg email -b # send bundle of all patches not in default |
|
|||
39 | hg email -b DEST # send bundle of all patches not in DEST |
|
|||
40 | hg email -b -r 3000 # bundle of all ancestors of 3000 not in default |
|
|||
41 | hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST |
|
|||
42 |
|
||||
43 | Before using this command, you will need to enable email in your hgrc. |
|
|||
44 | See the [email] section in hgrc(5) for details. |
|
|||
45 |
|
||||
46 | options: |
|
|||
47 |
|
28 | |||
48 | -a --attach send patches as inline attachments |
|
29 | Displaying [PATCH] a ... | |
49 | --bcc email addresses of blind copy recipients |
|
30 | adding b | |
50 | -c --cc email addresses of copy recipients |
|
31 | Content-Type: text/plain; charset="us-ascii" | |
51 | -d --diffstat add diffstat output to messages |
|
32 | MIME-Version: 1.0 | |
52 | -g --git use git extended diff format |
|
33 | Content-Transfer-Encoding: 7bit | |
53 | -f --from email address of sender |
|
34 | Subject: [PATCH 0 of 2] test | |
54 | --plain omit hg patch header |
|
35 | Message-Id: <patchbomb.120@ | |
55 | -n --test print messages that would be sent |
|
36 | Date: Thu, 01 Jan 1970 00:02:00 +0000 | |
56 | -m --mbox write messages to mbox file instead of sending them |
|
37 | From: quux | |
57 | -o --outgoing send changes not found in the target repository |
|
38 | To: foo | |
58 | -b --bundle send changes not in target as a binary bundle |
|
39 | Cc: bar | |
59 | -r --rev a revision to send |
|
40 | ||
60 | -s --subject subject of first message (intro or single patch) |
|
41 | ||
61 | -t --to email addresses of recipients |
|
42 | Content-Type: text/plain; charset="us-ascii" | |
62 | --force run even when remote repository is unrelated (with -b) |
|
43 | MIME-Version: 1.0 | |
63 | --base a base changeset to specify instead of a destination (with -b) |
|
44 | Content-Transfer-Encoding: 7bit | |
64 | -e --ssh specify ssh command to use |
|
45 | Subject: [PATCH 1 of 2] a | |
65 | --remotecmd specify hg command to run on the remote side |
|
46 | X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab | |
|
47 | Message-Id: <8580ff50825a50c8f716.121@ | |||
|
48 | In-Reply-To: <patchbomb.120@ | |||
|
49 | Date: Thu, 01 Jan 1970 00:02:01 +0000 | |||
|
50 | From: quux | |||
|
51 | To: foo | |||
|
52 | Cc: bar | |||
66 |
|
53 | |||
67 | use "hg -v help email" to show global options |
|
54 | # HG changeset patch | |
68 | adding b |
|
55 | # User test | |
69 | hg email: option --date not recognized |
|
56 | # Date 1 0 | |
70 | hg email [OPTION]... [DEST]... |
|
57 | # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab | |
71 |
|
58 | # Parent 0000000000000000000000000000000000000000 | ||
72 | send changesets by email |
|
59 | a | |
73 |
|
||||
74 | By default, diffs are sent in the format generated by hg export, |
|
|||
75 | one per message. The series starts with a "[PATCH 0 of N]" |
|
|||
76 | introduction, which describes the series as a whole. |
|
|||
77 |
|
60 | |||
78 | Each patch email has a Subject line of "[PATCH M of N] ...", using |
|
61 | diff -r 000000000000 -r 8580ff50825a a | |
79 | the first line of the changeset description as the subject text. |
|
62 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
80 | The message contains two or three body parts. First, the rest of |
|
63 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
81 | the changeset description. Next, (optionally) if the diffstat |
|
64 | @@ -0,0 +1,1 @@ | |
82 | program is installed, the result of running diffstat on the patch. |
|
65 | +a | |
83 | Finally, the patch itself, as generated by "hg export". |
|
|||
84 |
|
||||
85 | With --outgoing, emails will be generated for patches not |
|
|||
86 | found in the destination repository (or only those which are |
|
|||
87 | ancestors of the specified revisions if any are provided) |
|
|||
88 |
|
66 | |||
89 | With --bundle, changesets are selected as for --outgoing, |
|
67 | Content-Type: text/plain; charset="us-ascii" | |
90 | but a single email containing a binary Mercurial bundle as an |
|
68 | MIME-Version: 1.0 | |
91 | attachment will be sent. |
|
69 | Content-Transfer-Encoding: 7bit | |
92 |
|
70 | Subject: [PATCH 2 of 2] b | ||
93 | Examples: |
|
71 | X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 | |
94 |
|
72 | Message-Id: <97d72e5f12c7e84f8506.122@ | ||
95 | hg email -r 3000 # send patch 3000 only |
|
73 | In-Reply-To: <patchbomb.120@ | |
96 | hg email -r 3000 -r 3001 # send patches 3000 and 3001 |
|
74 | Date: Thu, 01 Jan 1970 00:02:02 +0000 | |
97 | hg email -r 3000:3005 # send patches 3000 through 3005 |
|
75 | From: quux | |
98 | hg email 3000 # send patch 3000 (deprecated) |
|
76 | To: foo | |
|
77 | Cc: bar | |||
99 |
|
78 | |||
100 | hg email -o # send all patches not in default |
|
79 | # HG changeset patch | |
101 | hg email -o DEST # send all patches not in DEST |
|
80 | # User test | |
102 | hg email -o -r 3000 # send all ancestors of 3000 not in default |
|
81 | # Date 2 0 | |
103 | hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST |
|
82 | # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 | |
|
83 | # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab | |||
|
84 | b | |||
104 |
|
85 | |||
105 | hg email -b # send bundle of all patches not in default |
|
86 | diff -r 8580ff50825a -r 97d72e5f12c7 b | |
106 | hg email -b DEST # send bundle of all patches not in DEST |
|
87 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
107 | hg email -b -r 3000 # bundle of all ancestors of 3000 not in default |
|
88 | +++ b/b Thu Jan 01 00:00:02 1970 +0000 | |
108 | hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST |
|
89 | @@ -0,0 +1,1 @@ | |
|
90 | +b | |||
109 |
|
91 | |||
110 | Before using this command, you will need to enable email in your hgrc. |
|
92 | This patch series consists of 2 patches. | |
111 | See the [email] section in hgrc(5) for details. |
|
|||
112 |
|
93 | |||
113 | options: |
|
|||
114 |
|
94 | |||
115 | -a --attach send patches as inline attachments |
|
95 | Write the introductory message for the patch series. | |
116 | --bcc email addresses of blind copy recipients |
|
96 | ||
117 | -c --cc email addresses of copy recipients |
|
97 | ||
118 | -d --diffstat add diffstat output to messages |
|
98 | Displaying [PATCH 0 of 2] test ... | |
119 | -g --git use git extended diff format |
|
99 | Displaying [PATCH 1 of 2] a ... | |
120 | -f --from email address of sender |
|
100 | Displaying [PATCH 2 of 2] b ... | |
121 | --plain omit hg patch header |
|
101 | This patch series consists of 2 patches. | |
122 | -n --test print messages that would be sent |
|
|||
123 | -m --mbox write messages to mbox file instead of sending them |
|
|||
124 | -o --outgoing send changes not found in the target repository |
|
|||
125 | -b --bundle send changes not in target as a binary bundle |
|
|||
126 | -r --rev a revision to send |
|
|||
127 | -s --subject subject of first message (intro or single patch) |
|
|||
128 | -t --to email addresses of recipients |
|
|||
129 | --force run even when remote repository is unrelated (with -b) |
|
|||
130 | --base a base changeset to specify instead of a destination (with -b) |
|
|||
131 | -e --ssh specify ssh command to use |
|
|||
132 | --remotecmd specify hg command to run on the remote side |
|
|||
133 |
|
102 | |||
134 | use "hg -v help email" to show global options |
|
103 | ||
|
104 | Write the introductory message for the patch series. | |||
|
105 | ||||
|
106 | ||||
|
107 | Writing [PATCH 0 of 2] test ... | |||
|
108 | Writing [PATCH 1 of 2] a ... | |||
|
109 | Writing [PATCH 2 of 2] b ... |
General Comments 0
You need to be logged in to leave comments.
Login now