Show More
@@ -1,755 +1,756 | |||||
1 | $ cat > $TESTTMP/filter.py <<EOF |
|
1 | $ cat > $TESTTMP/filter.py <<EOF | |
2 | > from __future__ import absolute_import, print_function |
|
2 | > from __future__ import absolute_import, print_function | |
3 | > import re |
|
3 | > import re | |
4 | > import sys |
|
4 | > import sys | |
5 | > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") |
|
5 | > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ cat <<EOF >> $HGRCPATH |
|
8 | $ cat <<EOF >> $HGRCPATH | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > notify= |
|
10 | > notify= | |
11 | > |
|
11 | > | |
12 | > [hooks] |
|
12 | > [hooks] | |
13 | > incoming.notify = python:hgext.notify.hook |
|
13 | > incoming.notify = python:hgext.notify.hook | |
14 | > |
|
14 | > | |
15 | > [notify] |
|
15 | > [notify] | |
16 | > sources = pull |
|
16 | > sources = pull | |
17 | > diffstat = False |
|
17 | > diffstat = False | |
18 | > |
|
18 | > | |
19 | > [usersubs] |
|
19 | > [usersubs] | |
20 | > foo@bar = * |
|
20 | > foo@bar = * | |
21 | > |
|
21 | > | |
22 | > [reposubs] |
|
22 | > [reposubs] | |
23 | > * = baz |
|
23 | > * = baz | |
24 | > EOF |
|
24 | > EOF | |
25 | $ hg help notify |
|
25 | $ hg help notify | |
26 | notify extension - hooks for sending email push notifications |
|
26 | notify extension - hooks for sending email push notifications | |
27 |
|
27 | |||
28 | This extension implements hooks to send email notifications when changesets |
|
28 | This extension implements hooks to send email notifications when changesets | |
29 | are sent from or received by the local repository. |
|
29 | are sent from or received by the local repository. | |
30 |
|
30 | |||
31 | First, enable the extension as explained in 'hg help extensions', and register |
|
31 | First, enable the extension as explained in 'hg help extensions', and register | |
32 | the hook you want to run. "incoming" and "changegroup" hooks are run when |
|
32 | the hook you want to run. "incoming" and "changegroup" hooks are run when | |
33 | changesets are received, while "outgoing" hooks are for changesets sent to |
|
33 | changesets are received, while "outgoing" hooks are for changesets sent to | |
34 | another repository: |
|
34 | another repository: | |
35 |
|
35 | |||
36 | [hooks] |
|
36 | [hooks] | |
37 | # one email for each incoming changeset |
|
37 | # one email for each incoming changeset | |
38 | incoming.notify = python:hgext.notify.hook |
|
38 | incoming.notify = python:hgext.notify.hook | |
39 | # one email for all incoming changesets |
|
39 | # one email for all incoming changesets | |
40 | changegroup.notify = python:hgext.notify.hook |
|
40 | changegroup.notify = python:hgext.notify.hook | |
41 |
|
41 | |||
42 | # one email for all outgoing changesets |
|
42 | # one email for all outgoing changesets | |
43 | outgoing.notify = python:hgext.notify.hook |
|
43 | outgoing.notify = python:hgext.notify.hook | |
44 |
|
44 | |||
45 | This registers the hooks. To enable notification, subscribers must be assigned |
|
45 | This registers the hooks. To enable notification, subscribers must be assigned | |
46 | to repositories. The "[usersubs]" section maps multiple repositories to a |
|
46 | to repositories. The "[usersubs]" section maps multiple repositories to a | |
47 | given recipient. The "[reposubs]" section maps multiple recipients to a single |
|
47 | given recipient. The "[reposubs]" section maps multiple recipients to a single | |
48 | repository: |
|
48 | repository: | |
49 |
|
49 | |||
50 | [usersubs] |
|
50 | [usersubs] | |
51 | # key is subscriber email, value is a comma-separated list of repo patterns |
|
51 | # key is subscriber email, value is a comma-separated list of repo patterns | |
52 | user@host = pattern |
|
52 | user@host = pattern | |
53 |
|
53 | |||
54 | [reposubs] |
|
54 | [reposubs] | |
55 | # key is repo pattern, value is a comma-separated list of subscriber emails |
|
55 | # key is repo pattern, value is a comma-separated list of subscriber emails | |
56 | pattern = user@host |
|
56 | pattern = user@host | |
57 |
|
57 | |||
58 | A "pattern" is a "glob" matching the absolute path to a repository, optionally |
|
58 | A "pattern" is a "glob" matching the absolute path to a repository, optionally | |
59 | combined with a revset expression. A revset expression, if present, is |
|
59 | combined with a revset expression. A revset expression, if present, is | |
60 | separated from the glob by a hash. Example: |
|
60 | separated from the glob by a hash. Example: | |
61 |
|
61 | |||
62 | [reposubs] |
|
62 | [reposubs] | |
63 | */widgets#branch(release) = qa-team@example.com |
|
63 | */widgets#branch(release) = qa-team@example.com | |
64 |
|
64 | |||
65 | This sends to "qa-team@example.com" whenever a changeset on the "release" |
|
65 | This sends to "qa-team@example.com" whenever a changeset on the "release" | |
66 | branch triggers a notification in any repository ending in "widgets". |
|
66 | branch triggers a notification in any repository ending in "widgets". | |
67 |
|
67 | |||
68 | In order to place them under direct user management, "[usersubs]" and |
|
68 | In order to place them under direct user management, "[usersubs]" and | |
69 | "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated |
|
69 | "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated | |
70 | by reference: |
|
70 | by reference: | |
71 |
|
71 | |||
72 | [notify] |
|
72 | [notify] | |
73 | config = /path/to/subscriptionsfile |
|
73 | config = /path/to/subscriptionsfile | |
74 |
|
74 | |||
75 | Notifications will not be sent until the "notify.test" value is set to |
|
75 | Notifications will not be sent until the "notify.test" value is set to | |
76 | "False"; see below. |
|
76 | "False"; see below. | |
77 |
|
77 | |||
78 | Notifications content can be tweaked with the following configuration entries: |
|
78 | Notifications content can be tweaked with the following configuration entries: | |
79 |
|
79 | |||
80 | notify.test |
|
80 | notify.test | |
81 | If "True", print messages to stdout instead of sending them. Default: True. |
|
81 | If "True", print messages to stdout instead of sending them. Default: True. | |
82 |
|
82 | |||
83 | notify.sources |
|
83 | notify.sources | |
84 | Space-separated list of change sources. Notifications are activated only |
|
84 | Space-separated list of change sources. Notifications are activated only | |
85 | when a changeset's source is in this list. Sources may be: |
|
85 | when a changeset's source is in this list. Sources may be: | |
86 |
|
86 | |||
87 | "serve" changesets received via http or ssh |
|
87 | "serve" changesets received via http or ssh | |
88 | "pull" changesets received via "hg pull" |
|
88 | "pull" changesets received via "hg pull" | |
89 | "unbundle" changesets received via "hg unbundle" |
|
89 | "unbundle" changesets received via "hg unbundle" | |
90 | "push" changesets sent or received via "hg push" |
|
90 | "push" changesets sent or received via "hg push" | |
91 | "bundle" changesets sent via "hg unbundle" |
|
91 | "bundle" changesets sent via "hg unbundle" | |
92 |
|
92 | |||
93 | Default: serve. |
|
93 | Default: serve. | |
94 |
|
94 | |||
95 | notify.strip |
|
95 | notify.strip | |
96 | Number of leading slashes to strip from url paths. By default, notifications |
|
96 | Number of leading slashes to strip from url paths. By default, notifications | |
97 | reference repositories with their absolute path. "notify.strip" lets you |
|
97 | reference repositories with their absolute path. "notify.strip" lets you | |
98 | turn them into relative paths. For example, "notify.strip=3" will change |
|
98 | turn them into relative paths. For example, "notify.strip=3" will change | |
99 | "/long/path/repository" into "repository". Default: 0. |
|
99 | "/long/path/repository" into "repository". Default: 0. | |
100 |
|
100 | |||
101 | notify.domain |
|
101 | notify.domain | |
102 | Default email domain for sender or recipients with no explicit domain. It is |
|
102 | Default email domain for sender or recipients with no explicit domain. It is | |
103 | also used for the domain part of the "Message-Id" when using |
|
103 | also used for the domain part of the "Message-Id" when using | |
104 | "notify.messageidseed". |
|
104 | "notify.messageidseed". | |
105 |
|
105 | |||
106 | notify.messageidseed |
|
106 | notify.messageidseed | |
107 | Create deterministic "Message-Id" headers for the mails based on the seed |
|
107 | Create deterministic "Message-Id" headers for the mails based on the seed | |
108 | and the revision identifier of the first commit in the changeset. |
|
108 | and the revision identifier of the first commit in the changeset. | |
109 |
|
109 | |||
110 | notify.style |
|
110 | notify.style | |
111 | Style file to use when formatting emails. |
|
111 | Style file to use when formatting emails. | |
112 |
|
112 | |||
113 | notify.template |
|
113 | notify.template | |
114 | Template to use when formatting emails. |
|
114 | Template to use when formatting emails. | |
115 |
|
115 | |||
116 | notify.incoming |
|
116 | notify.incoming | |
117 | Template to use when run as an incoming hook, overriding "notify.template". |
|
117 | Template to use when run as an incoming hook, overriding "notify.template". | |
118 |
|
118 | |||
119 | notify.outgoing |
|
119 | notify.outgoing | |
120 | Template to use when run as an outgoing hook, overriding "notify.template". |
|
120 | Template to use when run as an outgoing hook, overriding "notify.template". | |
121 |
|
121 | |||
122 | notify.changegroup |
|
122 | notify.changegroup | |
123 | Template to use when running as a changegroup hook, overriding |
|
123 | Template to use when running as a changegroup hook, overriding | |
124 | "notify.template". |
|
124 | "notify.template". | |
125 |
|
125 | |||
126 | notify.maxdiff |
|
126 | notify.maxdiff | |
127 | Maximum number of diff lines to include in notification email. Set to 0 to |
|
127 | Maximum number of diff lines to include in notification email. Set to 0 to | |
128 | disable the diff, or -1 to include all of it. Default: 300. |
|
128 | disable the diff, or -1 to include all of it. Default: 300. | |
129 |
|
129 | |||
130 | notify.maxdiffstat |
|
130 | notify.maxdiffstat | |
131 | Maximum number of diffstat lines to include in notification email. Set to -1 |
|
131 | Maximum number of diffstat lines to include in notification email. Set to -1 | |
132 | to include all of it. Default: -1. |
|
132 | to include all of it. Default: -1. | |
133 |
|
133 | |||
134 | notify.maxsubject |
|
134 | notify.maxsubject | |
135 | Maximum number of characters in email's subject line. Default: 67. |
|
135 | Maximum number of characters in email's subject line. Default: 67. | |
136 |
|
136 | |||
137 | notify.diffstat |
|
137 | notify.diffstat | |
138 | Set to True to include a diffstat before diff content. Default: True. |
|
138 | Set to True to include a diffstat before diff content. Default: True. | |
139 |
|
139 | |||
140 | notify.showfunc |
|
140 | notify.showfunc | |
141 | If set, override "diff.showfunc" for the diff content. Default: None. |
|
141 | If set, override "diff.showfunc" for the diff content. Default: None. | |
142 |
|
142 | |||
143 | notify.merge |
|
143 | notify.merge | |
144 | If True, send notifications for merge changesets. Default: True. |
|
144 | If True, send notifications for merge changesets. Default: True. | |
145 |
|
145 | |||
146 | notify.mbox |
|
146 | notify.mbox | |
147 | If set, append mails to this mbox file instead of sending. Default: None. |
|
147 | If set, append mails to this mbox file instead of sending. Default: None. | |
148 |
|
148 | |||
149 | notify.fromauthor |
|
149 | notify.fromauthor | |
150 | If set, use the committer of the first changeset in a changegroup for the |
|
150 | If set, use the committer of the first changeset in a changegroup for the | |
151 | "From" field of the notification mail. If not set, take the user from the |
|
151 | "From" field of the notification mail. If not set, take the user from the | |
152 | pushing repo. Default: False. |
|
152 | pushing repo. Default: False. | |
153 |
|
153 | |||
154 | If set, the following entries will also be used to customize the |
|
154 | If set, the following entries will also be used to customize the | |
155 | notifications: |
|
155 | notifications: | |
156 |
|
156 | |||
157 | email.from |
|
157 | email.from | |
158 | Email "From" address to use if none can be found in the generated email |
|
158 | Email "From" address to use if none can be found in the generated email | |
159 | content. |
|
159 | content. | |
160 |
|
160 | |||
161 | web.baseurl |
|
161 | web.baseurl | |
162 | Root repository URL to combine with repository paths when making references. |
|
162 | Root repository URL to combine with repository paths when making references. | |
163 | See also "notify.strip". |
|
163 | See also "notify.strip". | |
164 |
|
164 | |||
165 | no commands defined |
|
165 | no commands defined | |
166 | $ hg init a |
|
166 | $ hg init a | |
167 | $ echo a > a/a |
|
167 | $ echo a > a/a | |
168 | $ echo b > a/b |
|
168 | $ echo b > a/b | |
169 |
|
169 | |||
170 | commit |
|
170 | commit | |
171 |
|
171 | |||
172 | $ hg --cwd a commit -Ama -d '0 0' |
|
172 | $ hg --cwd a commit -Ama -d '0 0' | |
173 | adding a |
|
173 | adding a | |
174 | adding b |
|
174 | adding b | |
175 |
|
175 | |||
176 | clone |
|
176 | clone | |
177 |
|
177 | |||
178 | $ hg --traceback clone a b |
|
178 | $ hg --traceback clone a b | |
179 | updating to branch default |
|
179 | updating to branch default | |
180 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
180 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
181 | $ echo a >> a/a |
|
181 | $ echo a >> a/a | |
182 | $ echo b >> a/b |
|
182 | $ echo b >> a/b | |
183 |
|
183 | |||
184 | commit |
|
184 | commit | |
185 |
|
185 | |||
186 | $ hg --traceback --cwd a commit -Amb -d '1 0' |
|
186 | $ hg --traceback --cwd a commit -Amb -d '1 0' | |
187 |
|
187 | |||
188 | on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line |
|
188 | on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line | |
189 |
|
189 | |||
190 | $ cat <<EOF >> $HGRCPATH |
|
190 | $ cat <<EOF >> $HGRCPATH | |
191 | > [notify] |
|
191 | > [notify] | |
192 | > maxsubject = 200 |
|
192 | > maxsubject = 200 | |
193 | > EOF |
|
193 | > EOF | |
194 |
|
194 | |||
195 | the python call below wraps continuation lines, which appear on Mac OS X 10.5 because |
|
195 | the python call below wraps continuation lines, which appear on Mac OS X 10.5 because | |
196 | of the very long subject line |
|
196 | of the very long subject line | |
197 | pull (minimal config) |
|
197 | pull (minimal config) | |
198 |
|
198 | |||
199 | $ hg --traceback --cwd b --config notify.domain=example.com --config notify.messageidseed=example pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
199 | $ hg --traceback --cwd b --config notify.domain=example.com --config notify.messageidseed=example pull ../a | "$PYTHON" $TESTTMP/filter.py | |
200 | pulling from ../a |
|
200 | pulling from ../a | |
201 | searching for changes |
|
201 | searching for changes | |
202 | adding changesets |
|
202 | adding changesets | |
203 | adding manifests |
|
203 | adding manifests | |
204 | adding file changes |
|
204 | adding file changes | |
205 | added 1 changesets with 2 changes to 2 files |
|
205 | added 1 changesets with 2 changes to 2 files | |
206 | new changesets 00a13f371396 |
|
206 | new changesets 00a13f371396 | |
207 | MIME-Version: 1.0 |
|
207 | MIME-Version: 1.0 | |
208 | Content-Type: text/plain; charset="us-ascii" |
|
208 | Content-Type: text/plain; charset="us-ascii" | |
209 | Content-Transfer-Encoding: 7bit |
|
209 | Content-Transfer-Encoding: 7bit | |
210 | Date: * (glob) |
|
210 | Date: * (glob) | |
211 | Subject: changeset in $TESTTMP/b: b |
|
211 | Subject: changeset in $TESTTMP/b: b | |
212 | From: test@example.com |
|
212 | From: test@example.com | |
213 | X-Hg-Notification: changeset 00a13f371396 |
|
213 | X-Hg-Notification: changeset 00a13f371396 | |
214 | Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (no-py3 !) |
|
214 | Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (no-py3 !) | |
215 | Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (py3 !) |
|
215 | Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (py3 !) | |
216 | To: baz@example.com, foo@bar |
|
216 | To: baz@example.com, foo@bar | |
217 |
|
217 | |||
218 | changeset 00a13f371396 in $TESTTMP/b |
|
218 | changeset 00a13f371396 in $TESTTMP/b | |
219 | details: $TESTTMP/b?cmd=changeset;node=00a13f371396 |
|
219 | details: $TESTTMP/b?cmd=changeset;node=00a13f371396 | |
220 | description: b |
|
220 | description: b | |
221 |
|
221 | |||
222 | diffs (12 lines): |
|
222 | diffs (12 lines): | |
223 |
|
223 | |||
224 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
224 | diff -r 0cd96de13884 -r 00a13f371396 a | |
225 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
225 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
226 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
226 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
227 | @@ -1,1 +1,2 @@ a |
|
227 | @@ -1,1 +1,2 @@ a | |
228 | +a |
|
228 | +a | |
229 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
229 | diff -r 0cd96de13884 -r 00a13f371396 b | |
230 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
230 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
231 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
231 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
232 | @@ -1,1 +1,2 @@ b |
|
232 | @@ -1,1 +1,2 @@ b | |
233 | +b |
|
233 | +b | |
234 | (run 'hg update' to get a working copy) |
|
234 | (run 'hg update' to get a working copy) | |
235 |
|
235 | |||
236 | $ cat <<EOF >> $HGRCPATH |
|
236 | $ cat <<EOF >> $HGRCPATH | |
237 | > [notify] |
|
237 | > [notify] | |
238 | > config = `pwd`/.notify.conf |
|
238 | > config = `pwd`/.notify.conf | |
239 | > domain = test.com |
|
239 | > domain = test.com | |
240 | > strip = 42 |
|
240 | > strip = 42 | |
241 | > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} |
|
241 | > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} | |
242 | > |
|
242 | > | |
243 | > [web] |
|
243 | > [web] | |
244 | > baseurl = http://test/ |
|
244 | > baseurl = http://test/ | |
245 | > EOF |
|
245 | > EOF | |
246 |
|
246 | |||
247 | fail for config file is missing |
|
247 | fail for config file is missing | |
248 |
|
248 | |||
249 | $ hg --cwd b rollback |
|
249 | $ hg --cwd b rollback | |
250 | repository tip rolled back to revision 0 (undo pull) |
|
250 | repository tip rolled back to revision 0 (undo pull) | |
251 | $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed |
|
251 | $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed | |
252 | pull failed |
|
252 | pull failed | |
253 | $ touch ".notify.conf" |
|
253 | $ touch ".notify.conf" | |
254 |
|
254 | |||
255 | pull |
|
255 | pull | |
256 |
|
256 | |||
257 | $ hg --cwd b rollback |
|
257 | $ hg --cwd b rollback | |
258 | repository tip rolled back to revision 0 (undo pull) |
|
258 | repository tip rolled back to revision 0 (undo pull) | |
259 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
259 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
260 | pulling from ../a |
|
260 | pulling from ../a | |
261 | searching for changes |
|
261 | searching for changes | |
262 | adding changesets |
|
262 | adding changesets | |
263 | adding manifests |
|
263 | adding manifests | |
264 | adding file changes |
|
264 | adding file changes | |
265 | added 1 changesets with 2 changes to 2 files |
|
265 | added 1 changesets with 2 changes to 2 files | |
266 | new changesets 00a13f371396 |
|
266 | new changesets 00a13f371396 | |
267 | MIME-Version: 1.0 |
|
267 | MIME-Version: 1.0 | |
268 | Content-Type: text/plain; charset="us-ascii" |
|
268 | Content-Type: text/plain; charset="us-ascii" | |
269 | Content-Transfer-Encoding: 7bit |
|
269 | Content-Transfer-Encoding: 7bit | |
270 | X-Test: foo |
|
270 | X-Test: foo | |
271 | Date: * (glob) |
|
271 | Date: * (glob) | |
272 | Subject: b |
|
272 | Subject: b | |
273 | From: test@test.com |
|
273 | From: test@test.com | |
274 | X-Hg-Notification: changeset 00a13f371396 |
|
274 | X-Hg-Notification: changeset 00a13f371396 | |
275 | Message-Id: <*> (glob) |
|
275 | Message-Id: <*> (glob) | |
276 | To: baz@test.com, foo@bar |
|
276 | To: baz@test.com, foo@bar | |
277 |
|
277 | |||
278 | changeset 00a13f371396 in b |
|
278 | changeset 00a13f371396 in b | |
279 | description: b |
|
279 | description: b | |
280 | diffs (12 lines): |
|
280 | diffs (12 lines): | |
281 |
|
281 | |||
282 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
282 | diff -r 0cd96de13884 -r 00a13f371396 a | |
283 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
283 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
284 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
284 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
285 | @@ -1,1 +1,2 @@ a |
|
285 | @@ -1,1 +1,2 @@ a | |
286 | +a |
|
286 | +a | |
287 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
287 | diff -r 0cd96de13884 -r 00a13f371396 b | |
288 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
288 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
289 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
289 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
290 | @@ -1,1 +1,2 @@ b |
|
290 | @@ -1,1 +1,2 @@ b | |
291 | +b |
|
291 | +b | |
292 | (run 'hg update' to get a working copy) |
|
292 | (run 'hg update' to get a working copy) | |
293 |
|
293 | |||
294 | $ cat << EOF >> $HGRCPATH |
|
294 | $ cat << EOF >> $HGRCPATH | |
295 | > [hooks] |
|
295 | > [hooks] | |
296 | > incoming.notify = python:hgext.notify.hook |
|
296 | > incoming.notify = python:hgext.notify.hook | |
297 | > |
|
297 | > | |
298 | > [notify] |
|
298 | > [notify] | |
299 | > sources = pull |
|
299 | > sources = pull | |
300 | > diffstat = True |
|
300 | > diffstat = True | |
301 | > EOF |
|
301 | > EOF | |
302 |
|
302 | |||
303 | pull |
|
303 | pull | |
304 |
|
304 | |||
305 | $ hg --cwd b rollback |
|
305 | $ hg --cwd b rollback | |
306 | repository tip rolled back to revision 0 (undo pull) |
|
306 | repository tip rolled back to revision 0 (undo pull) | |
307 | $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
307 | $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
308 | pulling from ../a |
|
308 | pulling from ../a | |
309 | searching for changes |
|
309 | searching for changes | |
310 | adding changesets |
|
310 | adding changesets | |
311 | adding manifests |
|
311 | adding manifests | |
312 | adding file changes |
|
312 | adding file changes | |
313 | added 1 changesets with 2 changes to 2 files |
|
313 | added 1 changesets with 2 changes to 2 files | |
314 | new changesets 00a13f371396 |
|
314 | new changesets 00a13f371396 | |
315 | MIME-Version: 1.0 |
|
315 | MIME-Version: 1.0 | |
316 | Content-Type: text/plain; charset="us-ascii" |
|
316 | Content-Type: text/plain; charset="us-ascii" | |
317 | Content-Transfer-Encoding: 7bit |
|
317 | Content-Transfer-Encoding: 7bit | |
318 | X-Test: foo |
|
318 | X-Test: foo | |
319 | Date: * (glob) |
|
319 | Date: * (glob) | |
320 | Subject: b |
|
320 | Subject: b | |
321 | From: test@test.com |
|
321 | From: test@test.com | |
322 | X-Hg-Notification: changeset 00a13f371396 |
|
322 | X-Hg-Notification: changeset 00a13f371396 | |
323 | Message-Id: <*> (glob) |
|
323 | Message-Id: <*> (glob) | |
324 | To: baz@test.com, foo@bar |
|
324 | To: baz@test.com, foo@bar | |
325 |
|
325 | |||
326 | changeset 00a13f371396 in b |
|
326 | changeset 00a13f371396 in b | |
327 | description: b |
|
327 | description: b | |
328 | diffstat (truncated from 2 to 1 lines): |
|
328 | diffstat (truncated from 2 to 1 lines): | |
329 | a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) |
|
329 | a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) | |
330 |
|
330 | |||
331 | diffs (12 lines): |
|
331 | diffs (12 lines): | |
332 |
|
332 | |||
333 | diff -r 0cd96de13884 -r 00a13f371396 a |
|
333 | diff -r 0cd96de13884 -r 00a13f371396 a | |
334 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
334 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
335 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
335 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
336 | @@ -1,1 +1,2 @@ a |
|
336 | @@ -1,1 +1,2 @@ a | |
337 | +a |
|
337 | +a | |
338 | diff -r 0cd96de13884 -r 00a13f371396 b |
|
338 | diff -r 0cd96de13884 -r 00a13f371396 b | |
339 | --- a/b Thu Jan 01 00:00:00 1970 +0000 |
|
339 | --- a/b Thu Jan 01 00:00:00 1970 +0000 | |
340 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 |
|
340 | +++ b/b Thu Jan 01 00:00:01 1970 +0000 | |
341 | @@ -1,1 +1,2 @@ b |
|
341 | @@ -1,1 +1,2 @@ b | |
342 | +b |
|
342 | +b | |
343 | (run 'hg update' to get a working copy) |
|
343 | (run 'hg update' to get a working copy) | |
344 |
|
344 | |||
345 | test merge |
|
345 | test merge | |
346 |
|
346 | |||
347 | $ cd a |
|
347 | $ cd a | |
348 | $ hg up -C 0 |
|
348 | $ hg up -C 0 | |
349 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
349 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
350 | $ echo a >> a |
|
350 | $ echo a >> a | |
351 | $ hg ci -Am adda2 -d '2 0' |
|
351 | $ hg ci -Am adda2 -d '2 0' | |
352 | created new head |
|
352 | created new head | |
353 | $ hg merge |
|
353 | $ hg merge | |
354 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
354 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
355 | (branch merge, don't forget to commit) |
|
355 | (branch merge, don't forget to commit) | |
356 | $ hg ci -m merge -d '3 0' |
|
356 | $ hg ci -m merge -d '3 0' | |
357 | $ cd .. |
|
357 | $ cd .. | |
358 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
358 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
359 | pulling from ../a |
|
359 | pulling from ../a | |
360 | searching for changes |
|
360 | searching for changes | |
361 | adding changesets |
|
361 | adding changesets | |
362 | adding manifests |
|
362 | adding manifests | |
363 | adding file changes |
|
363 | adding file changes | |
364 | added 2 changesets with 0 changes to 0 files |
|
364 | added 2 changesets with 0 changes to 0 files | |
365 | new changesets 3332653e1f3c:fccf66cd0c35 |
|
365 | new changesets 3332653e1f3c:fccf66cd0c35 | |
366 | MIME-Version: 1.0 |
|
366 | MIME-Version: 1.0 | |
367 | Content-Type: text/plain; charset="us-ascii" |
|
367 | Content-Type: text/plain; charset="us-ascii" | |
368 | Content-Transfer-Encoding: 7bit |
|
368 | Content-Transfer-Encoding: 7bit | |
369 | X-Test: foo |
|
369 | X-Test: foo | |
370 | Date: * (glob) |
|
370 | Date: * (glob) | |
371 | Subject: adda2 |
|
371 | Subject: adda2 | |
372 | From: test@test.com |
|
372 | From: test@test.com | |
373 | X-Hg-Notification: changeset 3332653e1f3c |
|
373 | X-Hg-Notification: changeset 3332653e1f3c | |
374 | Message-Id: <*> (glob) |
|
374 | Message-Id: <*> (glob) | |
375 | To: baz@test.com, foo@bar |
|
375 | To: baz@test.com, foo@bar | |
376 |
|
376 | |||
377 | changeset 3332653e1f3c in b |
|
377 | changeset 3332653e1f3c in b | |
378 | description: adda2 |
|
378 | description: adda2 | |
379 | diffstat: |
|
379 | diffstat: | |
380 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
380 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
381 |
|
381 | |||
382 | diffs (6 lines): |
|
382 | diffs (6 lines): | |
383 |
|
383 | |||
384 | diff -r 0cd96de13884 -r 3332653e1f3c a |
|
384 | diff -r 0cd96de13884 -r 3332653e1f3c a | |
385 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
385 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
386 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
386 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 | |
387 | @@ -1,1 +1,2 @@ a |
|
387 | @@ -1,1 +1,2 @@ a | |
388 | +a |
|
388 | +a | |
389 | MIME-Version: 1.0 |
|
389 | MIME-Version: 1.0 | |
390 | Content-Type: text/plain; charset="us-ascii" |
|
390 | Content-Type: text/plain; charset="us-ascii" | |
391 | Content-Transfer-Encoding: 7bit |
|
391 | Content-Transfer-Encoding: 7bit | |
392 | X-Test: foo |
|
392 | X-Test: foo | |
393 | Date: * (glob) |
|
393 | Date: * (glob) | |
394 | Subject: merge |
|
394 | Subject: merge | |
395 | From: test@test.com |
|
395 | From: test@test.com | |
396 | X-Hg-Notification: changeset fccf66cd0c35 |
|
396 | X-Hg-Notification: changeset fccf66cd0c35 | |
397 | Message-Id: <*> (glob) |
|
397 | Message-Id: <*> (glob) | |
398 | To: baz@test.com, foo@bar |
|
398 | To: baz@test.com, foo@bar | |
399 |
|
399 | |||
400 | changeset fccf66cd0c35 in b |
|
400 | changeset fccf66cd0c35 in b | |
401 | description: merge |
|
401 | description: merge | |
402 | diffstat: |
|
402 | diffstat: | |
403 | b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
403 | b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
404 |
|
404 | |||
405 | diffs (6 lines): |
|
405 | diffs (6 lines): | |
406 |
|
406 | |||
407 | diff -r 3332653e1f3c -r fccf66cd0c35 b |
|
407 | diff -r 3332653e1f3c -r fccf66cd0c35 b | |
408 | --- a/b Thu Jan 01 00:00:02 1970 +0000 |
|
408 | --- a/b Thu Jan 01 00:00:02 1970 +0000 | |
409 | +++ b/b Thu Jan 01 00:00:03 1970 +0000 |
|
409 | +++ b/b Thu Jan 01 00:00:03 1970 +0000 | |
410 | @@ -1,1 +1,2 @@ b |
|
410 | @@ -1,1 +1,2 @@ b | |
411 | +b |
|
411 | +b | |
412 | (run 'hg update' to get a working copy) |
|
412 | (run 'hg update' to get a working copy) | |
413 |
|
413 | |||
414 | non-ascii content and truncation of multi-byte subject |
|
414 | non-ascii content and truncation of multi-byte subject | |
415 |
|
415 | |||
416 | $ cat <<EOF >> $HGRCPATH |
|
416 | $ cat <<EOF >> $HGRCPATH | |
417 | > [notify] |
|
417 | > [notify] | |
418 | > maxsubject = 4 |
|
418 | > maxsubject = 4 | |
419 | > EOF |
|
419 | > EOF | |
420 | $ echo a >> a/a |
|
420 | $ echo a >> a/a | |
421 | $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ |
|
421 | $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ | |
422 |
> -m `"$PYTHON" -c 'pr |
|
422 | > -m `"$PYTHON" -c 'import sys; getattr(sys.stdout, "buffer", sys.stdout).write(b"\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'` | |
423 | $ hg --traceback --cwd b --encoding utf-8 pull ../a | \ |
|
423 | $ hg --traceback --cwd b --encoding utf-8 pull ../a | \ | |
424 | > "$PYTHON" $TESTTMP/filter.py |
|
424 | > "$PYTHON" $TESTTMP/filter.py | |
425 | pulling from ../a |
|
425 | pulling from ../a | |
426 | searching for changes |
|
426 | searching for changes | |
427 | adding changesets |
|
427 | adding changesets | |
428 | adding manifests |
|
428 | adding manifests | |
429 | adding file changes |
|
429 | adding file changes | |
430 | added 1 changesets with 1 changes to 1 files |
|
430 | added 1 changesets with 1 changes to 1 files | |
431 | new changesets 0f25f9c22b4c |
|
431 | new changesets 0f25f9c22b4c | |
432 | MIME-Version: 1.0 |
|
432 | MIME-Version: 1.0 | |
433 | Content-Type: text/plain; charset="us-ascii" |
|
433 | Content-Type: text/plain; charset="us-ascii" | |
434 | Content-Transfer-Encoding: 8bit |
|
434 | Content-Transfer-Encoding: 8bit | |
435 | X-Test: foo |
|
435 | X-Test: foo | |
436 | Date: * (glob) |
|
436 | Date: * (glob) | |
437 | Subject: \xc3\xa0... (esc) |
|
437 | Subject: \xc3\xa0... (esc) (no-py3 !) | |
|
438 | Subject: =?utf-8?b?w6AuLi4=?= (py3 !) | |||
438 | From: test@test.com |
|
439 | From: test@test.com | |
439 | X-Hg-Notification: changeset 0f25f9c22b4c |
|
440 | X-Hg-Notification: changeset 0f25f9c22b4c | |
440 | Message-Id: <*> (glob) |
|
441 | Message-Id: <*> (glob) | |
441 | To: baz@test.com, foo@bar |
|
442 | To: baz@test.com, foo@bar | |
442 |
|
443 | |||
443 | changeset 0f25f9c22b4c in b |
|
444 | changeset 0f25f9c22b4c in b | |
444 | description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc) |
|
445 | description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc) | |
445 | diffstat: |
|
446 | diffstat: | |
446 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
447 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
447 |
|
448 | |||
448 | diffs (7 lines): |
|
449 | diffs (7 lines): | |
449 |
|
450 | |||
450 | diff -r fccf66cd0c35 -r 0f25f9c22b4c a |
|
451 | diff -r fccf66cd0c35 -r 0f25f9c22b4c a | |
451 | --- a/a Thu Jan 01 00:00:03 1970 +0000 |
|
452 | --- a/a Thu Jan 01 00:00:03 1970 +0000 | |
452 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
453 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
453 | @@ -1,2 +1,3 @@ a a |
|
454 | @@ -1,2 +1,3 @@ a a | |
454 | +a |
|
455 | +a | |
455 | (run 'hg update' to get a working copy) |
|
456 | (run 'hg update' to get a working copy) | |
456 |
|
457 | |||
457 | long lines |
|
458 | long lines | |
458 |
|
459 | |||
459 | $ cat <<EOF >> $HGRCPATH |
|
460 | $ cat <<EOF >> $HGRCPATH | |
460 | > [notify] |
|
461 | > [notify] | |
461 | > maxsubject = 67 |
|
462 | > maxsubject = 67 | |
462 | > test = False |
|
463 | > test = False | |
463 | > mbox = mbox |
|
464 | > mbox = mbox | |
464 | > EOF |
|
465 | > EOF | |
465 | $ "$PYTHON" -c 'open("a/a", "ab").write(b"no" * 500 + b"\xd1\x84" + b"\n")' |
|
466 | $ "$PYTHON" -c 'open("a/a", "ab").write(b"no" * 500 + b"\xd1\x84" + b"\n")' | |
466 | $ hg --cwd a commit -A -m "long line" |
|
467 | $ hg --cwd a commit -A -m "long line" | |
467 | $ hg --traceback --cwd b pull ../a |
|
468 | $ hg --traceback --cwd b pull ../a | |
468 | pulling from ../a |
|
469 | pulling from ../a | |
469 | searching for changes |
|
470 | searching for changes | |
470 | adding changesets |
|
471 | adding changesets | |
471 | adding manifests |
|
472 | adding manifests | |
472 | adding file changes |
|
473 | adding file changes | |
473 | added 1 changesets with 1 changes to 1 files |
|
474 | added 1 changesets with 1 changes to 1 files | |
474 | new changesets a846b5f6ebb7 |
|
475 | new changesets a846b5f6ebb7 | |
475 | notify: sending 2 subscribers 1 changes |
|
476 | notify: sending 2 subscribers 1 changes | |
476 | (run 'hg update' to get a working copy) |
|
477 | (run 'hg update' to get a working copy) | |
477 | $ "$PYTHON" $TESTTMP/filter.py < b/mbox |
|
478 | $ "$PYTHON" $TESTTMP/filter.py < b/mbox | |
478 | From test@test.com ... ... .. ..:..:.. .... (re) |
|
479 | From test@test.com ... ... .. ..:..:.. .... (re) | |
479 | MIME-Version: 1.0 |
|
480 | MIME-Version: 1.0 | |
480 | Content-Type: text/plain; charset="*" (glob) |
|
481 | Content-Type: text/plain; charset="*" (glob) | |
481 | Content-Transfer-Encoding: quoted-printable |
|
482 | Content-Transfer-Encoding: quoted-printable | |
482 | X-Test: foo |
|
483 | X-Test: foo | |
483 | Date: * (glob) |
|
484 | Date: * (glob) | |
484 | Subject: long line |
|
485 | Subject: long line | |
485 | From: test@test.com |
|
486 | From: test@test.com | |
486 | X-Hg-Notification: changeset a846b5f6ebb7 |
|
487 | X-Hg-Notification: changeset a846b5f6ebb7 | |
487 | Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob) |
|
488 | Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob) | |
488 | To: baz@test.com, foo@bar |
|
489 | To: baz@test.com, foo@bar | |
489 |
|
490 | |||
490 | changeset a846b5f6ebb7 in b |
|
491 | changeset a846b5f6ebb7 in b | |
491 | description: long line |
|
492 | description: long line | |
492 | diffstat: |
|
493 | diffstat: | |
493 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) |
|
494 | a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) | |
494 |
|
495 | |||
495 | diffs (8 lines): |
|
496 | diffs (8 lines): | |
496 |
|
497 | |||
497 | diff -r 0f25f9c22b4c -r a846b5f6ebb7 a |
|
498 | diff -r 0f25f9c22b4c -r a846b5f6ebb7 a | |
498 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
499 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
499 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
500 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
500 | @@ -1,3 +1,4 @@ a a a |
|
501 | @@ -1,3 +1,4 @@ a a a | |
501 | +nonononononononononononononononononononononononononononononononononononono= |
|
502 | +nonononononononononononononononononononononononononononononononononononono= | |
502 | nononononononononononononononononononononononononononononononononononononon= |
|
503 | nononononononononononononononononononononononononononononononononononononon= | |
503 | ononononononononononononononononononononononononononononononononononononono= |
|
504 | ononononononononononononononononononononononononononononononononononononono= | |
504 | nononononononononononononononononononononononononononononononononononononon= |
|
505 | nononononononononononononononononononononononononononononononononononononon= | |
505 | ononononononononononononononononononononononononononononononononononononono= |
|
506 | ononononononononononononononononononononononononononononononononononononono= | |
506 | nononononononononononononononononononononononononononononononononononononon= |
|
507 | nononononononononononononononononononononononononononononononononononononon= | |
507 | ononononononononononononononononononononononononononononononononononononono= |
|
508 | ononononononononononononononononononononononononononononononononononononono= | |
508 | nononononononononononononononononononononononononononononononononononononon= |
|
509 | nononononononononononononononononononononononononononononononononononononon= | |
509 | ononononononononononononononononononononononononononononononononononononono= |
|
510 | ononononononononononononononononononononononononononononononononononononono= | |
510 | nononononononononononononononononononononononononononononononononononononon= |
|
511 | nononononononononononononononononononononononononononononononononononononon= | |
511 | ononononononononononononononononononononononononononononononononononononono= |
|
512 | ononononononononononononononononononononononononononononononononononononono= | |
512 | nononononononononononononononononononononononononononononononononononononon= |
|
513 | nononononononononononononononononononononononononononononononononononononon= | |
513 | ononononononononononononononononononononononononononononononononononononono= |
|
514 | ononononononononononononononononononononononononononononononononononononono= | |
514 | nonononononononononononono=D1=84 |
|
515 | nonononononononononononono=D1=84 | |
515 |
|
516 | |||
516 | revset selection: send to address that matches branch and repo |
|
517 | revset selection: send to address that matches branch and repo | |
517 |
|
518 | |||
518 | $ cat << EOF >> $HGRCPATH |
|
519 | $ cat << EOF >> $HGRCPATH | |
519 | > [hooks] |
|
520 | > [hooks] | |
520 | > incoming.notify = python:hgext.notify.hook |
|
521 | > incoming.notify = python:hgext.notify.hook | |
521 | > |
|
522 | > | |
522 | > [notify] |
|
523 | > [notify] | |
523 | > sources = pull |
|
524 | > sources = pull | |
524 | > test = True |
|
525 | > test = True | |
525 | > diffstat = False |
|
526 | > diffstat = False | |
526 | > maxdiff = 0 |
|
527 | > maxdiff = 0 | |
527 | > |
|
528 | > | |
528 | > [reposubs] |
|
529 | > [reposubs] | |
529 | > */a#branch(test) = will_no_be_send@example.com |
|
530 | > */a#branch(test) = will_no_be_send@example.com | |
530 | > */b#branch(test) = notify@example.com |
|
531 | > */b#branch(test) = notify@example.com | |
531 | > EOF |
|
532 | > EOF | |
532 | $ hg --cwd a branch test |
|
533 | $ hg --cwd a branch test | |
533 | marked working directory as branch test |
|
534 | marked working directory as branch test | |
534 | (branches are permanent and global, did you want a bookmark?) |
|
535 | (branches are permanent and global, did you want a bookmark?) | |
535 | $ echo a >> a/a |
|
536 | $ echo a >> a/a | |
536 | $ hg --cwd a ci -m test -d '1 0' |
|
537 | $ hg --cwd a ci -m test -d '1 0' | |
537 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
538 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
538 | pulling from ../a |
|
539 | pulling from ../a | |
539 | searching for changes |
|
540 | searching for changes | |
540 | adding changesets |
|
541 | adding changesets | |
541 | adding manifests |
|
542 | adding manifests | |
542 | adding file changes |
|
543 | adding file changes | |
543 | added 1 changesets with 1 changes to 1 files |
|
544 | added 1 changesets with 1 changes to 1 files | |
544 | new changesets f7e5aaed4080 |
|
545 | new changesets f7e5aaed4080 | |
545 | MIME-Version: 1.0 |
|
546 | MIME-Version: 1.0 | |
546 | Content-Type: text/plain; charset="us-ascii" |
|
547 | Content-Type: text/plain; charset="us-ascii" | |
547 | Content-Transfer-Encoding: 7bit |
|
548 | Content-Transfer-Encoding: 7bit | |
548 | X-Test: foo |
|
549 | X-Test: foo | |
549 | Date: * (glob) |
|
550 | Date: * (glob) | |
550 | Subject: test |
|
551 | Subject: test | |
551 | From: test@test.com |
|
552 | From: test@test.com | |
552 | X-Hg-Notification: changeset f7e5aaed4080 |
|
553 | X-Hg-Notification: changeset f7e5aaed4080 | |
553 | Message-Id: <hg.f7e5aaed4080.*.*@*> (glob) |
|
554 | Message-Id: <hg.f7e5aaed4080.*.*@*> (glob) | |
554 | To: baz@test.com, foo@bar, notify@example.com |
|
555 | To: baz@test.com, foo@bar, notify@example.com | |
555 |
|
556 | |||
556 | changeset f7e5aaed4080 in b |
|
557 | changeset f7e5aaed4080 in b | |
557 | description: test |
|
558 | description: test | |
558 | (run 'hg update' to get a working copy) |
|
559 | (run 'hg update' to get a working copy) | |
559 |
|
560 | |||
560 | revset selection: don't send to address that waits for mails |
|
561 | revset selection: don't send to address that waits for mails | |
561 | from different branch |
|
562 | from different branch | |
562 |
|
563 | |||
563 | $ hg --cwd a update default |
|
564 | $ hg --cwd a update default | |
564 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
565 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
565 | $ echo a >> a/a |
|
566 | $ echo a >> a/a | |
566 | $ hg --cwd a ci -m test -d '1 0' |
|
567 | $ hg --cwd a ci -m test -d '1 0' | |
567 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py |
|
568 | $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py | |
568 | pulling from ../a |
|
569 | pulling from ../a | |
569 | searching for changes |
|
570 | searching for changes | |
570 | adding changesets |
|
571 | adding changesets | |
571 | adding manifests |
|
572 | adding manifests | |
572 | adding file changes |
|
573 | adding file changes | |
573 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
574 | added 1 changesets with 0 changes to 0 files (+1 heads) | |
574 | new changesets 645eb6690ecf |
|
575 | new changesets 645eb6690ecf | |
575 | MIME-Version: 1.0 |
|
576 | MIME-Version: 1.0 | |
576 | Content-Type: text/plain; charset="us-ascii" |
|
577 | Content-Type: text/plain; charset="us-ascii" | |
577 | Content-Transfer-Encoding: 7bit |
|
578 | Content-Transfer-Encoding: 7bit | |
578 | X-Test: foo |
|
579 | X-Test: foo | |
579 | Date: * (glob) |
|
580 | Date: * (glob) | |
580 | Subject: test |
|
581 | Subject: test | |
581 | From: test@test.com |
|
582 | From: test@test.com | |
582 | X-Hg-Notification: changeset 645eb6690ecf |
|
583 | X-Hg-Notification: changeset 645eb6690ecf | |
583 | Message-Id: <hg.645eb6690ecf.*.*@*> (glob) |
|
584 | Message-Id: <hg.645eb6690ecf.*.*@*> (glob) | |
584 | To: baz@test.com, foo@bar |
|
585 | To: baz@test.com, foo@bar | |
585 |
|
586 | |||
586 | changeset 645eb6690ecf in b |
|
587 | changeset 645eb6690ecf in b | |
587 | description: test |
|
588 | description: test | |
588 | (run 'hg heads' to see heads) |
|
589 | (run 'hg heads' to see heads) | |
589 |
|
590 | |||
590 | default template: |
|
591 | default template: | |
591 |
|
592 | |||
592 | $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new" |
|
593 | $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new" | |
593 | $ mv "$HGRCPATH.new" $HGRCPATH |
|
594 | $ mv "$HGRCPATH.new" $HGRCPATH | |
594 | $ echo a >> a/a |
|
595 | $ echo a >> a/a | |
595 | $ hg --cwd a commit -m 'default template' |
|
596 | $ hg --cwd a commit -m 'default template' | |
596 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
597 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
597 | MIME-Version: 1.0 |
|
598 | MIME-Version: 1.0 | |
598 | Content-Type: text/plain; charset="us-ascii" |
|
599 | Content-Type: text/plain; charset="us-ascii" | |
599 | Content-Transfer-Encoding: 7bit |
|
600 | Content-Transfer-Encoding: 7bit | |
600 | Date: * (glob) |
|
601 | Date: * (glob) | |
601 | Subject: changeset in b: default template |
|
602 | Subject: changeset in b: default template | |
602 | From: test@test.com |
|
603 | From: test@test.com | |
603 | X-Hg-Notification: changeset 5cd4346eed47 |
|
604 | X-Hg-Notification: changeset 5cd4346eed47 | |
604 | Message-Id: <hg.5cd4346eed47.*.*@*> (glob) |
|
605 | Message-Id: <hg.5cd4346eed47.*.*@*> (glob) | |
605 | To: baz@test.com, foo@bar |
|
606 | To: baz@test.com, foo@bar | |
606 |
|
607 | |||
607 | changeset 5cd4346eed47 in $TESTTMP/b |
|
608 | changeset 5cd4346eed47 in $TESTTMP/b | |
608 | details: http://test/b?cmd=changeset;node=5cd4346eed47 |
|
609 | details: http://test/b?cmd=changeset;node=5cd4346eed47 | |
609 | description: default template |
|
610 | description: default template | |
610 |
|
611 | |||
611 | with style: |
|
612 | with style: | |
612 |
|
613 | |||
613 | $ cat <<EOF > notifystyle.map |
|
614 | $ cat <<EOF > notifystyle.map | |
614 | > changeset = "Subject: {desc|firstline|strip} |
|
615 | > changeset = "Subject: {desc|firstline|strip} | |
615 | > From: {author} |
|
616 | > From: {author} | |
616 | > {""} |
|
617 | > {""} | |
617 | > changeset {node|short}" |
|
618 | > changeset {node|short}" | |
618 | > EOF |
|
619 | > EOF | |
619 | $ cat <<EOF >> $HGRCPATH |
|
620 | $ cat <<EOF >> $HGRCPATH | |
620 | > [notify] |
|
621 | > [notify] | |
621 | > style = $TESTTMP/notifystyle.map |
|
622 | > style = $TESTTMP/notifystyle.map | |
622 | > EOF |
|
623 | > EOF | |
623 | $ echo a >> a/a |
|
624 | $ echo a >> a/a | |
624 | $ hg --cwd a commit -m 'with style' |
|
625 | $ hg --cwd a commit -m 'with style' | |
625 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
626 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
626 | MIME-Version: 1.0 |
|
627 | MIME-Version: 1.0 | |
627 | Content-Type: text/plain; charset="us-ascii" |
|
628 | Content-Type: text/plain; charset="us-ascii" | |
628 | Content-Transfer-Encoding: 7bit |
|
629 | Content-Transfer-Encoding: 7bit | |
629 | Date: * (glob) |
|
630 | Date: * (glob) | |
630 | Subject: with style |
|
631 | Subject: with style | |
631 | From: test@test.com |
|
632 | From: test@test.com | |
632 | X-Hg-Notification: changeset ec8d9d852f56 |
|
633 | X-Hg-Notification: changeset ec8d9d852f56 | |
633 | Message-Id: <hg.ec8d9d852f56.*.*@*> (glob) |
|
634 | Message-Id: <hg.ec8d9d852f56.*.*@*> (glob) | |
634 | To: baz@test.com, foo@bar |
|
635 | To: baz@test.com, foo@bar | |
635 |
|
636 | |||
636 | changeset ec8d9d852f56 |
|
637 | changeset ec8d9d852f56 | |
637 |
|
638 | |||
638 | with template (overrides style): |
|
639 | with template (overrides style): | |
639 |
|
640 | |||
640 | $ cat <<EOF >> $HGRCPATH |
|
641 | $ cat <<EOF >> $HGRCPATH | |
641 | > template = Subject: {node|short}: {desc|firstline|strip} |
|
642 | > template = Subject: {node|short}: {desc|firstline|strip} | |
642 | > From: {author} |
|
643 | > From: {author} | |
643 | > {""} |
|
644 | > {""} | |
644 | > {desc} |
|
645 | > {desc} | |
645 | > EOF |
|
646 | > EOF | |
646 | $ echo a >> a/a |
|
647 | $ echo a >> a/a | |
647 | $ hg --cwd a commit -m 'with template' |
|
648 | $ hg --cwd a commit -m 'with template' | |
648 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py |
|
649 | $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py | |
649 | MIME-Version: 1.0 |
|
650 | MIME-Version: 1.0 | |
650 | Content-Type: text/plain; charset="us-ascii" |
|
651 | Content-Type: text/plain; charset="us-ascii" | |
651 | Content-Transfer-Encoding: 7bit |
|
652 | Content-Transfer-Encoding: 7bit | |
652 | Date: * (glob) |
|
653 | Date: * (glob) | |
653 | Subject: 14721b538ae3: with template |
|
654 | Subject: 14721b538ae3: with template | |
654 | From: test@test.com |
|
655 | From: test@test.com | |
655 | X-Hg-Notification: changeset 14721b538ae3 |
|
656 | X-Hg-Notification: changeset 14721b538ae3 | |
656 | Message-Id: <hg.14721b538ae3.*.*@*> (glob) |
|
657 | Message-Id: <hg.14721b538ae3.*.*@*> (glob) | |
657 | To: baz@test.com, foo@bar |
|
658 | To: baz@test.com, foo@bar | |
658 |
|
659 | |||
659 | with template |
|
660 | with template | |
660 |
|
661 | |||
661 | showfunc diff |
|
662 | showfunc diff | |
662 | $ cat <<EOF >> $HGRCPATH |
|
663 | $ cat <<EOF >> $HGRCPATH | |
663 | > showfunc = True |
|
664 | > showfunc = True | |
664 | > template = |
|
665 | > template = | |
665 | > maxdiff = -1 |
|
666 | > maxdiff = -1 | |
666 | > EOF |
|
667 | > EOF | |
667 | $ cd a |
|
668 | $ cd a | |
668 | $ cat > f1 << EOF |
|
669 | $ cat > f1 << EOF | |
669 | > int main() { |
|
670 | > int main() { | |
670 | > int a = 0; |
|
671 | > int a = 0; | |
671 | > int b = 1; |
|
672 | > int b = 1; | |
672 | > int c = 2; |
|
673 | > int c = 2; | |
673 | > int d = 3; |
|
674 | > int d = 3; | |
674 | > return a + b + c + d; |
|
675 | > return a + b + c + d; | |
675 | > } |
|
676 | > } | |
676 | > EOF |
|
677 | > EOF | |
677 | $ hg commit -Am addfunction |
|
678 | $ hg commit -Am addfunction | |
678 | adding f1 |
|
679 | adding f1 | |
679 | $ hg --cwd ../b pull ../a |
|
680 | $ hg --cwd ../b pull ../a | |
680 | pulling from ../a |
|
681 | pulling from ../a | |
681 | searching for changes |
|
682 | searching for changes | |
682 | adding changesets |
|
683 | adding changesets | |
683 | adding manifests |
|
684 | adding manifests | |
684 | adding file changes |
|
685 | adding file changes | |
685 | added 1 changesets with 1 changes to 1 files |
|
686 | added 1 changesets with 1 changes to 1 files | |
686 | new changesets b86bc16ff894 |
|
687 | new changesets b86bc16ff894 | |
687 | MIME-Version: 1.0 |
|
688 | MIME-Version: 1.0 | |
688 | Content-Type: text/plain; charset="us-ascii" |
|
689 | Content-Type: text/plain; charset="us-ascii" | |
689 | Content-Transfer-Encoding: 7bit |
|
690 | Content-Transfer-Encoding: 7bit | |
690 | Date: * (glob) |
|
691 | Date: * (glob) | |
691 | Subject: addfunction |
|
692 | Subject: addfunction | |
692 | From: test@test.com |
|
693 | From: test@test.com | |
693 | X-Hg-Notification: changeset b86bc16ff894 |
|
694 | X-Hg-Notification: changeset b86bc16ff894 | |
694 | Message-Id: <hg.b86bc16ff894.*.*@*> (glob) |
|
695 | Message-Id: <hg.b86bc16ff894.*.*@*> (glob) | |
695 | To: baz@test.com, foo@bar |
|
696 | To: baz@test.com, foo@bar | |
696 |
|
697 | |||
697 | changeset b86bc16ff894 |
|
698 | changeset b86bc16ff894 | |
698 | diffs (11 lines): |
|
699 | diffs (11 lines): | |
699 |
|
700 | |||
700 | diff -r 14721b538ae3 -r b86bc16ff894 f1 |
|
701 | diff -r 14721b538ae3 -r b86bc16ff894 f1 | |
701 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
702 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
702 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
703 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 | |
703 | @@ -0,0 +1,7 @@ |
|
704 | @@ -0,0 +1,7 @@ | |
704 | +int main() { |
|
705 | +int main() { | |
705 | + int a = 0; |
|
706 | + int a = 0; | |
706 | + int b = 1; |
|
707 | + int b = 1; | |
707 | + int c = 2; |
|
708 | + int c = 2; | |
708 | + int d = 3; |
|
709 | + int d = 3; | |
709 | + return a + b + c + d; |
|
710 | + return a + b + c + d; | |
710 | +} |
|
711 | +} | |
711 | (run 'hg update' to get a working copy) |
|
712 | (run 'hg update' to get a working copy) | |
712 | $ cat > f1 << EOF |
|
713 | $ cat > f1 << EOF | |
713 | > int main() { |
|
714 | > int main() { | |
714 | > int a = 0; |
|
715 | > int a = 0; | |
715 | > int b = 1; |
|
716 | > int b = 1; | |
716 | > int c = 2; |
|
717 | > int c = 2; | |
717 | > int e = 3; |
|
718 | > int e = 3; | |
718 | > return a + b + c + e; |
|
719 | > return a + b + c + e; | |
719 | > } |
|
720 | > } | |
720 | > EOF |
|
721 | > EOF | |
721 | $ hg commit -m changefunction |
|
722 | $ hg commit -m changefunction | |
722 | $ hg --cwd ../b --config notify.showfunc=True pull ../a |
|
723 | $ hg --cwd ../b --config notify.showfunc=True pull ../a | |
723 | pulling from ../a |
|
724 | pulling from ../a | |
724 | searching for changes |
|
725 | searching for changes | |
725 | adding changesets |
|
726 | adding changesets | |
726 | adding manifests |
|
727 | adding manifests | |
727 | adding file changes |
|
728 | adding file changes | |
728 | added 1 changesets with 1 changes to 1 files |
|
729 | added 1 changesets with 1 changes to 1 files | |
729 | new changesets e81040e9838c |
|
730 | new changesets e81040e9838c | |
730 | MIME-Version: 1.0 |
|
731 | MIME-Version: 1.0 | |
731 | Content-Type: text/plain; charset="us-ascii" |
|
732 | Content-Type: text/plain; charset="us-ascii" | |
732 | Content-Transfer-Encoding: 7bit |
|
733 | Content-Transfer-Encoding: 7bit | |
733 | Date: * (glob) |
|
734 | Date: * (glob) | |
734 | Subject: changefunction |
|
735 | Subject: changefunction | |
735 | From: test@test.com |
|
736 | From: test@test.com | |
736 | X-Hg-Notification: changeset e81040e9838c |
|
737 | X-Hg-Notification: changeset e81040e9838c | |
737 | Message-Id: <hg.e81040e9838c.*.*@*> (glob) |
|
738 | Message-Id: <hg.e81040e9838c.*.*@*> (glob) | |
738 | To: baz@test.com, foo@bar |
|
739 | To: baz@test.com, foo@bar | |
739 |
|
740 | |||
740 | changeset e81040e9838c |
|
741 | changeset e81040e9838c | |
741 | diffs (12 lines): |
|
742 | diffs (12 lines): | |
742 |
|
743 | |||
743 | diff -r b86bc16ff894 -r e81040e9838c f1 |
|
744 | diff -r b86bc16ff894 -r e81040e9838c f1 | |
744 | --- a/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
745 | --- a/f1 Thu Jan 01 00:00:00 1970 +0000 | |
745 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 |
|
746 | +++ b/f1 Thu Jan 01 00:00:00 1970 +0000 | |
746 | @@ -2,6 +2,6 @@ int main() { |
|
747 | @@ -2,6 +2,6 @@ int main() { | |
747 | int a = 0; |
|
748 | int a = 0; | |
748 | int b = 1; |
|
749 | int b = 1; | |
749 | int c = 2; |
|
750 | int c = 2; | |
750 | - int d = 3; |
|
751 | - int d = 3; | |
751 | - return a + b + c + d; |
|
752 | - return a + b + c + d; | |
752 | + int e = 3; |
|
753 | + int e = 3; | |
753 | + return a + b + c + e; |
|
754 | + return a + b + c + e; | |
754 | } |
|
755 | } | |
755 | (run 'hg update' to get a working copy) |
|
756 | (run 'hg update' to get a working copy) |
General Comments 0
You need to be logged in to leave comments.
Login now