Mercurial > hg
annotate tests/test-notify @ 11306:deaeb2d84d8a stable
fix encoding bug in 05ac42e56452
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Tue, 08 Jun 2010 13:19:22 +0200 |
parents | 912bfef12ba6 |
children | 3b65c3c3cc8d |
rev | line source |
---|---|
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
1 #!/bin/sh |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
2 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 cat <<EOF >> $HGRCPATH |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 [extensions] |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 notify= |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
7 [hooks] |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
8 incoming.notify = python:hgext.notify.hook |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
10 [notify] |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
11 sources = pull |
3747
b5c4d749f37f
Fix test-notify for systems without or with a different version of diffstat.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3740
diff
changeset
|
12 diffstat = False |
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
13 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 [usersubs] |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 foo@bar = * |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
16 |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
17 [reposubs] |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
18 * = baz |
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
19 EOF |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
20 |
4009
86098ec4b77a
fix hg help <ext> for extension that do not define any command
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3747
diff
changeset
|
21 hg help notify |
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
22 hg init a |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
23 echo a > a/a |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
24 echo % commit |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
25 hg --traceback --cwd a commit -Ama -d '0 0' |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
26 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
27 echo % clone |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
28 hg --traceback clone a b |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
29 |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
30 echo a >> a/a |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
31 echo % commit |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
32 hg --traceback --cwd a commit -Amb -d '1 0' |
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
33 |
6359
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
34 # on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
35 cat <<EOF >> $HGRCPATH |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
36 [notify] |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
37 maxsubject = 200 |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
38 EOF |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
39 |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
40 # the python call below wraps continuation lines, which appear on Mac OS X 10.5 because |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
41 # of the very long subject line |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
42 echo '% pull (minimal config)' |
6359
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
43 hg --traceback --cwd b pull ../a 2>&1 | |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
44 python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' | |
25e74cd3f023
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents:
4517
diff
changeset
|
45 sed -e 's/\(Message-Id:\).*/\1/' \ |
4157
bfeff6dcac7a
Fix sed expression in test-notify to be more portable.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4107
diff
changeset
|
46 -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \ |
4479
afa1f57ae484
Add sending date to notify message.
Mathieu Clabaut <mathieu.clabaut@gmail.com>
parents:
4157
diff
changeset
|
47 -e 's/^details: .*test-notify/details: test-notify/' \ |
afa1f57ae484
Add sending date to notify message.
Mathieu Clabaut <mathieu.clabaut@gmail.com>
parents:
4157
diff
changeset
|
48 -e 's/^Date:.*/Date:/' |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
49 |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
50 cat <<EOF >> $HGRCPATH |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
51 [notify] |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
52 config = $HGTMP/.notify.conf |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
53 domain = test.com |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
54 strip = 3 |
7658
44b3f7bbe2f3
notify: fix neglect of custom headers set via template
Christian Ebert <blacktrash@gmx.net>
parents:
7172
diff
changeset
|
55 template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
56 |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
57 [web] |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
58 baseurl = http://test/ |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
59 EOF |
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
60 |
4517
5371a213b0f4
ui: make readsections() abort when configuration cannot be read.
Patrick Mezard <pmezard@gmail.com>
parents:
4479
diff
changeset
|
61 echo % fail for config file is missing |
5371a213b0f4
ui: make readsections() abort when configuration cannot be read.
Patrick Mezard <pmezard@gmail.com>
parents:
4479
diff
changeset
|
62 hg --cwd b rollback |
8142
912bfef12ba6
ui: fold readsections into readconfig
Matt Mackall <mpm@selenic.com>
parents:
7664
diff
changeset
|
63 hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed |
4517
5371a213b0f4
ui: make readsections() abort when configuration cannot be read.
Patrick Mezard <pmezard@gmail.com>
parents:
4479
diff
changeset
|
64 |
5371a213b0f4
ui: make readsections() abort when configuration cannot be read.
Patrick Mezard <pmezard@gmail.com>
parents:
4479
diff
changeset
|
65 touch "$HGTMP/.notify.conf" |
5371a213b0f4
ui: make readsections() abort when configuration cannot be read.
Patrick Mezard <pmezard@gmail.com>
parents:
4479
diff
changeset
|
66 |
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
67 echo % pull |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
68 hg --cwd b rollback |
3740
aef384dbc731
add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
69 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ |
4479
afa1f57ae484
Add sending date to notify message.
Mathieu Clabaut <mathieu.clabaut@gmail.com>
parents:
4157
diff
changeset
|
70 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \ |
afa1f57ae484
Add sending date to notify message.
Mathieu Clabaut <mathieu.clabaut@gmail.com>
parents:
4157
diff
changeset
|
71 -e 's/^Date:.*/Date:/' |
4094
fbf0e9acfd83
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4009
diff
changeset
|
72 |
7105
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
73 cat << EOF >> $HGRCPATH |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
74 [hooks] |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
75 incoming.notify = python:hgext.notify.hook |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
76 |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
77 [notify] |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
78 sources = pull |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
79 diffstat = True |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
80 EOF |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
81 |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
82 echo % pull |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
83 hg --cwd b rollback |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
84 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ |
31837416ef4d
tests: add some testing for patch.diffstat()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6359
diff
changeset
|
85 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \ |
7172
fb1d7a42663c
Use dummy diffstat in tests and remove older diffstat workaround.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
7165
diff
changeset
|
86 -e 's/^Date:.*/Date:/' |
7664
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
87 |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
88 echo % test merge |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
89 cd a |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
90 hg up -C 0 |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
91 echo a >> a |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
92 hg ci -Am adda2 -d '2 0' |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
93 hg merge |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
94 hg ci -m merge -d '3 0' |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
95 cd .. |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
96 |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
97 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
98 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \ |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
99 -e 's/^Date:.*/Date:/' |
3cc74ee75b0d
diffstat: don't fail on merges
Patrick Mezard <pmezard@gmail.com>
parents:
7658
diff
changeset
|
100 |