##// END OF EJS Templates
tests: handle Message-Id email header possible wrapping...
Denis Laxalde -
r43642:4128ffba stable
parent child Browse files
Show More
@@ -0,0 +1,6 b''
1 from __future__ import absolute_import, print_function
2
3 import re
4 import sys
5
6 print(re.sub(r"(?<=Message-Id:) \n ", " ", sys.stdin.read()), end="")
@@ -1,1475 +1,1476 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Run kwdemo outside a repo
3 Run kwdemo outside a repo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
5 [extensions]
5 [extensions]
6 keyword =
6 keyword =
7 [keyword]
7 [keyword]
8 demo.txt =
8 demo.txt =
9 [keywordset]
9 [keywordset]
10 svn = False
10 svn = False
11 [keywordmaps]
11 [keywordmaps]
12 Foo = {author|user}
12 Foo = {author|user}
13 $Foo: test $
13 $Foo: test $
14
14
15 $ cat <<EOF >> $HGRCPATH
15 $ cat <<EOF >> $HGRCPATH
16 > [extensions]
16 > [extensions]
17 > keyword =
17 > keyword =
18 > mq =
18 > mq =
19 > notify =
19 > notify =
20 > record =
20 > record =
21 > transplant =
21 > transplant =
22 > [ui]
22 > [ui]
23 > interactive = true
23 > interactive = true
24 > EOF
24 > EOF
25
25
26 hide outer repo
26 hide outer repo
27 $ hg init
27 $ hg init
28
28
29 Run kwdemo before [keyword] files are set up
29 Run kwdemo before [keyword] files are set up
30 as it would succeed without uisetup otherwise
30 as it would succeed without uisetup otherwise
31
31
32 $ hg --quiet kwdemo
32 $ hg --quiet kwdemo
33 [extensions]
33 [extensions]
34 keyword =
34 keyword =
35 [keyword]
35 [keyword]
36 demo.txt =
36 demo.txt =
37 [keywordset]
37 [keywordset]
38 svn = False
38 svn = False
39 [keywordmaps]
39 [keywordmaps]
40 Author = {author|user}
40 Author = {author|user}
41 Date = {date|utcdate}
41 Date = {date|utcdate}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
44 RCSFile = {file|basename},v
44 RCSFile = {file|basename},v
45 RCSfile = {file|basename},v
45 RCSfile = {file|basename},v
46 Revision = {node|short}
46 Revision = {node|short}
47 Source = {root}/{file},v
47 Source = {root}/{file},v
48 $Author: test $
48 $Author: test $
49 $Date: ????/??/?? ??:??:?? $ (glob)
49 $Date: ????/??/?? ??:??:?? $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
52 $RCSFile: demo.txt,v $
52 $RCSFile: demo.txt,v $
53 $RCSfile: demo.txt,v $
53 $RCSfile: demo.txt,v $
54 $Revision: ???????????? $ (glob)
54 $Revision: ???????????? $ (glob)
55 $Source: */demo.txt,v $ (glob)
55 $Source: */demo.txt,v $ (glob)
56
56
57 $ hg --quiet kwdemo "Branch = {branches}"
57 $ hg --quiet kwdemo "Branch = {branches}"
58 [extensions]
58 [extensions]
59 keyword =
59 keyword =
60 [keyword]
60 [keyword]
61 demo.txt =
61 demo.txt =
62 [keywordset]
62 [keywordset]
63 svn = False
63 svn = False
64 [keywordmaps]
64 [keywordmaps]
65 Branch = {branches}
65 Branch = {branches}
66 $Branch: demobranch $
66 $Branch: demobranch $
67
67
68 (test template filter svnisodate and svnutcdate)
68 (test template filter svnisodate and svnutcdate)
69
69
70 $ hg --quiet kwdemo --config keywordset.svn=True
70 $ hg --quiet kwdemo --config keywordset.svn=True
71 [extensions]
71 [extensions]
72 keyword =
72 keyword =
73 [keyword]
73 [keyword]
74 demo.txt =
74 demo.txt =
75 [keywordset]
75 [keywordset]
76 svn = True
76 svn = True
77 [keywordmaps]
77 [keywordmaps]
78 Author = {author|user}
78 Author = {author|user}
79 Date = {date|svnisodate}
79 Date = {date|svnisodate}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
81 LastChangedBy = {author|user}
81 LastChangedBy = {author|user}
82 LastChangedDate = {date|svnisodate}
82 LastChangedDate = {date|svnisodate}
83 LastChangedRevision = {node|short}
83 LastChangedRevision = {node|short}
84 Revision = {node|short}
84 Revision = {node|short}
85 $Author: test $
85 $Author: test $
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
88 $LastChangedBy: test $
88 $LastChangedBy: test $
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
92
92
93 $ cat <<EOF >> $HGRCPATH
93 $ cat <<EOF >> $HGRCPATH
94 > [keyword]
94 > [keyword]
95 > ** =
95 > ** =
96 > b = ignore
96 > b = ignore
97 > i = ignore
97 > i = ignore
98 > [hooks]
98 > [hooks]
99 > EOF
99 > EOF
100 $ cp $HGRCPATH $HGRCPATH.nohooks
100 $ cp $HGRCPATH $HGRCPATH.nohooks
101 > cat <<EOF >> $HGRCPATH
101 > cat <<EOF >> $HGRCPATH
102 > commit=
102 > commit=
103 > commit.test=cp a hooktest
103 > commit.test=cp a hooktest
104 > EOF
104 > EOF
105
105
106 $ hg init Test-bndl
106 $ hg init Test-bndl
107 $ cd Test-bndl
107 $ cd Test-bndl
108
108
109 kwshrink should exit silently in empty/invalid repo
109 kwshrink should exit silently in empty/invalid repo
110
110
111 $ hg kwshrink
111 $ hg kwshrink
112
112
113 Symlinks cannot be created on Windows.
113 Symlinks cannot be created on Windows.
114 A bundle to test this was made with:
114 A bundle to test this was made with:
115 hg init t
115 hg init t
116 cd t
116 cd t
117 echo a > a
117 echo a > a
118 ln -s a sym
118 ln -s a sym
119 hg add sym
119 hg add sym
120 hg ci -m addsym -u mercurial
120 hg ci -m addsym -u mercurial
121 hg bundle --base null ../test-keyword.hg
121 hg bundle --base null ../test-keyword.hg
122
122
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 1 changes to 1 files
127 added 1 changesets with 1 changes to 1 files
128 new changesets a2392c293916 (1 drafts)
128 new changesets a2392c293916 (1 drafts)
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 $ hg up a2392c293916
130 $ hg up a2392c293916
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132
132
133 $ echo 'expand $Id$' > a
133 $ echo 'expand $Id$' > a
134 $ echo 'do not process $Id:' >> a
134 $ echo 'do not process $Id:' >> a
135 $ echo 'xxx $' >> a
135 $ echo 'xxx $' >> a
136 $ echo 'ignore $Id$' > b
136 $ echo 'ignore $Id$' > b
137
137
138 Output files as they were created
138 Output files as they were created
139
139
140 $ cat a b
140 $ cat a b
141 expand $Id$
141 expand $Id$
142 do not process $Id:
142 do not process $Id:
143 xxx $
143 xxx $
144 ignore $Id$
144 ignore $Id$
145
145
146 no kwfiles
146 no kwfiles
147
147
148 $ hg kwfiles
148 $ hg kwfiles
149
149
150 untracked candidates
150 untracked candidates
151
151
152 $ hg -v kwfiles --unknown
152 $ hg -v kwfiles --unknown
153 k a
153 k a
154
154
155 Add files and check status
155 Add files and check status
156
156
157 $ hg addremove
157 $ hg addremove
158 adding a
158 adding a
159 adding b
159 adding b
160 $ hg status
160 $ hg status
161 A a
161 A a
162 A b
162 A b
163
163
164
164
165 Default keyword expansion including commit hook
165 Default keyword expansion including commit hook
166 Interrupted commit should not change state or run commit hook
166 Interrupted commit should not change state or run commit hook
167
167
168 $ hg --debug commit
168 $ hg --debug commit
169 abort: empty commit message
169 abort: empty commit message
170 [255]
170 [255]
171 $ hg status
171 $ hg status
172 A a
172 A a
173 A b
173 A b
174
174
175 Commit with several checks
175 Commit with several checks
176
176
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
178 committing files:
178 committing files:
179 a
179 a
180 b
180 b
181 committing manifest
181 committing manifest
182 committing changelog
182 committing changelog
183 overwriting a expanding keywords
183 overwriting a expanding keywords
184 updating the branch cache
184 updating the branch cache
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
186 running hook commit.test: cp a hooktest
186 running hook commit.test: cp a hooktest
187 $ hg status
187 $ hg status
188 ? hooktest
188 ? hooktest
189 $ hg debugrebuildstate
189 $ hg debugrebuildstate
190 $ hg --quiet identify
190 $ hg --quiet identify
191 ef63ca68695b
191 ef63ca68695b
192
192
193 cat files in working directory with keywords expanded
193 cat files in working directory with keywords expanded
194
194
195 $ cat a b
195 $ cat a b
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
197 do not process $Id:
197 do not process $Id:
198 xxx $
198 xxx $
199 ignore $Id$
199 ignore $Id$
200
200
201 hg cat files and symlink, no expansion
201 hg cat files and symlink, no expansion
202
202
203 $ hg cat sym a b && echo
203 $ hg cat sym a b && echo
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
205 do not process $Id:
205 do not process $Id:
206 xxx $
206 xxx $
207 ignore $Id$
207 ignore $Id$
208 a
208 a
209
209
210 $ diff a hooktest
210 $ diff a hooktest
211
211
212 $ cp $HGRCPATH.nohooks $HGRCPATH
212 $ cp $HGRCPATH.nohooks $HGRCPATH
213 $ rm hooktest
213 $ rm hooktest
214
214
215 hg status of kw-ignored binary file starting with '\1\n'
215 hg status of kw-ignored binary file starting with '\1\n'
216
216
217 >>> open("i", "wb").write(b"\1\nfoo") and None
217 >>> open("i", "wb").write(b"\1\nfoo") and None
218 $ hg -q commit -Am metasep i
218 $ hg -q commit -Am metasep i
219 $ hg status
219 $ hg status
220 >>> open("i", "wb").write(b"\1\nbar") and None
220 >>> open("i", "wb").write(b"\1\nbar") and None
221 $ hg status
221 $ hg status
222 M i
222 M i
223 $ hg -q commit -m "modify metasep" i
223 $ hg -q commit -m "modify metasep" i
224 $ hg status --rev 2:3
224 $ hg status --rev 2:3
225 M i
225 M i
226 $ touch empty
226 $ touch empty
227 $ hg -q commit -A -m "another file"
227 $ hg -q commit -A -m "another file"
228 $ hg status -A --rev 3:4 i
228 $ hg status -A --rev 3:4 i
229 C i
229 C i
230
230
231 $ hg -q strip --no-backup 2
231 $ hg -q strip --no-backup 2
232
232
233 Test hook execution
233 Test hook execution
234
234
235 bundle
235 bundle
236
236
237 $ hg bundle --base null ../kw.hg
237 $ hg bundle --base null ../kw.hg
238 2 changesets found
238 2 changesets found
239 $ cd ..
239 $ cd ..
240 $ hg init Test
240 $ hg init Test
241 $ cd Test
241 $ cd Test
242
242
243 Notify on pull to check whether keywords stay as is in email
243 Notify on pull to check whether keywords stay as is in email
244 ie. if patch.diff wrapper acts as it should
244 ie. if patch.diff wrapper acts as it should
245
245
246 $ cat <<EOF >> $HGRCPATH
246 $ cat <<EOF >> $HGRCPATH
247 > [hooks]
247 > [hooks]
248 > incoming.notify = python:hgext.notify.hook
248 > incoming.notify = python:hgext.notify.hook
249 > [notify]
249 > [notify]
250 > sources = pull
250 > sources = pull
251 > diffstat = False
251 > diffstat = False
252 > maxsubject = 15
252 > maxsubject = 15
253 > [reposubs]
253 > [reposubs]
254 > * = Test
254 > * = Test
255 > EOF
255 > EOF
256
256
257 Pull from bundle and trigger notify
257 Pull from bundle and trigger notify
258
258
259 $ hg pull -u ../kw.hg
259 $ hg pull -u ../kw.hg | \
260 > "$PYTHON" $TESTDIR/unwrap-message-id.py
260 pulling from ../kw.hg
261 pulling from ../kw.hg
261 requesting all changes
262 requesting all changes
262 adding changesets
263 adding changesets
263 adding manifests
264 adding manifests
264 adding file changes
265 adding file changes
265 added 2 changesets with 3 changes to 3 files
266 added 2 changesets with 3 changes to 3 files
266 new changesets a2392c293916:ef63ca68695b (2 drafts)
267 new changesets a2392c293916:ef63ca68695b (2 drafts)
267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 MIME-Version: 1.0
269 MIME-Version: 1.0
269 Content-Type: text/plain; charset="us-ascii"
270 Content-Type: text/plain; charset="us-ascii"
270 Content-Transfer-Encoding: 7bit
271 Content-Transfer-Encoding: 7bit
271 Date: * (glob)
272 Date: * (glob)
272 Subject: changeset in...
273 Subject: changeset in...
273 From: mercurial
274 From: mercurial
274 X-Hg-Notification: changeset a2392c293916
275 X-Hg-Notification: changeset a2392c293916
275 Message-Id: <hg.a2392c293916*> (glob)
276 Message-Id: <hg.a2392c293916*> (glob)
276 To: Test
277 To: Test
277
278
278 changeset a2392c293916 in $TESTTMP/Test
279 changeset a2392c293916 in $TESTTMP/Test
279 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
280 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
280 description:
281 description:
281 addsym
282 addsym
282
283
283 diffs (6 lines):
284 diffs (6 lines):
284
285
285 diff -r 000000000000 -r a2392c293916 sym
286 diff -r 000000000000 -r a2392c293916 sym
286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
288 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
288 @@ -0,0 +1,1 @@
289 @@ -0,0 +1,1 @@
289 +a
290 +a
290 \ No newline at end of file
291 \ No newline at end of file
291 MIME-Version: 1.0
292 MIME-Version: 1.0
292 Content-Type: text/plain; charset="us-ascii"
293 Content-Type: text/plain; charset="us-ascii"
293 Content-Transfer-Encoding: 7bit
294 Content-Transfer-Encoding: 7bit
294 Date:* (glob)
295 Date:* (glob)
295 Subject: changeset in...
296 Subject: changeset in...
296 From: User Name <user@example.com>
297 From: User Name <user@example.com>
297 X-Hg-Notification: changeset ef63ca68695b
298 X-Hg-Notification: changeset ef63ca68695b
298 Message-Id: <hg.ef63ca68695b*> (glob)
299 Message-Id: <hg.ef63ca68695b*> (glob)
299 To: Test
300 To: Test
300
301
301 changeset ef63ca68695b in $TESTTMP/Test
302 changeset ef63ca68695b in $TESTTMP/Test
302 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
303 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
303 description:
304 description:
304 absym
305 absym
305
306
306 diffs (12 lines):
307 diffs (12 lines):
307
308
308 diff -r a2392c293916 -r ef63ca68695b a
309 diff -r a2392c293916 -r ef63ca68695b a
309 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 +++ b/a Thu Jan 01 00:00:00 1970 +0000
311 +++ b/a Thu Jan 01 00:00:00 1970 +0000
311 @@ -0,0 +1,3 @@
312 @@ -0,0 +1,3 @@
312 +expand $Id$
313 +expand $Id$
313 +do not process $Id:
314 +do not process $Id:
314 +xxx $
315 +xxx $
315 diff -r a2392c293916 -r ef63ca68695b b
316 diff -r a2392c293916 -r ef63ca68695b b
316 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 +++ b/b Thu Jan 01 00:00:00 1970 +0000
318 +++ b/b Thu Jan 01 00:00:00 1970 +0000
318 @@ -0,0 +1,1 @@
319 @@ -0,0 +1,1 @@
319 +ignore $Id$
320 +ignore $Id$
320
321
321 $ cp $HGRCPATH.nohooks $HGRCPATH
322 $ cp $HGRCPATH.nohooks $HGRCPATH
322
323
323 Touch files and check with status
324 Touch files and check with status
324
325
325 $ touch a b
326 $ touch a b
326 $ hg status
327 $ hg status
327
328
328 Update and expand
329 Update and expand
329
330
330 $ rm sym a b
331 $ rm sym a b
331 $ hg update -C
332 $ hg update -C
332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 $ cat a b
334 $ cat a b
334 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
335 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
335 do not process $Id:
336 do not process $Id:
336 xxx $
337 xxx $
337 ignore $Id$
338 ignore $Id$
338
339
339 Check whether expansion is filewise and file mode is preserved
340 Check whether expansion is filewise and file mode is preserved
340
341
341 $ echo '$Id$' > c
342 $ echo '$Id$' > c
342 $ echo 'tests for different changenodes' >> c
343 $ echo 'tests for different changenodes' >> c
343 #if unix-permissions
344 #if unix-permissions
344 $ chmod 600 c
345 $ chmod 600 c
345 $ ls -l c | cut -b 1-10
346 $ ls -l c | cut -b 1-10
346 -rw-------
347 -rw-------
347 #endif
348 #endif
348
349
349 commit file c
350 commit file c
350
351
351 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
352 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
352 adding c
353 adding c
353 #if unix-permissions
354 #if unix-permissions
354 $ ls -l c | cut -b 1-10
355 $ ls -l c | cut -b 1-10
355 -rw-------
356 -rw-------
356 #endif
357 #endif
357
358
358 force expansion
359 force expansion
359
360
360 $ hg -v kwexpand
361 $ hg -v kwexpand
361 overwriting a expanding keywords
362 overwriting a expanding keywords
362 overwriting c expanding keywords
363 overwriting c expanding keywords
363
364
364 compare changenodes in a and c
365 compare changenodes in a and c
365
366
366 $ cat a c
367 $ cat a c
367 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
368 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
368 do not process $Id:
369 do not process $Id:
369 xxx $
370 xxx $
370 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
371 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
371 tests for different changenodes
372 tests for different changenodes
372
373
373 record
374 record
374
375
375 $ echo '$Id$' > r
376 $ echo '$Id$' > r
376 $ hg add r
377 $ hg add r
377
378
378 record chunk
379 record chunk
379
380
380 >>> lines = open('a', 'rb').readlines()
381 >>> lines = open('a', 'rb').readlines()
381 >>> lines.insert(1, b'foo\n')
382 >>> lines.insert(1, b'foo\n')
382 >>> lines.append(b'bar\n')
383 >>> lines.append(b'bar\n')
383 >>> open('a', 'wb').writelines(lines)
384 >>> open('a', 'wb').writelines(lines)
384 $ hg record -d '10 1' -m rectest a<<EOF
385 $ hg record -d '10 1' -m rectest a<<EOF
385 > y
386 > y
386 > n
387 > n
387 > EOF
388 > EOF
388 diff --git a/a b/a
389 diff --git a/a b/a
389 2 hunks, 2 lines changed
390 2 hunks, 2 lines changed
390 @@ -1,3 +1,4 @@
391 @@ -1,3 +1,4 @@
391 expand $Id$
392 expand $Id$
392 +foo
393 +foo
393 do not process $Id:
394 do not process $Id:
394 xxx $
395 xxx $
395 record change 1/2 to 'a'?
396 record change 1/2 to 'a'?
396 (enter ? for help) [Ynesfdaq?] y
397 (enter ? for help) [Ynesfdaq?] y
397
398
398 @@ -2,2 +3,3 @@
399 @@ -2,2 +3,3 @@
399 do not process $Id:
400 do not process $Id:
400 xxx $
401 xxx $
401 +bar
402 +bar
402 record change 2/2 to 'a'?
403 record change 2/2 to 'a'?
403 (enter ? for help) [Ynesfdaq?] n
404 (enter ? for help) [Ynesfdaq?] n
404
405
405
406
406 $ hg identify
407 $ hg identify
407 5f5eb23505c3+ tip
408 5f5eb23505c3+ tip
408 $ hg status
409 $ hg status
409 M a
410 M a
410 A r
411 A r
411
412
412 Cat modified file a
413 Cat modified file a
413
414
414 $ cat a
415 $ cat a
415 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
416 foo
417 foo
417 do not process $Id:
418 do not process $Id:
418 xxx $
419 xxx $
419 bar
420 bar
420
421
421 Diff remaining chunk
422 Diff remaining chunk
422
423
423 $ hg diff a
424 $ hg diff a
424 diff -r 5f5eb23505c3 a
425 diff -r 5f5eb23505c3 a
425 --- a/a Thu Jan 01 00:00:09 1970 -0000
426 --- a/a Thu Jan 01 00:00:09 1970 -0000
426 +++ b/a * (glob)
427 +++ b/a * (glob)
427 @@ -2,3 +2,4 @@
428 @@ -2,3 +2,4 @@
428 foo
429 foo
429 do not process $Id:
430 do not process $Id:
430 xxx $
431 xxx $
431 +bar
432 +bar
432
433
433 $ hg rollback
434 $ hg rollback
434 repository tip rolled back to revision 2 (undo commit)
435 repository tip rolled back to revision 2 (undo commit)
435 working directory now based on revision 2
436 working directory now based on revision 2
436
437
437 Record all chunks in file a
438 Record all chunks in file a
438
439
439 $ echo foo > msg
440 $ echo foo > msg
440
441
441 - do not use "hg record -m" here!
442 - do not use "hg record -m" here!
442
443
443 $ hg record -l msg -d '11 1' a<<EOF
444 $ hg record -l msg -d '11 1' a<<EOF
444 > y
445 > y
445 > y
446 > y
446 > y
447 > y
447 > EOF
448 > EOF
448 diff --git a/a b/a
449 diff --git a/a b/a
449 2 hunks, 2 lines changed
450 2 hunks, 2 lines changed
450 @@ -1,3 +1,4 @@
451 @@ -1,3 +1,4 @@
451 expand $Id$
452 expand $Id$
452 +foo
453 +foo
453 do not process $Id:
454 do not process $Id:
454 xxx $
455 xxx $
455 record change 1/2 to 'a'?
456 record change 1/2 to 'a'?
456 (enter ? for help) [Ynesfdaq?] y
457 (enter ? for help) [Ynesfdaq?] y
457
458
458 @@ -2,2 +3,3 @@
459 @@ -2,2 +3,3 @@
459 do not process $Id:
460 do not process $Id:
460 xxx $
461 xxx $
461 +bar
462 +bar
462 record change 2/2 to 'a'?
463 record change 2/2 to 'a'?
463 (enter ? for help) [Ynesfdaq?] y
464 (enter ? for help) [Ynesfdaq?] y
464
465
465
466
466 File a should be clean
467 File a should be clean
467
468
468 $ hg status -A a
469 $ hg status -A a
469 C a
470 C a
470
471
471 rollback and revert expansion
472 rollback and revert expansion
472
473
473 $ cat a
474 $ cat a
474 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
475 foo
476 foo
476 do not process $Id:
477 do not process $Id:
477 xxx $
478 xxx $
478 bar
479 bar
479 $ hg --verbose rollback
480 $ hg --verbose rollback
480 repository tip rolled back to revision 2 (undo commit)
481 repository tip rolled back to revision 2 (undo commit)
481 working directory now based on revision 2
482 working directory now based on revision 2
482 overwriting a expanding keywords
483 overwriting a expanding keywords
483 $ hg status a
484 $ hg status a
484 M a
485 M a
485 $ cat a
486 $ cat a
486 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
487 foo
488 foo
488 do not process $Id:
489 do not process $Id:
489 xxx $
490 xxx $
490 bar
491 bar
491 $ echo '$Id$' > y
492 $ echo '$Id$' > y
492 $ echo '$Id$' > z
493 $ echo '$Id$' > z
493 $ hg add y
494 $ hg add y
494 $ hg commit -Am "rollback only" z
495 $ hg commit -Am "rollback only" z
495 $ cat z
496 $ cat z
496 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
497 $ hg --verbose rollback
498 $ hg --verbose rollback
498 repository tip rolled back to revision 2 (undo commit)
499 repository tip rolled back to revision 2 (undo commit)
499 working directory now based on revision 2
500 working directory now based on revision 2
500 overwriting z shrinking keywords
501 overwriting z shrinking keywords
501
502
502 Only z should be overwritten
503 Only z should be overwritten
503
504
504 $ hg status a y z
505 $ hg status a y z
505 M a
506 M a
506 A y
507 A y
507 A z
508 A z
508 $ cat z
509 $ cat z
509 $Id$
510 $Id$
510 $ hg forget y z
511 $ hg forget y z
511 $ rm y z
512 $ rm y z
512
513
513 record added file alone
514 record added file alone
514
515
515 $ hg -v record -l msg -d '12 2' r<<EOF
516 $ hg -v record -l msg -d '12 2' r<<EOF
516 > y
517 > y
517 > y
518 > y
518 > EOF
519 > EOF
519 diff --git a/r b/r
520 diff --git a/r b/r
520 new file mode 100644
521 new file mode 100644
521 @@ -0,0 +1,1 @@
522 @@ -0,0 +1,1 @@
522 +$Id$
523 +$Id$
523 record this change to 'r'?
524 record this change to 'r'?
524 (enter ? for help) [Ynesfdaq?] y
525 (enter ? for help) [Ynesfdaq?] y
525
526
526 resolving manifests
527 resolving manifests
527 patching file r
528 patching file r
528 committing files:
529 committing files:
529 r
530 r
530 committing manifest
531 committing manifest
531 committing changelog
532 committing changelog
532 committed changeset 3:82a2f715724d
533 committed changeset 3:82a2f715724d
533 overwriting r expanding keywords
534 overwriting r expanding keywords
534 $ hg status r
535 $ hg status r
535 $ hg --verbose rollback
536 $ hg --verbose rollback
536 repository tip rolled back to revision 2 (undo commit)
537 repository tip rolled back to revision 2 (undo commit)
537 working directory now based on revision 2
538 working directory now based on revision 2
538 overwriting r shrinking keywords
539 overwriting r shrinking keywords
539 $ hg forget r
540 $ hg forget r
540 $ rm msg r
541 $ rm msg r
541 $ hg update -C
542 $ hg update -C
542 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543
544
544 record added keyword ignored file
545 record added keyword ignored file
545
546
546 $ echo '$Id$' > i
547 $ echo '$Id$' > i
547 $ hg add i
548 $ hg add i
548 $ hg --verbose record -d '13 1' -m recignored<<EOF
549 $ hg --verbose record -d '13 1' -m recignored<<EOF
549 > y
550 > y
550 > y
551 > y
551 > EOF
552 > EOF
552 diff --git a/i b/i
553 diff --git a/i b/i
553 new file mode 100644
554 new file mode 100644
554 examine changes to 'i'?
555 examine changes to 'i'?
555 (enter ? for help) [Ynesfdaq?] y
556 (enter ? for help) [Ynesfdaq?] y
556
557
557 @@ -0,0 +1,1 @@
558 @@ -0,0 +1,1 @@
558 +$Id$
559 +$Id$
559 record this change to 'i'?
560 record this change to 'i'?
560 (enter ? for help) [Ynesfdaq?] y
561 (enter ? for help) [Ynesfdaq?] y
561
562
562 resolving manifests
563 resolving manifests
563 patching file i
564 patching file i
564 committing files:
565 committing files:
565 i
566 i
566 committing manifest
567 committing manifest
567 committing changelog
568 committing changelog
568 committed changeset 3:9f40ceb5a072
569 committed changeset 3:9f40ceb5a072
569 $ cat i
570 $ cat i
570 $Id$
571 $Id$
571 $ hg -q rollback
572 $ hg -q rollback
572 $ hg forget i
573 $ hg forget i
573 $ rm i
574 $ rm i
574
575
575 amend
576 amend
576
577
577 $ echo amend >> a
578 $ echo amend >> a
578 $ echo amend >> b
579 $ echo amend >> b
579 $ hg -q commit -d '14 1' -m 'prepare amend'
580 $ hg -q commit -d '14 1' -m 'prepare amend'
580
581
581 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
582 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
582 overwriting a expanding keywords
583 overwriting a expanding keywords
583 $ hg -q id
584 $ hg -q id
584 67d8c481a6be
585 67d8c481a6be
585 $ head -1 a
586 $ head -1 a
586 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
587 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
587
588
588 $ hg -q strip --no-backup tip
589 $ hg -q strip --no-backup tip
589
590
590 Test patch queue repo
591 Test patch queue repo
591
592
592 $ hg init --mq
593 $ hg init --mq
593 $ hg qimport -r tip -n mqtest.diff
594 $ hg qimport -r tip -n mqtest.diff
594 $ hg commit --mq -m mqtest
595 $ hg commit --mq -m mqtest
595
596
596 Keywords should not be expanded in patch
597 Keywords should not be expanded in patch
597
598
598 $ cat .hg/patches/mqtest.diff
599 $ cat .hg/patches/mqtest.diff
599 # HG changeset patch
600 # HG changeset patch
600 # User User Name <user@example.com>
601 # User User Name <user@example.com>
601 # Date 1 0
602 # Date 1 0
602 # Thu Jan 01 00:00:01 1970 +0000
603 # Thu Jan 01 00:00:01 1970 +0000
603 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
604 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
604 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
605 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
605 cndiff
606 cndiff
606
607
607 diff -r ef63ca68695b -r 40a904bbbe4c c
608 diff -r ef63ca68695b -r 40a904bbbe4c c
608 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 +++ b/c Thu Jan 01 00:00:01 1970 +0000
610 +++ b/c Thu Jan 01 00:00:01 1970 +0000
610 @@ -0,0 +1,2 @@
611 @@ -0,0 +1,2 @@
611 +$Id$
612 +$Id$
612 +tests for different changenodes
613 +tests for different changenodes
613
614
614 $ hg qpop
615 $ hg qpop
615 popping mqtest.diff
616 popping mqtest.diff
616 patch queue now empty
617 patch queue now empty
617
618
618 qgoto, implying qpush, should expand
619 qgoto, implying qpush, should expand
619
620
620 $ hg qgoto mqtest.diff
621 $ hg qgoto mqtest.diff
621 applying mqtest.diff
622 applying mqtest.diff
622 now at: mqtest.diff
623 now at: mqtest.diff
623 $ cat c
624 $ cat c
624 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
625 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
625 tests for different changenodes
626 tests for different changenodes
626 $ hg cat c
627 $ hg cat c
627 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
628 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
628 tests for different changenodes
629 tests for different changenodes
629
630
630 Keywords should not be expanded in filelog
631 Keywords should not be expanded in filelog
631
632
632 $ hg --config 'extensions.keyword=!' cat c
633 $ hg --config 'extensions.keyword=!' cat c
633 $Id$
634 $Id$
634 tests for different changenodes
635 tests for different changenodes
635
636
636 qpop and move on
637 qpop and move on
637
638
638 $ hg qpop
639 $ hg qpop
639 popping mqtest.diff
640 popping mqtest.diff
640 patch queue now empty
641 patch queue now empty
641
642
642 Copy and show added kwfiles
643 Copy and show added kwfiles
643
644
644 $ hg cp a c
645 $ hg cp a c
645 $ hg kwfiles
646 $ hg kwfiles
646 a
647 a
647 c
648 c
648
649
649 Commit and show expansion in original and copy
650 Commit and show expansion in original and copy
650
651
651 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
652 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
652 committing files:
653 committing files:
653 c
654 c
654 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
655 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
655 committing manifest
656 committing manifest
656 committing changelog
657 committing changelog
657 overwriting c expanding keywords
658 overwriting c expanding keywords
658 updating the branch cache
659 updating the branch cache
659 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
660 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
660 $ cat a c
661 $ cat a c
661 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
662 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
662 do not process $Id:
663 do not process $Id:
663 xxx $
664 xxx $
664 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
665 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
665 do not process $Id:
666 do not process $Id:
666 xxx $
667 xxx $
667
668
668 Touch copied c and check its status
669 Touch copied c and check its status
669
670
670 $ touch c
671 $ touch c
671 $ hg status
672 $ hg status
672
673
673 Copy kwfile to keyword ignored file unexpanding keywords
674 Copy kwfile to keyword ignored file unexpanding keywords
674
675
675 $ hg --verbose copy a i
676 $ hg --verbose copy a i
676 copying a to i
677 copying a to i
677 overwriting i shrinking keywords
678 overwriting i shrinking keywords
678 $ head -n 1 i
679 $ head -n 1 i
679 expand $Id$
680 expand $Id$
680 $ hg forget i
681 $ hg forget i
681 $ rm i
682 $ rm i
682
683
683 Copy ignored file to ignored file: no overwriting
684 Copy ignored file to ignored file: no overwriting
684
685
685 $ hg --verbose copy b i
686 $ hg --verbose copy b i
686 copying b to i
687 copying b to i
687 $ hg forget i
688 $ hg forget i
688 $ rm i
689 $ rm i
689
690
690 cp symlink file; hg cp -A symlink file (part1)
691 cp symlink file; hg cp -A symlink file (part1)
691 - copied symlink points to kwfile: overwrite
692 - copied symlink points to kwfile: overwrite
692
693
693 #if symlink
694 #if symlink
694 $ cp sym i
695 $ cp sym i
695 $ ls -l i
696 $ ls -l i
696 -rw-r--r--* (glob)
697 -rw-r--r--* (glob)
697 $ head -1 i
698 $ head -1 i
698 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
699 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
699 $ hg copy --after --verbose sym i
700 $ hg copy --after --verbose sym i
700 copying sym to i
701 copying sym to i
701 overwriting i shrinking keywords
702 overwriting i shrinking keywords
702 $ head -1 i
703 $ head -1 i
703 expand $Id$
704 expand $Id$
704 $ hg forget i
705 $ hg forget i
705 $ rm i
706 $ rm i
706 #endif
707 #endif
707
708
708 Test different options of hg kwfiles
709 Test different options of hg kwfiles
709
710
710 $ hg kwfiles
711 $ hg kwfiles
711 a
712 a
712 c
713 c
713 $ hg -v kwfiles --ignore
714 $ hg -v kwfiles --ignore
714 I b
715 I b
715 I sym
716 I sym
716 $ hg kwfiles --all
717 $ hg kwfiles --all
717 K a
718 K a
718 K c
719 K c
719 I b
720 I b
720 I sym
721 I sym
721
722
722 Diff specific revision
723 Diff specific revision
723
724
724 $ hg diff --rev 1
725 $ hg diff --rev 1
725 diff -r ef63ca68695b c
726 diff -r ef63ca68695b c
726 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
727 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
727 +++ b/c * (glob)
728 +++ b/c * (glob)
728 @@ -0,0 +1,3 @@
729 @@ -0,0 +1,3 @@
729 +expand $Id$
730 +expand $Id$
730 +do not process $Id:
731 +do not process $Id:
731 +xxx $
732 +xxx $
732
733
733 Status after rollback:
734 Status after rollback:
734
735
735 $ hg rollback
736 $ hg rollback
736 repository tip rolled back to revision 1 (undo commit)
737 repository tip rolled back to revision 1 (undo commit)
737 working directory now based on revision 1
738 working directory now based on revision 1
738 $ hg status
739 $ hg status
739 A c
740 A c
740 $ hg update --clean
741 $ hg update --clean
741 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
742
743
743 #if symlink
744 #if symlink
744
745
745 cp symlink file; hg cp -A symlink file (part2)
746 cp symlink file; hg cp -A symlink file (part2)
746 - copied symlink points to kw ignored file: do not overwrite
747 - copied symlink points to kw ignored file: do not overwrite
747
748
748 $ cat a > i
749 $ cat a > i
749 $ ln -s i symignored
750 $ ln -s i symignored
750 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
751 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
751 $ cp symignored x
752 $ cp symignored x
752 $ hg copy --after --verbose symignored x
753 $ hg copy --after --verbose symignored x
753 copying symignored to x
754 copying symignored to x
754 $ head -n 1 x
755 $ head -n 1 x
755 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
756 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
756 $ hg forget x
757 $ hg forget x
757 $ rm x
758 $ rm x
758
759
759 $ hg rollback
760 $ hg rollback
760 repository tip rolled back to revision 1 (undo commit)
761 repository tip rolled back to revision 1 (undo commit)
761 working directory now based on revision 1
762 working directory now based on revision 1
762 $ hg update --clean
763 $ hg update --clean
763 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 $ rm i symignored
765 $ rm i symignored
765
766
766 #endif
767 #endif
767
768
768 Custom keywordmaps as argument to kwdemo
769 Custom keywordmaps as argument to kwdemo
769
770
770 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
771 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
771 [extensions]
772 [extensions]
772 keyword =
773 keyword =
773 [keyword]
774 [keyword]
774 ** =
775 ** =
775 b = ignore
776 b = ignore
776 demo.txt =
777 demo.txt =
777 i = ignore
778 i = ignore
778 [keywordset]
779 [keywordset]
779 svn = False
780 svn = False
780 [keywordmaps]
781 [keywordmaps]
781 Xinfo = {author}: {desc}
782 Xinfo = {author}: {desc}
782 $Xinfo: test: hg keyword configuration and expansion example $
783 $Xinfo: test: hg keyword configuration and expansion example $
783
784
784 Configure custom keywordmaps
785 Configure custom keywordmaps
785
786
786 $ cat <<EOF >>$HGRCPATH
787 $ cat <<EOF >>$HGRCPATH
787 > [keywordmaps]
788 > [keywordmaps]
788 > Id = {file} {node|short} {date|rfc822date} {author|user}
789 > Id = {file} {node|short} {date|rfc822date} {author|user}
789 > Xinfo = {author}: {desc}
790 > Xinfo = {author}: {desc}
790 > EOF
791 > EOF
791
792
792 Cat and hg cat files before custom expansion
793 Cat and hg cat files before custom expansion
793
794
794 $ cat a b
795 $ cat a b
795 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
796 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
796 do not process $Id:
797 do not process $Id:
797 xxx $
798 xxx $
798 ignore $Id$
799 ignore $Id$
799 $ hg cat sym a b && echo
800 $ hg cat sym a b && echo
800 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
801 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
801 do not process $Id:
802 do not process $Id:
802 xxx $
803 xxx $
803 ignore $Id$
804 ignore $Id$
804 a
805 a
805
806
806 Write custom keyword and prepare multi-line commit message
807 Write custom keyword and prepare multi-line commit message
807
808
808 $ echo '$Xinfo$' >> a
809 $ echo '$Xinfo$' >> a
809 $ cat <<EOF >> log
810 $ cat <<EOF >> log
810 > firstline
811 > firstline
811 > secondline
812 > secondline
812 > EOF
813 > EOF
813
814
814 Interrupted commit should not change state
815 Interrupted commit should not change state
815
816
816 $ hg commit
817 $ hg commit
817 abort: empty commit message
818 abort: empty commit message
818 [255]
819 [255]
819 $ hg status
820 $ hg status
820 M a
821 M a
821 ? c
822 ? c
822 ? log
823 ? log
823
824
824 Commit with multi-line message and custom expansion
825 Commit with multi-line message and custom expansion
825
826
826 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
827 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
827 committing files:
828 committing files:
828 a
829 a
829 committing manifest
830 committing manifest
830 committing changelog
831 committing changelog
831 overwriting a expanding keywords
832 overwriting a expanding keywords
832 updating the branch cache
833 updating the branch cache
833 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
834 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
834 $ rm log
835 $ rm log
835
836
836 Stat, verify and show custom expansion (firstline)
837 Stat, verify and show custom expansion (firstline)
837
838
838 $ hg status
839 $ hg status
839 ? c
840 ? c
840 $ hg verify
841 $ hg verify
841 checking changesets
842 checking changesets
842 checking manifests
843 checking manifests
843 crosschecking files in changesets and manifests
844 crosschecking files in changesets and manifests
844 checking files
845 checking files
845 checked 3 changesets with 4 changes to 3 files
846 checked 3 changesets with 4 changes to 3 files
846 $ cat a b
847 $ cat a b
847 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
848 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
848 do not process $Id:
849 do not process $Id:
849 xxx $
850 xxx $
850 $Xinfo: User Name <user@example.com>: firstline $
851 $Xinfo: User Name <user@example.com>: firstline $
851 ignore $Id$
852 ignore $Id$
852 $ hg cat sym a b && echo
853 $ hg cat sym a b && echo
853 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
854 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
854 do not process $Id:
855 do not process $Id:
855 xxx $
856 xxx $
856 $Xinfo: User Name <user@example.com>: firstline $
857 $Xinfo: User Name <user@example.com>: firstline $
857 ignore $Id$
858 ignore $Id$
858 a
859 a
859
860
860 annotate
861 annotate
861
862
862 $ hg annotate a
863 $ hg annotate a
863 1: expand $Id$
864 1: expand $Id$
864 1: do not process $Id:
865 1: do not process $Id:
865 1: xxx $
866 1: xxx $
866 2: $Xinfo$
867 2: $Xinfo$
867
868
868 remove with status checks
869 remove with status checks
869
870
870 $ hg debugrebuildstate
871 $ hg debugrebuildstate
871 $ hg remove a
872 $ hg remove a
872 $ hg --debug commit -m rma
873 $ hg --debug commit -m rma
873 committing files:
874 committing files:
874 committing manifest
875 committing manifest
875 committing changelog
876 committing changelog
876 updating the branch cache
877 updating the branch cache
877 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
878 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
878 $ hg status
879 $ hg status
879 ? c
880 ? c
880
881
881 Rollback, revert, and check expansion
882 Rollback, revert, and check expansion
882
883
883 $ hg rollback
884 $ hg rollback
884 repository tip rolled back to revision 2 (undo commit)
885 repository tip rolled back to revision 2 (undo commit)
885 working directory now based on revision 2
886 working directory now based on revision 2
886 $ hg status
887 $ hg status
887 R a
888 R a
888 ? c
889 ? c
889 $ hg revert --no-backup --rev tip a
890 $ hg revert --no-backup --rev tip a
890 $ cat a
891 $ cat a
891 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
892 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
892 do not process $Id:
893 do not process $Id:
893 xxx $
894 xxx $
894 $Xinfo: User Name <user@example.com>: firstline $
895 $Xinfo: User Name <user@example.com>: firstline $
895
896
896 Clone to test global and local configurations
897 Clone to test global and local configurations
897
898
898 $ cd ..
899 $ cd ..
899
900
900 Expansion in destination with global configuration
901 Expansion in destination with global configuration
901
902
902 $ hg --quiet clone Test globalconf
903 $ hg --quiet clone Test globalconf
903 $ cat globalconf/a
904 $ cat globalconf/a
904 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
905 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
905 do not process $Id:
906 do not process $Id:
906 xxx $
907 xxx $
907 $Xinfo: User Name <user@example.com>: firstline $
908 $Xinfo: User Name <user@example.com>: firstline $
908
909
909 No expansion in destination with local configuration in origin only
910 No expansion in destination with local configuration in origin only
910
911
911 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
912 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
912 $ cat localconf/a
913 $ cat localconf/a
913 expand $Id$
914 expand $Id$
914 do not process $Id:
915 do not process $Id:
915 xxx $
916 xxx $
916 $Xinfo$
917 $Xinfo$
917
918
918 Clone to test incoming
919 Clone to test incoming
919
920
920 $ hg clone -r1 Test Test-a
921 $ hg clone -r1 Test Test-a
921 adding changesets
922 adding changesets
922 adding manifests
923 adding manifests
923 adding file changes
924 adding file changes
924 added 2 changesets with 3 changes to 3 files
925 added 2 changesets with 3 changes to 3 files
925 new changesets a2392c293916:ef63ca68695b
926 new changesets a2392c293916:ef63ca68695b
926 updating to branch default
927 updating to branch default
927 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 $ cd Test-a
929 $ cd Test-a
929 $ cat <<EOF >> .hg/hgrc
930 $ cat <<EOF >> .hg/hgrc
930 > [paths]
931 > [paths]
931 > default = ../Test
932 > default = ../Test
932 > EOF
933 > EOF
933 $ hg incoming
934 $ hg incoming
934 comparing with $TESTTMP/Test
935 comparing with $TESTTMP/Test
935 searching for changes
936 searching for changes
936 changeset: 2:bb948857c743
937 changeset: 2:bb948857c743
937 tag: tip
938 tag: tip
938 user: User Name <user@example.com>
939 user: User Name <user@example.com>
939 date: Thu Jan 01 00:00:02 1970 +0000
940 date: Thu Jan 01 00:00:02 1970 +0000
940 summary: firstline
941 summary: firstline
941
942
942 Imported patch should not be rejected
943 Imported patch should not be rejected
943
944
944 >>> import re
945 >>> import re
945 >>> text = re.sub(br'(Id.*)', br'\1 rejecttest', open('a', 'rb').read())
946 >>> text = re.sub(br'(Id.*)', br'\1 rejecttest', open('a', 'rb').read())
946 >>> open('a', 'wb').write(text) and None
947 >>> open('a', 'wb').write(text) and None
947 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
948 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
948 committing files:
949 committing files:
949 a
950 a
950 committing manifest
951 committing manifest
951 committing changelog
952 committing changelog
952 overwriting a expanding keywords
953 overwriting a expanding keywords
953 updating the branch cache
954 updating the branch cache
954 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
955 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
955 $ hg export -o ../rejecttest.diff tip
956 $ hg export -o ../rejecttest.diff tip
956 $ cd ../Test
957 $ cd ../Test
957 $ hg import ../rejecttest.diff
958 $ hg import ../rejecttest.diff
958 applying ../rejecttest.diff
959 applying ../rejecttest.diff
959 $ cat a b
960 $ cat a b
960 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
961 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
961 do not process $Id: rejecttest
962 do not process $Id: rejecttest
962 xxx $
963 xxx $
963 $Xinfo: User Name <user@example.com>: rejects? $
964 $Xinfo: User Name <user@example.com>: rejects? $
964 ignore $Id$
965 ignore $Id$
965
966
966 $ hg rollback
967 $ hg rollback
967 repository tip rolled back to revision 2 (undo import)
968 repository tip rolled back to revision 2 (undo import)
968 working directory now based on revision 2
969 working directory now based on revision 2
969 $ hg update --clean
970 $ hg update --clean
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971
972
972 kwexpand/kwshrink on selected files
973 kwexpand/kwshrink on selected files
973
974
974 $ mkdir x
975 $ mkdir x
975 $ hg copy a x/a
976 $ hg copy a x/a
976 $ hg --verbose kwshrink a
977 $ hg --verbose kwshrink a
977 overwriting a shrinking keywords
978 overwriting a shrinking keywords
978 - sleep required for dirstate.normal() check
979 - sleep required for dirstate.normal() check
979 $ sleep 1
980 $ sleep 1
980 $ hg status a
981 $ hg status a
981 $ hg --verbose kwexpand a
982 $ hg --verbose kwexpand a
982 overwriting a expanding keywords
983 overwriting a expanding keywords
983 $ hg status a
984 $ hg status a
984
985
985 kwexpand x/a should abort
986 kwexpand x/a should abort
986
987
987 $ hg --verbose kwexpand x/a
988 $ hg --verbose kwexpand x/a
988 abort: outstanding uncommitted changes
989 abort: outstanding uncommitted changes
989 [255]
990 [255]
990 $ cd x
991 $ cd x
991 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
992 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
992 committing files:
993 committing files:
993 x/a
994 x/a
994 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
995 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
995 committing manifest
996 committing manifest
996 committing changelog
997 committing changelog
997 overwriting x/a expanding keywords
998 overwriting x/a expanding keywords
998 updating the branch cache
999 updating the branch cache
999 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
1000 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
1000 $ cat a
1001 $ cat a
1001 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1002 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1002 do not process $Id:
1003 do not process $Id:
1003 xxx $
1004 xxx $
1004 $Xinfo: User Name <user@example.com>: xa $
1005 $Xinfo: User Name <user@example.com>: xa $
1005
1006
1006 kwshrink a inside directory x
1007 kwshrink a inside directory x
1007
1008
1008 $ hg --verbose kwshrink a
1009 $ hg --verbose kwshrink a
1009 overwriting x/a shrinking keywords
1010 overwriting x/a shrinking keywords
1010 $ cat a
1011 $ cat a
1011 expand $Id$
1012 expand $Id$
1012 do not process $Id:
1013 do not process $Id:
1013 xxx $
1014 xxx $
1014 $Xinfo$
1015 $Xinfo$
1015 $ cd ..
1016 $ cd ..
1016
1017
1017 kwexpand nonexistent
1018 kwexpand nonexistent
1018
1019
1019 $ hg kwexpand nonexistent
1020 $ hg kwexpand nonexistent
1020 nonexistent:* (glob)
1021 nonexistent:* (glob)
1021
1022
1022
1023
1023 #if serve
1024 #if serve
1024 hg serve
1025 hg serve
1025 - expand with hgweb file
1026 - expand with hgweb file
1026 - no expansion with hgweb annotate/changeset/filediff/comparison
1027 - no expansion with hgweb annotate/changeset/filediff/comparison
1027 - expand with hgweb file, again
1028 - expand with hgweb file, again
1028 - check errors
1029 - check errors
1029
1030
1030 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1031 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1031 $ cat hg.pid >> $DAEMON_PIDS
1032 $ cat hg.pid >> $DAEMON_PIDS
1032 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1033 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1033 200 Script output follows
1034 200 Script output follows
1034
1035
1035 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1036 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1036 do not process $Id:
1037 do not process $Id:
1037 xxx $
1038 xxx $
1038 $Xinfo: User Name <user@example.com>: firstline $
1039 $Xinfo: User Name <user@example.com>: firstline $
1039 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1040 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1040 200 Script output follows
1041 200 Script output follows
1041
1042
1042
1043
1043 user@1: expand $Id$
1044 user@1: expand $Id$
1044 user@1: do not process $Id:
1045 user@1: do not process $Id:
1045 user@1: xxx $
1046 user@1: xxx $
1046 user@2: $Xinfo$
1047 user@2: $Xinfo$
1047
1048
1048
1049
1049
1050
1050
1051
1051 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1052 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1052 200 Script output follows
1053 200 Script output follows
1053
1054
1054
1055
1055 # HG changeset patch
1056 # HG changeset patch
1056 # User User Name <user@example.com>
1057 # User User Name <user@example.com>
1057 # Date 3 0
1058 # Date 3 0
1058 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1059 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1059 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1060 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1060 xa
1061 xa
1061
1062
1062 diff -r bb948857c743 -r b4560182a3f9 x/a
1063 diff -r bb948857c743 -r b4560182a3f9 x/a
1063 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1064 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1064 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1065 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1065 @@ -0,0 +1,4 @@
1066 @@ -0,0 +1,4 @@
1066 +expand $Id$
1067 +expand $Id$
1067 +do not process $Id:
1068 +do not process $Id:
1068 +xxx $
1069 +xxx $
1069 +$Xinfo$
1070 +$Xinfo$
1070
1071
1071 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1072 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1072 200 Script output follows
1073 200 Script output follows
1073
1074
1074
1075
1075 diff -r ef63ca68695b -r bb948857c743 a
1076 diff -r ef63ca68695b -r bb948857c743 a
1076 --- a/a Thu Jan 01 00:00:00 1970 +0000
1077 --- a/a Thu Jan 01 00:00:00 1970 +0000
1077 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1078 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1078 @@ -1,3 +1,4 @@
1079 @@ -1,3 +1,4 @@
1079 expand $Id$
1080 expand $Id$
1080 do not process $Id:
1081 do not process $Id:
1081 xxx $
1082 xxx $
1082 +$Xinfo$
1083 +$Xinfo$
1083
1084
1084
1085
1085
1086
1086
1087
1087 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1088 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1088 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1090 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1090 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1092 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1092 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1093 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1093
1094
1094 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1095 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1095 at subsequent webcommands)
1096 at subsequent webcommands)
1096
1097
1097 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1098 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1098 200 Script output follows
1099 200 Script output follows
1099
1100
1100 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1101 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1101 do not process $Id:
1102 do not process $Id:
1102 xxx $
1103 xxx $
1103 $Xinfo: User Name <user@example.com>: firstline $
1104 $Xinfo: User Name <user@example.com>: firstline $
1104
1105
1105 $ killdaemons.py
1106 $ killdaemons.py
1106 $ cat errors.log
1107 $ cat errors.log
1107 #endif
1108 #endif
1108
1109
1109 Prepare merge and resolve tests
1110 Prepare merge and resolve tests
1110
1111
1111 $ echo '$Id$' > m
1112 $ echo '$Id$' > m
1112 $ hg add m
1113 $ hg add m
1113 $ hg commit -m 4kw
1114 $ hg commit -m 4kw
1114 $ echo foo >> m
1115 $ echo foo >> m
1115 $ hg commit -m 5foo
1116 $ hg commit -m 5foo
1116
1117
1117 simplemerge
1118 simplemerge
1118
1119
1119 $ hg update 4
1120 $ hg update 4
1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 $ echo foo >> m
1122 $ echo foo >> m
1122 $ hg commit -m 6foo
1123 $ hg commit -m 6foo
1123 created new head
1124 created new head
1124 $ hg merge
1125 $ hg merge
1125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1126 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1126 (branch merge, don't forget to commit)
1127 (branch merge, don't forget to commit)
1127 $ hg commit -m simplemerge
1128 $ hg commit -m simplemerge
1128 $ cat m
1129 $ cat m
1129 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1130 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1130 foo
1131 foo
1131
1132
1132 conflict: keyword should stay outside conflict zone
1133 conflict: keyword should stay outside conflict zone
1133
1134
1134 $ hg update 4
1135 $ hg update 4
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 $ echo bar >> m
1137 $ echo bar >> m
1137 $ hg commit -m 8bar
1138 $ hg commit -m 8bar
1138 created new head
1139 created new head
1139 $ hg merge
1140 $ hg merge
1140 merging m
1141 merging m
1141 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1142 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1142 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1143 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1144 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1144 [1]
1145 [1]
1145 $ cat m
1146 $ cat m
1146 $Id$
1147 $Id$
1147 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1148 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1148 bar
1149 bar
1149 =======
1150 =======
1150 foo
1151 foo
1151 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1152 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1152
1153
1153 resolve to local, m must contain hash of last change (local parent)
1154 resolve to local, m must contain hash of last change (local parent)
1154
1155
1155 $ hg resolve -t internal:local -a
1156 $ hg resolve -t internal:local -a
1156 (no more unresolved files)
1157 (no more unresolved files)
1157 $ hg commit -m localresolve
1158 $ hg commit -m localresolve
1158 $ cat m
1159 $ cat m
1159 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1160 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1160 bar
1161 bar
1161
1162
1162 Test restricted mode with transplant -b
1163 Test restricted mode with transplant -b
1163
1164
1164 $ hg update 6
1165 $ hg update 6
1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166 $ hg branch foo
1167 $ hg branch foo
1167 marked working directory as branch foo
1168 marked working directory as branch foo
1168 (branches are permanent and global, did you want a bookmark?)
1169 (branches are permanent and global, did you want a bookmark?)
1169 $ mv a a.bak
1170 $ mv a a.bak
1170 $ echo foobranch > a
1171 $ echo foobranch > a
1171 $ cat a.bak >> a
1172 $ cat a.bak >> a
1172 $ rm a.bak
1173 $ rm a.bak
1173 $ hg commit -m 9foobranch
1174 $ hg commit -m 9foobranch
1174 $ hg update default
1175 $ hg update default
1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 $ hg -y transplant -b foo tip
1177 $ hg -y transplant -b foo tip
1177 applying 4aa30d025d50
1178 applying 4aa30d025d50
1178 4aa30d025d50 transplanted to e00abbf63521
1179 4aa30d025d50 transplanted to e00abbf63521
1179
1180
1180 Expansion in changeset but not in file
1181 Expansion in changeset but not in file
1181
1182
1182 $ hg tip -p
1183 $ hg tip -p
1183 changeset: 11:e00abbf63521
1184 changeset: 11:e00abbf63521
1184 tag: tip
1185 tag: tip
1185 parent: 9:800511b3a22d
1186 parent: 9:800511b3a22d
1186 user: test
1187 user: test
1187 date: Thu Jan 01 00:00:00 1970 +0000
1188 date: Thu Jan 01 00:00:00 1970 +0000
1188 summary: 9foobranch
1189 summary: 9foobranch
1189
1190
1190 diff -r 800511b3a22d -r e00abbf63521 a
1191 diff -r 800511b3a22d -r e00abbf63521 a
1191 --- a/a Thu Jan 01 00:00:00 1970 +0000
1192 --- a/a Thu Jan 01 00:00:00 1970 +0000
1192 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1193 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1193 @@ -1,3 +1,4 @@
1194 @@ -1,3 +1,4 @@
1194 +foobranch
1195 +foobranch
1195 expand $Id$
1196 expand $Id$
1196 do not process $Id:
1197 do not process $Id:
1197 xxx $
1198 xxx $
1198
1199
1199 $ head -n 2 a
1200 $ head -n 2 a
1200 foobranch
1201 foobranch
1201 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1202 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1202
1203
1203 Turn off expansion
1204 Turn off expansion
1204
1205
1205 $ hg -q rollback
1206 $ hg -q rollback
1206 $ hg -q update -C
1207 $ hg -q update -C
1207
1208
1208 kwshrink with unknown file u
1209 kwshrink with unknown file u
1209
1210
1210 $ cp a u
1211 $ cp a u
1211 $ hg --verbose kwshrink
1212 $ hg --verbose kwshrink
1212 overwriting a shrinking keywords
1213 overwriting a shrinking keywords
1213 overwriting m shrinking keywords
1214 overwriting m shrinking keywords
1214 overwriting x/a shrinking keywords
1215 overwriting x/a shrinking keywords
1215
1216
1216 Keywords shrunk in working directory, but not yet disabled
1217 Keywords shrunk in working directory, but not yet disabled
1217 - cat shows unexpanded keywords
1218 - cat shows unexpanded keywords
1218 - hg cat shows expanded keywords
1219 - hg cat shows expanded keywords
1219
1220
1220 $ cat a b
1221 $ cat a b
1221 expand $Id$
1222 expand $Id$
1222 do not process $Id:
1223 do not process $Id:
1223 xxx $
1224 xxx $
1224 $Xinfo$
1225 $Xinfo$
1225 ignore $Id$
1226 ignore $Id$
1226 $ hg cat sym a b && echo
1227 $ hg cat sym a b && echo
1227 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1228 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1228 do not process $Id:
1229 do not process $Id:
1229 xxx $
1230 xxx $
1230 $Xinfo: User Name <user@example.com>: firstline $
1231 $Xinfo: User Name <user@example.com>: firstline $
1231 ignore $Id$
1232 ignore $Id$
1232 a
1233 a
1233
1234
1234 Now disable keyword expansion
1235 Now disable keyword expansion
1235
1236
1236 $ cp $HGRCPATH $HGRCPATH.backup
1237 $ cp $HGRCPATH $HGRCPATH.backup
1237 $ rm "$HGRCPATH"
1238 $ rm "$HGRCPATH"
1238 $ cat a b
1239 $ cat a b
1239 expand $Id$
1240 expand $Id$
1240 do not process $Id:
1241 do not process $Id:
1241 xxx $
1242 xxx $
1242 $Xinfo$
1243 $Xinfo$
1243 ignore $Id$
1244 ignore $Id$
1244 $ hg cat sym a b && echo
1245 $ hg cat sym a b && echo
1245 expand $Id$
1246 expand $Id$
1246 do not process $Id:
1247 do not process $Id:
1247 xxx $
1248 xxx $
1248 $Xinfo$
1249 $Xinfo$
1249 ignore $Id$
1250 ignore $Id$
1250 a
1251 a
1251
1252
1252 enable keyword expansion again
1253 enable keyword expansion again
1253
1254
1254 $ cat $HGRCPATH.backup >> $HGRCPATH
1255 $ cat $HGRCPATH.backup >> $HGRCPATH
1255
1256
1256 Test restricted mode with unshelve
1257 Test restricted mode with unshelve
1257
1258
1258 $ echo xxxx >> a
1259 $ echo xxxx >> a
1259 $ hg diff
1260 $ hg diff
1260 diff -r 800511b3a22d a
1261 diff -r 800511b3a22d a
1261 --- a/a Thu Jan 01 00:00:00 1970 +0000
1262 --- a/a Thu Jan 01 00:00:00 1970 +0000
1262 +++ b/a * (glob)
1263 +++ b/a * (glob)
1263 @@ -2,3 +2,4 @@
1264 @@ -2,3 +2,4 @@
1264 do not process $Id:
1265 do not process $Id:
1265 xxx $
1266 xxx $
1266 $Xinfo$
1267 $Xinfo$
1267 +xxxx
1268 +xxxx
1268 $ hg shelve -q --name tmp
1269 $ hg shelve -q --name tmp
1269 $ hg shelve --list --patch
1270 $ hg shelve --list --patch
1270 tmp (*)* changes to: localresolve (glob)
1271 tmp (*)* changes to: localresolve (glob)
1271
1272
1272 diff --git a/a b/a
1273 diff --git a/a b/a
1273 --- a/a
1274 --- a/a
1274 +++ b/a
1275 +++ b/a
1275 @@ -2,3 +2,4 @@
1276 @@ -2,3 +2,4 @@
1276 do not process $Id:
1277 do not process $Id:
1277 xxx $
1278 xxx $
1278 $Xinfo$
1279 $Xinfo$
1279 +xxxx
1280 +xxxx
1280
1281
1281 $ hg update -q -C 10
1282 $ hg update -q -C 10
1282 $ hg unshelve -q tmp
1283 $ hg unshelve -q tmp
1283 $ hg diff
1284 $ hg diff
1284 diff -r 4aa30d025d50 a
1285 diff -r 4aa30d025d50 a
1285 --- a/a Thu Jan 01 00:00:00 1970 +0000
1286 --- a/a Thu Jan 01 00:00:00 1970 +0000
1286 +++ b/a * (glob)
1287 +++ b/a * (glob)
1287 @@ -3,3 +3,4 @@
1288 @@ -3,3 +3,4 @@
1288 do not process $Id:
1289 do not process $Id:
1289 xxx $
1290 xxx $
1290 $Xinfo$
1291 $Xinfo$
1291 +xxxx
1292 +xxxx
1292
1293
1293 Test restricted mode with rebase
1294 Test restricted mode with rebase
1294
1295
1295 $ cat <<EOF >> $HGRCPATH
1296 $ cat <<EOF >> $HGRCPATH
1296 > [extensions]
1297 > [extensions]
1297 > rebase =
1298 > rebase =
1298 > EOF
1299 > EOF
1299
1300
1300 $ hg update -q -C 9
1301 $ hg update -q -C 9
1301
1302
1302 $ echo xxxx >> a
1303 $ echo xxxx >> a
1303 $ hg commit -m '#11'
1304 $ hg commit -m '#11'
1304 $ hg diff -c 11
1305 $ hg diff -c 11
1305 diff -r 800511b3a22d -r b07670694489 a
1306 diff -r 800511b3a22d -r b07670694489 a
1306 --- a/a Thu Jan 01 00:00:00 1970 +0000
1307 --- a/a Thu Jan 01 00:00:00 1970 +0000
1307 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1308 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1308 @@ -2,3 +2,4 @@
1309 @@ -2,3 +2,4 @@
1309 do not process $Id:
1310 do not process $Id:
1310 xxx $
1311 xxx $
1311 $Xinfo$
1312 $Xinfo$
1312 +xxxx
1313 +xxxx
1313
1314
1314 $ hg diff -c 10
1315 $ hg diff -c 10
1315 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1316 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1316 --- a/a Thu Jan 01 00:00:00 1970 +0000
1317 --- a/a Thu Jan 01 00:00:00 1970 +0000
1317 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1318 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1318 @@ -1,3 +1,4 @@
1319 @@ -1,3 +1,4 @@
1319 +foobranch
1320 +foobranch
1320 expand $Id$
1321 expand $Id$
1321 do not process $Id:
1322 do not process $Id:
1322 xxx $
1323 xxx $
1323
1324
1324 $ hg rebase -q -s 10 -d 11 --keep
1325 $ hg rebase -q -s 10 -d 11 --keep
1325 $ hg diff -r 9 -r 12 a
1326 $ hg diff -r 9 -r 12 a
1326 diff -r 800511b3a22d -r 1939b927726c a
1327 diff -r 800511b3a22d -r 1939b927726c a
1327 --- a/a Thu Jan 01 00:00:00 1970 +0000
1328 --- a/a Thu Jan 01 00:00:00 1970 +0000
1328 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1329 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1329 @@ -1,4 +1,6 @@
1330 @@ -1,4 +1,6 @@
1330 +foobranch
1331 +foobranch
1331 expand $Id$
1332 expand $Id$
1332 do not process $Id:
1333 do not process $Id:
1333 xxx $
1334 xxx $
1334 $Xinfo$
1335 $Xinfo$
1335 +xxxx
1336 +xxxx
1336
1337
1337 Test restricted mode with graft
1338 Test restricted mode with graft
1338
1339
1339 $ hg graft -q 10
1340 $ hg graft -q 10
1340 $ hg diff -r 9 -r 13 a
1341 $ hg diff -r 9 -r 13 a
1341 diff -r 800511b3a22d -r 01a68de1003a a
1342 diff -r 800511b3a22d -r 01a68de1003a a
1342 --- a/a Thu Jan 01 00:00:00 1970 +0000
1343 --- a/a Thu Jan 01 00:00:00 1970 +0000
1343 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1344 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1344 @@ -1,4 +1,6 @@
1345 @@ -1,4 +1,6 @@
1345 +foobranch
1346 +foobranch
1346 expand $Id$
1347 expand $Id$
1347 do not process $Id:
1348 do not process $Id:
1348 xxx $
1349 xxx $
1349 $Xinfo$
1350 $Xinfo$
1350 +xxxx
1351 +xxxx
1351
1352
1352 Test restricted mode with backout
1353 Test restricted mode with backout
1353
1354
1354 $ hg backout -q 11 --no-commit
1355 $ hg backout -q 11 --no-commit
1355 $ hg diff a
1356 $ hg diff a
1356 diff -r 01a68de1003a a
1357 diff -r 01a68de1003a a
1357 --- a/a Thu Jan 01 00:00:00 1970 +0000
1358 --- a/a Thu Jan 01 00:00:00 1970 +0000
1358 +++ b/a * (glob)
1359 +++ b/a * (glob)
1359 @@ -3,4 +3,3 @@
1360 @@ -3,4 +3,3 @@
1360 do not process $Id:
1361 do not process $Id:
1361 xxx $
1362 xxx $
1362 $Xinfo$
1363 $Xinfo$
1363 -xxxx
1364 -xxxx
1364
1365
1365 Test restricted mode with histedit
1366 Test restricted mode with histedit
1366
1367
1367 $ cat <<EOF >> $HGRCPATH
1368 $ cat <<EOF >> $HGRCPATH
1368 > [extensions]
1369 > [extensions]
1369 > histedit =
1370 > histedit =
1370 > EOF
1371 > EOF
1371
1372
1372 $ hg commit -m 'backout #11'
1373 $ hg commit -m 'backout #11'
1373 $ hg histedit -q --command - 13 <<EOF
1374 $ hg histedit -q --command - 13 <<EOF
1374 > pick 49f5f2d940c3 14 backout #11
1375 > pick 49f5f2d940c3 14 backout #11
1375 > pick 01a68de1003a 13 9foobranch
1376 > pick 01a68de1003a 13 9foobranch
1376 > EOF
1377 > EOF
1377
1378
1378 Test restricted mode with fetch (with merge)
1379 Test restricted mode with fetch (with merge)
1379
1380
1380 $ cat <<EOF >> $HGRCPATH
1381 $ cat <<EOF >> $HGRCPATH
1381 > [extensions]
1382 > [extensions]
1382 > fetch =
1383 > fetch =
1383 > EOF
1384 > EOF
1384
1385
1385 $ hg clone -q -r 9 . ../fetch-merge
1386 $ hg clone -q -r 9 . ../fetch-merge
1386 $ cd ../fetch-merge
1387 $ cd ../fetch-merge
1387 $ hg -R ../Test export 10 | hg import -q -
1388 $ hg -R ../Test export 10 | hg import -q -
1388 $ hg fetch -q -r 11
1389 $ hg fetch -q -r 11
1389 $ hg diff -r 9 a
1390 $ hg diff -r 9 a
1390 diff -r 800511b3a22d a
1391 diff -r 800511b3a22d a
1391 --- a/a Thu Jan 01 00:00:00 1970 +0000
1392 --- a/a Thu Jan 01 00:00:00 1970 +0000
1392 +++ b/a * (glob)
1393 +++ b/a * (glob)
1393 @@ -1,4 +1,6 @@
1394 @@ -1,4 +1,6 @@
1394 +foobranch
1395 +foobranch
1395 expand $Id$
1396 expand $Id$
1396 do not process $Id:
1397 do not process $Id:
1397 xxx $
1398 xxx $
1398 $Xinfo$
1399 $Xinfo$
1399 +xxxx
1400 +xxxx
1400
1401
1401 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1402 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1402 suppress expanding keywords at subsequent commands
1403 suppress expanding keywords at subsequent commands
1403
1404
1404 #if windows
1405 #if windows
1405 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1406 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1406 #else
1407 #else
1407 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1408 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1408 #endif
1409 #endif
1409 $ export PYTHONPATH
1410 $ export PYTHONPATH
1410
1411
1411 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1412 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1412 $ mv $HGRCPATH.new $HGRCPATH
1413 $ mv $HGRCPATH.new $HGRCPATH
1413
1414
1414 >>> from __future__ import print_function
1415 >>> from __future__ import print_function
1415 >>> from hgclient import check, readchannel, runcommand
1416 >>> from hgclient import check, readchannel, runcommand
1416 >>> @check
1417 >>> @check
1417 ... def check(server):
1418 ... def check(server):
1418 ... # hello block
1419 ... # hello block
1419 ... readchannel(server)
1420 ... readchannel(server)
1420 ...
1421 ...
1421 ... runcommand(server, [b'cat', b'm'])
1422 ... runcommand(server, [b'cat', b'm'])
1422 ... runcommand(server, [b'diff', b'-c', b'.', b'm'])
1423 ... runcommand(server, [b'diff', b'-c', b'.', b'm'])
1423 ... runcommand(server, [b'cat', b'm'])
1424 ... runcommand(server, [b'cat', b'm'])
1424 *** runcommand cat m
1425 *** runcommand cat m
1425 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1426 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1426 bar
1427 bar
1427 *** runcommand diff -c . m
1428 *** runcommand diff -c . m
1428 *** runcommand cat m
1429 *** runcommand cat m
1429 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1430 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1430 bar
1431 bar
1431
1432
1432 $ cd ..
1433 $ cd ..
1433
1434
1434 #if serve
1435 #if serve
1435
1436
1436 Test that keywords are expanded only in repositories, which enable
1437 Test that keywords are expanded only in repositories, which enable
1437 keyword extension, even if multiple repositories are served in a
1438 keyword extension, even if multiple repositories are served in a
1438 process
1439 process
1439
1440
1440 $ cat >> fetch-merge/.hg/hgrc <<EOF
1441 $ cat >> fetch-merge/.hg/hgrc <<EOF
1441 > [extensions]
1442 > [extensions]
1442 > keyword = !
1443 > keyword = !
1443 > EOF
1444 > EOF
1444
1445
1445 $ cat > paths.conf <<EOF
1446 $ cat > paths.conf <<EOF
1446 > [paths]
1447 > [paths]
1447 > enabled=Test
1448 > enabled=Test
1448 > disabled=fetch-merge
1449 > disabled=fetch-merge
1449 > EOF
1450 > EOF
1450
1451
1451 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1452 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1452 $ cat hg.pid >> $DAEMON_PIDS
1453 $ cat hg.pid >> $DAEMON_PIDS
1453
1454
1454 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1455 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1455 200 Script output follows
1456 200 Script output follows
1456
1457
1457 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1458 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1458 bar
1459 bar
1459
1460
1460 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1461 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1461 200 Script output follows
1462 200 Script output follows
1462
1463
1463 $Id$
1464 $Id$
1464 bar
1465 bar
1465
1466
1466 (check expansion again, for safety)
1467 (check expansion again, for safety)
1467
1468
1468 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1469 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1469 200 Script output follows
1470 200 Script output follows
1470
1471
1471 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1472 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1472 bar
1473 bar
1473
1474
1474 $ killdaemons.py
1475 $ killdaemons.py
1475 #endif
1476 #endif
@@ -1,756 +1,776 b''
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 | \
200 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
201 > "$PYTHON" $TESTTMP/filter.py
200 pulling from ../a
202 pulling from ../a
201 searching for changes
203 searching for changes
202 adding changesets
204 adding changesets
203 adding manifests
205 adding manifests
204 adding file changes
206 adding file changes
205 added 1 changesets with 2 changes to 2 files
207 added 1 changesets with 2 changes to 2 files
206 new changesets 00a13f371396
208 new changesets 00a13f371396
207 MIME-Version: 1.0
209 MIME-Version: 1.0
208 Content-Type: text/plain; charset="us-ascii"
210 Content-Type: text/plain; charset="us-ascii"
209 Content-Transfer-Encoding: 7bit
211 Content-Transfer-Encoding: 7bit
210 Date: * (glob)
212 Date: * (glob)
211 Subject: changeset in $TESTTMP/b: b
213 Subject: changeset in $TESTTMP/b: b
212 From: test@example.com
214 From: test@example.com
213 X-Hg-Notification: changeset 00a13f371396
215 X-Hg-Notification: changeset 00a13f371396
214 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (no-py3 !)
216 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com>
215 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (py3 !)
216 To: baz@example.com, foo@bar
217 To: baz@example.com, foo@bar
217
218
218 changeset 00a13f371396 in $TESTTMP/b
219 changeset 00a13f371396 in $TESTTMP/b
219 details: $TESTTMP/b?cmd=changeset;node=00a13f371396
220 details: $TESTTMP/b?cmd=changeset;node=00a13f371396
220 description: b
221 description: b
221
222
222 diffs (12 lines):
223 diffs (12 lines):
223
224
224 diff -r 0cd96de13884 -r 00a13f371396 a
225 diff -r 0cd96de13884 -r 00a13f371396 a
225 --- a/a Thu Jan 01 00:00:00 1970 +0000
226 --- a/a Thu Jan 01 00:00:00 1970 +0000
226 +++ b/a Thu Jan 01 00:00:01 1970 +0000
227 +++ b/a Thu Jan 01 00:00:01 1970 +0000
227 @@ -1,1 +1,2 @@ a
228 @@ -1,1 +1,2 @@ a
228 +a
229 +a
229 diff -r 0cd96de13884 -r 00a13f371396 b
230 diff -r 0cd96de13884 -r 00a13f371396 b
230 --- a/b Thu Jan 01 00:00:00 1970 +0000
231 --- a/b Thu Jan 01 00:00:00 1970 +0000
231 +++ b/b Thu Jan 01 00:00:01 1970 +0000
232 +++ b/b Thu Jan 01 00:00:01 1970 +0000
232 @@ -1,1 +1,2 @@ b
233 @@ -1,1 +1,2 @@ b
233 +b
234 +b
234 (run 'hg update' to get a working copy)
235 (run 'hg update' to get a working copy)
235
236
236 $ cat <<EOF >> $HGRCPATH
237 $ cat <<EOF >> $HGRCPATH
237 > [notify]
238 > [notify]
238 > config = `pwd`/.notify.conf
239 > config = `pwd`/.notify.conf
239 > domain = test.com
240 > domain = test.com
240 > strip = 42
241 > 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}
242 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
242 >
243 >
243 > [web]
244 > [web]
244 > baseurl = http://test/
245 > baseurl = http://test/
245 > EOF
246 > EOF
246
247
247 fail for config file is missing
248 fail for config file is missing
248
249
249 $ hg --cwd b rollback
250 $ hg --cwd b rollback
250 repository tip rolled back to revision 0 (undo pull)
251 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
252 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
252 pull failed
253 pull failed
253 $ touch ".notify.conf"
254 $ touch ".notify.conf"
254
255
255 pull
256 pull
256
257
257 $ hg --cwd b rollback
258 $ hg --cwd b rollback
258 repository tip rolled back to revision 0 (undo pull)
259 repository tip rolled back to revision 0 (undo pull)
259 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
260 $ hg --traceback --cwd b pull ../a | \
261 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
262 > "$PYTHON" $TESTTMP/filter.py
260 pulling from ../a
263 pulling from ../a
261 searching for changes
264 searching for changes
262 adding changesets
265 adding changesets
263 adding manifests
266 adding manifests
264 adding file changes
267 adding file changes
265 added 1 changesets with 2 changes to 2 files
268 added 1 changesets with 2 changes to 2 files
266 new changesets 00a13f371396
269 new changesets 00a13f371396
267 MIME-Version: 1.0
270 MIME-Version: 1.0
268 Content-Type: text/plain; charset="us-ascii"
271 Content-Type: text/plain; charset="us-ascii"
269 Content-Transfer-Encoding: 7bit
272 Content-Transfer-Encoding: 7bit
270 X-Test: foo
273 X-Test: foo
271 Date: * (glob)
274 Date: * (glob)
272 Subject: b
275 Subject: b
273 From: test@test.com
276 From: test@test.com
274 X-Hg-Notification: changeset 00a13f371396
277 X-Hg-Notification: changeset 00a13f371396
275 Message-Id: <*> (glob)
278 Message-Id: <*> (glob)
276 To: baz@test.com, foo@bar
279 To: baz@test.com, foo@bar
277
280
278 changeset 00a13f371396 in b
281 changeset 00a13f371396 in b
279 description: b
282 description: b
280 diffs (12 lines):
283 diffs (12 lines):
281
284
282 diff -r 0cd96de13884 -r 00a13f371396 a
285 diff -r 0cd96de13884 -r 00a13f371396 a
283 --- a/a Thu Jan 01 00:00:00 1970 +0000
286 --- a/a Thu Jan 01 00:00:00 1970 +0000
284 +++ b/a Thu Jan 01 00:00:01 1970 +0000
287 +++ b/a Thu Jan 01 00:00:01 1970 +0000
285 @@ -1,1 +1,2 @@ a
288 @@ -1,1 +1,2 @@ a
286 +a
289 +a
287 diff -r 0cd96de13884 -r 00a13f371396 b
290 diff -r 0cd96de13884 -r 00a13f371396 b
288 --- a/b Thu Jan 01 00:00:00 1970 +0000
291 --- a/b Thu Jan 01 00:00:00 1970 +0000
289 +++ b/b Thu Jan 01 00:00:01 1970 +0000
292 +++ b/b Thu Jan 01 00:00:01 1970 +0000
290 @@ -1,1 +1,2 @@ b
293 @@ -1,1 +1,2 @@ b
291 +b
294 +b
292 (run 'hg update' to get a working copy)
295 (run 'hg update' to get a working copy)
293
296
294 $ cat << EOF >> $HGRCPATH
297 $ cat << EOF >> $HGRCPATH
295 > [hooks]
298 > [hooks]
296 > incoming.notify = python:hgext.notify.hook
299 > incoming.notify = python:hgext.notify.hook
297 >
300 >
298 > [notify]
301 > [notify]
299 > sources = pull
302 > sources = pull
300 > diffstat = True
303 > diffstat = True
301 > EOF
304 > EOF
302
305
303 pull
306 pull
304
307
305 $ hg --cwd b rollback
308 $ hg --cwd b rollback
306 repository tip rolled back to revision 0 (undo pull)
309 repository tip rolled back to revision 0 (undo pull)
307 $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
310 $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | \
311 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
312 > "$PYTHON" $TESTTMP/filter.py
308 pulling from ../a
313 pulling from ../a
309 searching for changes
314 searching for changes
310 adding changesets
315 adding changesets
311 adding manifests
316 adding manifests
312 adding file changes
317 adding file changes
313 added 1 changesets with 2 changes to 2 files
318 added 1 changesets with 2 changes to 2 files
314 new changesets 00a13f371396
319 new changesets 00a13f371396
315 MIME-Version: 1.0
320 MIME-Version: 1.0
316 Content-Type: text/plain; charset="us-ascii"
321 Content-Type: text/plain; charset="us-ascii"
317 Content-Transfer-Encoding: 7bit
322 Content-Transfer-Encoding: 7bit
318 X-Test: foo
323 X-Test: foo
319 Date: * (glob)
324 Date: * (glob)
320 Subject: b
325 Subject: b
321 From: test@test.com
326 From: test@test.com
322 X-Hg-Notification: changeset 00a13f371396
327 X-Hg-Notification: changeset 00a13f371396
323 Message-Id: <*> (glob)
328 Message-Id: <*> (glob)
324 To: baz@test.com, foo@bar
329 To: baz@test.com, foo@bar
325
330
326 changeset 00a13f371396 in b
331 changeset 00a13f371396 in b
327 description: b
332 description: b
328 diffstat (truncated from 2 to 1 lines):
333 diffstat (truncated from 2 to 1 lines):
329 a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
334 a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
330
335
331 diffs (12 lines):
336 diffs (12 lines):
332
337
333 diff -r 0cd96de13884 -r 00a13f371396 a
338 diff -r 0cd96de13884 -r 00a13f371396 a
334 --- a/a Thu Jan 01 00:00:00 1970 +0000
339 --- a/a Thu Jan 01 00:00:00 1970 +0000
335 +++ b/a Thu Jan 01 00:00:01 1970 +0000
340 +++ b/a Thu Jan 01 00:00:01 1970 +0000
336 @@ -1,1 +1,2 @@ a
341 @@ -1,1 +1,2 @@ a
337 +a
342 +a
338 diff -r 0cd96de13884 -r 00a13f371396 b
343 diff -r 0cd96de13884 -r 00a13f371396 b
339 --- a/b Thu Jan 01 00:00:00 1970 +0000
344 --- a/b Thu Jan 01 00:00:00 1970 +0000
340 +++ b/b Thu Jan 01 00:00:01 1970 +0000
345 +++ b/b Thu Jan 01 00:00:01 1970 +0000
341 @@ -1,1 +1,2 @@ b
346 @@ -1,1 +1,2 @@ b
342 +b
347 +b
343 (run 'hg update' to get a working copy)
348 (run 'hg update' to get a working copy)
344
349
345 test merge
350 test merge
346
351
347 $ cd a
352 $ cd a
348 $ hg up -C 0
353 $ hg up -C 0
349 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
354 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 $ echo a >> a
355 $ echo a >> a
351 $ hg ci -Am adda2 -d '2 0'
356 $ hg ci -Am adda2 -d '2 0'
352 created new head
357 created new head
353 $ hg merge
358 $ hg merge
354 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 (branch merge, don't forget to commit)
360 (branch merge, don't forget to commit)
356 $ hg ci -m merge -d '3 0'
361 $ hg ci -m merge -d '3 0'
357 $ cd ..
362 $ cd ..
358 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
363 $ hg --traceback --cwd b pull ../a | \
364 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
365 > "$PYTHON" $TESTTMP/filter.py
359 pulling from ../a
366 pulling from ../a
360 searching for changes
367 searching for changes
361 adding changesets
368 adding changesets
362 adding manifests
369 adding manifests
363 adding file changes
370 adding file changes
364 added 2 changesets with 0 changes to 0 files
371 added 2 changesets with 0 changes to 0 files
365 new changesets 3332653e1f3c:fccf66cd0c35
372 new changesets 3332653e1f3c:fccf66cd0c35
366 MIME-Version: 1.0
373 MIME-Version: 1.0
367 Content-Type: text/plain; charset="us-ascii"
374 Content-Type: text/plain; charset="us-ascii"
368 Content-Transfer-Encoding: 7bit
375 Content-Transfer-Encoding: 7bit
369 X-Test: foo
376 X-Test: foo
370 Date: * (glob)
377 Date: * (glob)
371 Subject: adda2
378 Subject: adda2
372 From: test@test.com
379 From: test@test.com
373 X-Hg-Notification: changeset 3332653e1f3c
380 X-Hg-Notification: changeset 3332653e1f3c
374 Message-Id: <*> (glob)
381 Message-Id: <*> (glob)
375 To: baz@test.com, foo@bar
382 To: baz@test.com, foo@bar
376
383
377 changeset 3332653e1f3c in b
384 changeset 3332653e1f3c in b
378 description: adda2
385 description: adda2
379 diffstat:
386 diffstat:
380 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
387 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
381
388
382 diffs (6 lines):
389 diffs (6 lines):
383
390
384 diff -r 0cd96de13884 -r 3332653e1f3c a
391 diff -r 0cd96de13884 -r 3332653e1f3c a
385 --- a/a Thu Jan 01 00:00:00 1970 +0000
392 --- a/a Thu Jan 01 00:00:00 1970 +0000
386 +++ b/a Thu Jan 01 00:00:02 1970 +0000
393 +++ b/a Thu Jan 01 00:00:02 1970 +0000
387 @@ -1,1 +1,2 @@ a
394 @@ -1,1 +1,2 @@ a
388 +a
395 +a
389 MIME-Version: 1.0
396 MIME-Version: 1.0
390 Content-Type: text/plain; charset="us-ascii"
397 Content-Type: text/plain; charset="us-ascii"
391 Content-Transfer-Encoding: 7bit
398 Content-Transfer-Encoding: 7bit
392 X-Test: foo
399 X-Test: foo
393 Date: * (glob)
400 Date: * (glob)
394 Subject: merge
401 Subject: merge
395 From: test@test.com
402 From: test@test.com
396 X-Hg-Notification: changeset fccf66cd0c35
403 X-Hg-Notification: changeset fccf66cd0c35
397 Message-Id: <*> (glob)
404 Message-Id: <*> (glob)
398 To: baz@test.com, foo@bar
405 To: baz@test.com, foo@bar
399
406
400 changeset fccf66cd0c35 in b
407 changeset fccf66cd0c35 in b
401 description: merge
408 description: merge
402 diffstat:
409 diffstat:
403 b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
410 b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
404
411
405 diffs (6 lines):
412 diffs (6 lines):
406
413
407 diff -r 3332653e1f3c -r fccf66cd0c35 b
414 diff -r 3332653e1f3c -r fccf66cd0c35 b
408 --- a/b Thu Jan 01 00:00:02 1970 +0000
415 --- a/b Thu Jan 01 00:00:02 1970 +0000
409 +++ b/b Thu Jan 01 00:00:03 1970 +0000
416 +++ b/b Thu Jan 01 00:00:03 1970 +0000
410 @@ -1,1 +1,2 @@ b
417 @@ -1,1 +1,2 @@ b
411 +b
418 +b
412 (run 'hg update' to get a working copy)
419 (run 'hg update' to get a working copy)
413
420
414 non-ascii content and truncation of multi-byte subject
421 non-ascii content and truncation of multi-byte subject
415
422
416 $ cat <<EOF >> $HGRCPATH
423 $ cat <<EOF >> $HGRCPATH
417 > [notify]
424 > [notify]
418 > maxsubject = 4
425 > maxsubject = 4
419 > EOF
426 > EOF
420 $ echo a >> a/a
427 $ echo a >> a/a
421 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
428 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
422 > -m `"$PYTHON" -c 'import sys; getattr(sys.stdout, "buffer", sys.stdout).write(b"\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'`
429 > -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 | \
430 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
431 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
424 > "$PYTHON" $TESTTMP/filter.py
432 > "$PYTHON" $TESTTMP/filter.py
425 pulling from ../a
433 pulling from ../a
426 searching for changes
434 searching for changes
427 adding changesets
435 adding changesets
428 adding manifests
436 adding manifests
429 adding file changes
437 adding file changes
430 added 1 changesets with 1 changes to 1 files
438 added 1 changesets with 1 changes to 1 files
431 new changesets 0f25f9c22b4c
439 new changesets 0f25f9c22b4c
432 MIME-Version: 1.0
440 MIME-Version: 1.0
433 Content-Type: text/plain; charset="us-ascii"
441 Content-Type: text/plain; charset="us-ascii"
434 Content-Transfer-Encoding: 8bit
442 Content-Transfer-Encoding: 8bit
435 X-Test: foo
443 X-Test: foo
436 Date: * (glob)
444 Date: * (glob)
437 Subject: \xc3\xa0... (esc) (no-py3 !)
445 Subject: \xc3\xa0... (esc) (no-py3 !)
438 Subject: =?utf-8?b?w6AuLi4=?= (py3 !)
446 Subject: =?utf-8?b?w6AuLi4=?= (py3 !)
439 From: test@test.com
447 From: test@test.com
440 X-Hg-Notification: changeset 0f25f9c22b4c
448 X-Hg-Notification: changeset 0f25f9c22b4c
441 Message-Id: <*> (glob)
449 Message-Id: <*> (glob)
442 To: baz@test.com, foo@bar
450 To: baz@test.com, foo@bar
443
451
444 changeset 0f25f9c22b4c in b
452 changeset 0f25f9c22b4c in b
445 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
453 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
446 diffstat:
454 diffstat:
447 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
455 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
448
456
449 diffs (7 lines):
457 diffs (7 lines):
450
458
451 diff -r fccf66cd0c35 -r 0f25f9c22b4c a
459 diff -r fccf66cd0c35 -r 0f25f9c22b4c a
452 --- a/a Thu Jan 01 00:00:03 1970 +0000
460 --- a/a Thu Jan 01 00:00:03 1970 +0000
453 +++ b/a Thu Jan 01 00:00:00 1970 +0000
461 +++ b/a Thu Jan 01 00:00:00 1970 +0000
454 @@ -1,2 +1,3 @@ a a
462 @@ -1,2 +1,3 @@ a a
455 +a
463 +a
456 (run 'hg update' to get a working copy)
464 (run 'hg update' to get a working copy)
457
465
458 long lines
466 long lines
459
467
460 $ cat <<EOF >> $HGRCPATH
468 $ cat <<EOF >> $HGRCPATH
461 > [notify]
469 > [notify]
462 > maxsubject = 67
470 > maxsubject = 67
463 > test = False
471 > test = False
464 > mbox = mbox
472 > mbox = mbox
465 > EOF
473 > EOF
466 $ "$PYTHON" -c 'open("a/a", "ab").write(b"no" * 500 + b"\xd1\x84" + b"\n")'
474 $ "$PYTHON" -c 'open("a/a", "ab").write(b"no" * 500 + b"\xd1\x84" + b"\n")'
467 $ hg --cwd a commit -A -m "long line"
475 $ hg --cwd a commit -A -m "long line"
468 $ hg --traceback --cwd b pull ../a
476 $ hg --traceback --cwd b pull ../a
469 pulling from ../a
477 pulling from ../a
470 searching for changes
478 searching for changes
471 adding changesets
479 adding changesets
472 adding manifests
480 adding manifests
473 adding file changes
481 adding file changes
474 added 1 changesets with 1 changes to 1 files
482 added 1 changesets with 1 changes to 1 files
475 new changesets a846b5f6ebb7
483 new changesets a846b5f6ebb7
476 notify: sending 2 subscribers 1 changes
484 notify: sending 2 subscribers 1 changes
477 (run 'hg update' to get a working copy)
485 (run 'hg update' to get a working copy)
478 $ "$PYTHON" $TESTTMP/filter.py < b/mbox
486 $ cat b/mbox | "$PYTHON" $TESTDIR/unwrap-message-id.py | "$PYTHON" $TESTTMP/filter.py
479 From test@test.com ... ... .. ..:..:.. .... (re)
487 From test@test.com ... ... .. ..:..:.. .... (re)
480 MIME-Version: 1.0
488 MIME-Version: 1.0
481 Content-Type: text/plain; charset="*" (glob)
489 Content-Type: text/plain; charset="*" (glob)
482 Content-Transfer-Encoding: quoted-printable
490 Content-Transfer-Encoding: quoted-printable
483 X-Test: foo
491 X-Test: foo
484 Date: * (glob)
492 Date: * (glob)
485 Subject: long line
493 Subject: long line
486 From: test@test.com
494 From: test@test.com
487 X-Hg-Notification: changeset a846b5f6ebb7
495 X-Hg-Notification: changeset a846b5f6ebb7
488 Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob)
496 Message-Id: <hg.a846b5f6ebb7.*.*@*> (glob)
489 To: baz@test.com, foo@bar
497 To: baz@test.com, foo@bar
490
498
491 changeset a846b5f6ebb7 in b
499 changeset a846b5f6ebb7 in b
492 description: long line
500 description: long line
493 diffstat:
501 diffstat:
494 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
502 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
495
503
496 diffs (8 lines):
504 diffs (8 lines):
497
505
498 diff -r 0f25f9c22b4c -r a846b5f6ebb7 a
506 diff -r 0f25f9c22b4c -r a846b5f6ebb7 a
499 --- a/a Thu Jan 01 00:00:00 1970 +0000
507 --- a/a Thu Jan 01 00:00:00 1970 +0000
500 +++ b/a Thu Jan 01 00:00:00 1970 +0000
508 +++ b/a Thu Jan 01 00:00:00 1970 +0000
501 @@ -1,3 +1,4 @@ a a a
509 @@ -1,3 +1,4 @@ a a a
502 +nonononononononononononononononononononononononononononononononononononono=
510 +nonononononononononononononononononononononononononononononononononononono=
503 nononononononononononononononononononononononononononononononononononononon=
511 nononononononononononononononononononononononononononononononononononononon=
504 ononononononononononononononononononononononononononononononononononononono=
512 ononononononononononononononononononononononononononononononononononononono=
505 nononononononononononononononononononononononononononononononononononononon=
513 nononononononononononononononononononononononononononononononononononononon=
506 ononononononononononononononononononononononononononononononononononononono=
514 ononononononononononononononononononononononononononononononononononononono=
507 nononononononononononononononononononononononononononononononononononononon=
515 nononononononononononononononononononononononononononononononononononononon=
508 ononononononononononononononononononononononononononononononononononononono=
516 ononononononononononononononononononononononononononononononononononononono=
509 nononononononononononononononononononononononononononononononononononononon=
517 nononononononononononononononononononononononononononononononononononononon=
510 ononononononononononononononononononononononononononononononononononononono=
518 ononononononononononononononononononononononononononononononononononononono=
511 nononononononononononononononononononononononononononononononononononononon=
519 nononononononononononononononononononononononononononononononononononononon=
512 ononononononononononononononononononononononononononononononononononononono=
520 ononononononononononononononononononononononononononononononononononononono=
513 nononononononononononononononononononononononononononononononononononononon=
521 nononononononononononononononononononononononononononononononononononononon=
514 ononononononononononononononononononononononononononononononononononononono=
522 ononononononononononononononononononononononononononononononononononononono=
515 nonononononononononononono=D1=84
523 nonononononononononononono=D1=84
516
524
517 revset selection: send to address that matches branch and repo
525 revset selection: send to address that matches branch and repo
518
526
519 $ cat << EOF >> $HGRCPATH
527 $ cat << EOF >> $HGRCPATH
520 > [hooks]
528 > [hooks]
521 > incoming.notify = python:hgext.notify.hook
529 > incoming.notify = python:hgext.notify.hook
522 >
530 >
523 > [notify]
531 > [notify]
524 > sources = pull
532 > sources = pull
525 > test = True
533 > test = True
526 > diffstat = False
534 > diffstat = False
527 > maxdiff = 0
535 > maxdiff = 0
528 >
536 >
529 > [reposubs]
537 > [reposubs]
530 > */a#branch(test) = will_no_be_send@example.com
538 > */a#branch(test) = will_no_be_send@example.com
531 > */b#branch(test) = notify@example.com
539 > */b#branch(test) = notify@example.com
532 > EOF
540 > EOF
533 $ hg --cwd a branch test
541 $ hg --cwd a branch test
534 marked working directory as branch test
542 marked working directory as branch test
535 (branches are permanent and global, did you want a bookmark?)
543 (branches are permanent and global, did you want a bookmark?)
536 $ echo a >> a/a
544 $ echo a >> a/a
537 $ hg --cwd a ci -m test -d '1 0'
545 $ hg --cwd a ci -m test -d '1 0'
538 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
546 $ hg --traceback --cwd b pull ../a | \
547 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
548 > "$PYTHON" $TESTTMP/filter.py
539 pulling from ../a
549 pulling from ../a
540 searching for changes
550 searching for changes
541 adding changesets
551 adding changesets
542 adding manifests
552 adding manifests
543 adding file changes
553 adding file changes
544 added 1 changesets with 1 changes to 1 files
554 added 1 changesets with 1 changes to 1 files
545 new changesets f7e5aaed4080
555 new changesets f7e5aaed4080
546 MIME-Version: 1.0
556 MIME-Version: 1.0
547 Content-Type: text/plain; charset="us-ascii"
557 Content-Type: text/plain; charset="us-ascii"
548 Content-Transfer-Encoding: 7bit
558 Content-Transfer-Encoding: 7bit
549 X-Test: foo
559 X-Test: foo
550 Date: * (glob)
560 Date: * (glob)
551 Subject: test
561 Subject: test
552 From: test@test.com
562 From: test@test.com
553 X-Hg-Notification: changeset f7e5aaed4080
563 X-Hg-Notification: changeset f7e5aaed4080
554 Message-Id: <hg.f7e5aaed4080.*.*@*> (glob)
564 Message-Id: <hg.f7e5aaed4080.*.*@*> (glob)
555 To: baz@test.com, foo@bar, notify@example.com
565 To: baz@test.com, foo@bar, notify@example.com
556
566
557 changeset f7e5aaed4080 in b
567 changeset f7e5aaed4080 in b
558 description: test
568 description: test
559 (run 'hg update' to get a working copy)
569 (run 'hg update' to get a working copy)
560
570
561 revset selection: don't send to address that waits for mails
571 revset selection: don't send to address that waits for mails
562 from different branch
572 from different branch
563
573
564 $ hg --cwd a update default
574 $ hg --cwd a update default
565 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 $ echo a >> a/a
576 $ echo a >> a/a
567 $ hg --cwd a ci -m test -d '1 0'
577 $ hg --cwd a ci -m test -d '1 0'
568 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
578 $ hg --traceback --cwd b pull ../a | \
579 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
580 > "$PYTHON" $TESTTMP/filter.py
569 pulling from ../a
581 pulling from ../a
570 searching for changes
582 searching for changes
571 adding changesets
583 adding changesets
572 adding manifests
584 adding manifests
573 adding file changes
585 adding file changes
574 added 1 changesets with 0 changes to 0 files (+1 heads)
586 added 1 changesets with 0 changes to 0 files (+1 heads)
575 new changesets 645eb6690ecf
587 new changesets 645eb6690ecf
576 MIME-Version: 1.0
588 MIME-Version: 1.0
577 Content-Type: text/plain; charset="us-ascii"
589 Content-Type: text/plain; charset="us-ascii"
578 Content-Transfer-Encoding: 7bit
590 Content-Transfer-Encoding: 7bit
579 X-Test: foo
591 X-Test: foo
580 Date: * (glob)
592 Date: * (glob)
581 Subject: test
593 Subject: test
582 From: test@test.com
594 From: test@test.com
583 X-Hg-Notification: changeset 645eb6690ecf
595 X-Hg-Notification: changeset 645eb6690ecf
584 Message-Id: <hg.645eb6690ecf.*.*@*> (glob)
596 Message-Id: <hg.645eb6690ecf.*.*@*> (glob)
585 To: baz@test.com, foo@bar
597 To: baz@test.com, foo@bar
586
598
587 changeset 645eb6690ecf in b
599 changeset 645eb6690ecf in b
588 description: test
600 description: test
589 (run 'hg heads' to see heads)
601 (run 'hg heads' to see heads)
590
602
591 default template:
603 default template:
592
604
593 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new"
605 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new"
594 $ mv "$HGRCPATH.new" $HGRCPATH
606 $ mv "$HGRCPATH.new" $HGRCPATH
595 $ echo a >> a/a
607 $ echo a >> a/a
596 $ hg --cwd a commit -m 'default template'
608 $ hg --cwd a commit -m 'default template'
597 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
609 $ hg --cwd b pull ../a -q | \
610 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
611 > "$PYTHON" $TESTTMP/filter.py
598 MIME-Version: 1.0
612 MIME-Version: 1.0
599 Content-Type: text/plain; charset="us-ascii"
613 Content-Type: text/plain; charset="us-ascii"
600 Content-Transfer-Encoding: 7bit
614 Content-Transfer-Encoding: 7bit
601 Date: * (glob)
615 Date: * (glob)
602 Subject: changeset in b: default template
616 Subject: changeset in b: default template
603 From: test@test.com
617 From: test@test.com
604 X-Hg-Notification: changeset 5cd4346eed47
618 X-Hg-Notification: changeset 5cd4346eed47
605 Message-Id: <hg.5cd4346eed47.*.*@*> (glob)
619 Message-Id: <hg.5cd4346eed47.*.*@*> (glob)
606 To: baz@test.com, foo@bar
620 To: baz@test.com, foo@bar
607
621
608 changeset 5cd4346eed47 in $TESTTMP/b
622 changeset 5cd4346eed47 in $TESTTMP/b
609 details: http://test/b?cmd=changeset;node=5cd4346eed47
623 details: http://test/b?cmd=changeset;node=5cd4346eed47
610 description: default template
624 description: default template
611
625
612 with style:
626 with style:
613
627
614 $ cat <<EOF > notifystyle.map
628 $ cat <<EOF > notifystyle.map
615 > changeset = "Subject: {desc|firstline|strip}
629 > changeset = "Subject: {desc|firstline|strip}
616 > From: {author}
630 > From: {author}
617 > {""}
631 > {""}
618 > changeset {node|short}"
632 > changeset {node|short}"
619 > EOF
633 > EOF
620 $ cat <<EOF >> $HGRCPATH
634 $ cat <<EOF >> $HGRCPATH
621 > [notify]
635 > [notify]
622 > style = $TESTTMP/notifystyle.map
636 > style = $TESTTMP/notifystyle.map
623 > EOF
637 > EOF
624 $ echo a >> a/a
638 $ echo a >> a/a
625 $ hg --cwd a commit -m 'with style'
639 $ hg --cwd a commit -m 'with style'
626 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
640 $ hg --cwd b pull ../a -q | \
641 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
642 > "$PYTHON" $TESTTMP/filter.py
627 MIME-Version: 1.0
643 MIME-Version: 1.0
628 Content-Type: text/plain; charset="us-ascii"
644 Content-Type: text/plain; charset="us-ascii"
629 Content-Transfer-Encoding: 7bit
645 Content-Transfer-Encoding: 7bit
630 Date: * (glob)
646 Date: * (glob)
631 Subject: with style
647 Subject: with style
632 From: test@test.com
648 From: test@test.com
633 X-Hg-Notification: changeset ec8d9d852f56
649 X-Hg-Notification: changeset ec8d9d852f56
634 Message-Id: <hg.ec8d9d852f56.*.*@*> (glob)
650 Message-Id: <hg.ec8d9d852f56.*.*@*> (glob)
635 To: baz@test.com, foo@bar
651 To: baz@test.com, foo@bar
636
652
637 changeset ec8d9d852f56
653 changeset ec8d9d852f56
638
654
639 with template (overrides style):
655 with template (overrides style):
640
656
641 $ cat <<EOF >> $HGRCPATH
657 $ cat <<EOF >> $HGRCPATH
642 > template = Subject: {node|short}: {desc|firstline|strip}
658 > template = Subject: {node|short}: {desc|firstline|strip}
643 > From: {author}
659 > From: {author}
644 > {""}
660 > {""}
645 > {desc}
661 > {desc}
646 > EOF
662 > EOF
647 $ echo a >> a/a
663 $ echo a >> a/a
648 $ hg --cwd a commit -m 'with template'
664 $ hg --cwd a commit -m 'with template'
649 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
665 $ hg --cwd b pull ../a -q | \
666 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
667 > "$PYTHON" $TESTTMP/filter.py
650 MIME-Version: 1.0
668 MIME-Version: 1.0
651 Content-Type: text/plain; charset="us-ascii"
669 Content-Type: text/plain; charset="us-ascii"
652 Content-Transfer-Encoding: 7bit
670 Content-Transfer-Encoding: 7bit
653 Date: * (glob)
671 Date: * (glob)
654 Subject: 14721b538ae3: with template
672 Subject: 14721b538ae3: with template
655 From: test@test.com
673 From: test@test.com
656 X-Hg-Notification: changeset 14721b538ae3
674 X-Hg-Notification: changeset 14721b538ae3
657 Message-Id: <hg.14721b538ae3.*.*@*> (glob)
675 Message-Id: <hg.14721b538ae3.*.*@*> (glob)
658 To: baz@test.com, foo@bar
676 To: baz@test.com, foo@bar
659
677
660 with template
678 with template
661
679
662 showfunc diff
680 showfunc diff
663 $ cat <<EOF >> $HGRCPATH
681 $ cat <<EOF >> $HGRCPATH
664 > showfunc = True
682 > showfunc = True
665 > template =
683 > template =
666 > maxdiff = -1
684 > maxdiff = -1
667 > EOF
685 > EOF
668 $ cd a
686 $ cd a
669 $ cat > f1 << EOF
687 $ cat > f1 << EOF
670 > int main() {
688 > int main() {
671 > int a = 0;
689 > int a = 0;
672 > int b = 1;
690 > int b = 1;
673 > int c = 2;
691 > int c = 2;
674 > int d = 3;
692 > int d = 3;
675 > return a + b + c + d;
693 > return a + b + c + d;
676 > }
694 > }
677 > EOF
695 > EOF
678 $ hg commit -Am addfunction
696 $ hg commit -Am addfunction
679 adding f1
697 adding f1
680 $ hg --cwd ../b pull ../a
698 $ hg --cwd ../b pull ../a | \
699 > "$PYTHON" $TESTDIR/unwrap-message-id.py
681 pulling from ../a
700 pulling from ../a
682 searching for changes
701 searching for changes
683 adding changesets
702 adding changesets
684 adding manifests
703 adding manifests
685 adding file changes
704 adding file changes
686 added 1 changesets with 1 changes to 1 files
705 added 1 changesets with 1 changes to 1 files
687 new changesets b86bc16ff894
706 new changesets b86bc16ff894
688 MIME-Version: 1.0
707 MIME-Version: 1.0
689 Content-Type: text/plain; charset="us-ascii"
708 Content-Type: text/plain; charset="us-ascii"
690 Content-Transfer-Encoding: 7bit
709 Content-Transfer-Encoding: 7bit
691 Date: * (glob)
710 Date: * (glob)
692 Subject: addfunction
711 Subject: addfunction
693 From: test@test.com
712 From: test@test.com
694 X-Hg-Notification: changeset b86bc16ff894
713 X-Hg-Notification: changeset b86bc16ff894
695 Message-Id: <hg.b86bc16ff894.*.*@*> (glob)
714 Message-Id: <hg.b86bc16ff894.*.*@*> (glob)
696 To: baz@test.com, foo@bar
715 To: baz@test.com, foo@bar
697
716
698 changeset b86bc16ff894
717 changeset b86bc16ff894
699 diffs (11 lines):
718 diffs (11 lines):
700
719
701 diff -r 14721b538ae3 -r b86bc16ff894 f1
720 diff -r 14721b538ae3 -r b86bc16ff894 f1
702 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
721 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
703 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
722 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
704 @@ -0,0 +1,7 @@
723 @@ -0,0 +1,7 @@
705 +int main() {
724 +int main() {
706 + int a = 0;
725 + int a = 0;
707 + int b = 1;
726 + int b = 1;
708 + int c = 2;
727 + int c = 2;
709 + int d = 3;
728 + int d = 3;
710 + return a + b + c + d;
729 + return a + b + c + d;
711 +}
730 +}
712 (run 'hg update' to get a working copy)
731 (run 'hg update' to get a working copy)
713 $ cat > f1 << EOF
732 $ cat > f1 << EOF
714 > int main() {
733 > int main() {
715 > int a = 0;
734 > int a = 0;
716 > int b = 1;
735 > int b = 1;
717 > int c = 2;
736 > int c = 2;
718 > int e = 3;
737 > int e = 3;
719 > return a + b + c + e;
738 > return a + b + c + e;
720 > }
739 > }
721 > EOF
740 > EOF
722 $ hg commit -m changefunction
741 $ hg commit -m changefunction
723 $ hg --cwd ../b --config notify.showfunc=True pull ../a
742 $ hg --cwd ../b --config notify.showfunc=True pull ../a | \
743 > "$PYTHON" $TESTDIR/unwrap-message-id.py
724 pulling from ../a
744 pulling from ../a
725 searching for changes
745 searching for changes
726 adding changesets
746 adding changesets
727 adding manifests
747 adding manifests
728 adding file changes
748 adding file changes
729 added 1 changesets with 1 changes to 1 files
749 added 1 changesets with 1 changes to 1 files
730 new changesets e81040e9838c
750 new changesets e81040e9838c
731 MIME-Version: 1.0
751 MIME-Version: 1.0
732 Content-Type: text/plain; charset="us-ascii"
752 Content-Type: text/plain; charset="us-ascii"
733 Content-Transfer-Encoding: 7bit
753 Content-Transfer-Encoding: 7bit
734 Date: * (glob)
754 Date: * (glob)
735 Subject: changefunction
755 Subject: changefunction
736 From: test@test.com
756 From: test@test.com
737 X-Hg-Notification: changeset e81040e9838c
757 X-Hg-Notification: changeset e81040e9838c
738 Message-Id: <hg.e81040e9838c.*.*@*> (glob)
758 Message-Id: <hg.e81040e9838c.*.*@*> (glob)
739 To: baz@test.com, foo@bar
759 To: baz@test.com, foo@bar
740
760
741 changeset e81040e9838c
761 changeset e81040e9838c
742 diffs (12 lines):
762 diffs (12 lines):
743
763
744 diff -r b86bc16ff894 -r e81040e9838c f1
764 diff -r b86bc16ff894 -r e81040e9838c f1
745 --- a/f1 Thu Jan 01 00:00:00 1970 +0000
765 --- a/f1 Thu Jan 01 00:00:00 1970 +0000
746 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
766 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
747 @@ -2,6 +2,6 @@ int main() {
767 @@ -2,6 +2,6 @@ int main() {
748 int a = 0;
768 int a = 0;
749 int b = 1;
769 int b = 1;
750 int c = 2;
770 int c = 2;
751 - int d = 3;
771 - int d = 3;
752 - return a + b + c + d;
772 - return a + b + c + d;
753 + int e = 3;
773 + int e = 3;
754 + return a + b + c + e;
774 + return a + b + c + e;
755 }
775 }
756 (run 'hg update' to get a working copy)
776 (run 'hg update' to get a working copy)
General Comments 0
You need to be logged in to leave comments. Login now