##// END OF EJS Templates
test-notify: make it pass on Mac OS X 10.5
Florent Guillaume -
r6359:25e74cd3 default
parent child Browse files
Show More
@@ -1,62 +1,72 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 cat <<EOF >> $HGRCPATH
3 cat <<EOF >> $HGRCPATH
4 [extensions]
4 [extensions]
5 notify=
5 notify=
6
6
7 [hooks]
7 [hooks]
8 incoming.notify = python:hgext.notify.hook
8 incoming.notify = python:hgext.notify.hook
9
9
10 [notify]
10 [notify]
11 sources = pull
11 sources = pull
12 diffstat = False
12 diffstat = False
13
13
14 [usersubs]
14 [usersubs]
15 foo@bar = *
15 foo@bar = *
16
16
17 [reposubs]
17 [reposubs]
18 * = baz
18 * = baz
19 EOF
19 EOF
20
20
21 hg help notify
21 hg help notify
22 hg init a
22 hg init a
23 echo a > a/a
23 echo a > a/a
24 echo % commit
24 echo % commit
25 hg --traceback --cwd a commit -Ama -d '0 0'
25 hg --traceback --cwd a commit -Ama -d '0 0'
26
26
27 echo % clone
27 echo % clone
28 hg --traceback clone a b
28 hg --traceback clone a b
29
29
30 echo a >> a/a
30 echo a >> a/a
31 echo % commit
31 echo % commit
32 hg --traceback --cwd a commit -Amb -d '1 0'
32 hg --traceback --cwd a commit -Amb -d '1 0'
33
33
34 # on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
35 cat <<EOF >> $HGRCPATH
36 [notify]
37 maxsubject = 200
38 EOF
39
40 # the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
41 # of the very long subject line
34 echo '% pull (minimal config)'
42 echo '% pull (minimal config)'
35 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
43 hg --traceback --cwd b pull ../a 2>&1 |
44 python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' |
45 sed -e 's/\(Message-Id:\).*/\1/' \
36 -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
46 -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
37 -e 's/^details: .*test-notify/details: test-notify/' \
47 -e 's/^details: .*test-notify/details: test-notify/' \
38 -e 's/^Date:.*/Date:/'
48 -e 's/^Date:.*/Date:/'
39
49
40 cat <<EOF >> $HGRCPATH
50 cat <<EOF >> $HGRCPATH
41 [notify]
51 [notify]
42 config = $HGTMP/.notify.conf
52 config = $HGTMP/.notify.conf
43 domain = test.com
53 domain = test.com
44 strip = 3
54 strip = 3
45 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
55 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
46
56
47 [web]
57 [web]
48 baseurl = http://test/
58 baseurl = http://test/
49 EOF
59 EOF
50
60
51 echo % fail for config file is missing
61 echo % fail for config file is missing
52 hg --cwd b rollback
62 hg --cwd b rollback
53 hg --cwd b pull ../a 2>&1 | grep 'unable to open.*\.notify\.conf' > /dev/null && echo pull failed
63 hg --cwd b pull ../a 2>&1 | grep 'unable to open.*\.notify\.conf' > /dev/null && echo pull failed
54
64
55 touch "$HGTMP/.notify.conf"
65 touch "$HGTMP/.notify.conf"
56
66
57 echo % pull
67 echo % pull
58 hg --cwd b rollback
68 hg --cwd b rollback
59 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
69 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
60 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
70 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
61 -e 's/^Date:.*/Date:/'
71 -e 's/^Date:.*/Date:/'
62
72
@@ -1,67 +1,66 b''
1 notify extension - No help text available
1 notify extension - No help text available
2
2
3 no commands defined
3 no commands defined
4 % commit
4 % commit
5 adding a
5 adding a
6 % clone
6 % clone
7 updating working directory
7 updating working directory
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 % commit
9 % commit
10 % pull (minimal config)
10 % pull (minimal config)
11 pulling from ../a
11 pulling from ../a
12 searching for changes
12 searching for changes
13 adding changesets
13 adding changesets
14 adding manifests
14 adding manifests
15 adding file changes
15 adding file changes
16 added 1 changesets with 1 changes to 1 files
16 added 1 changesets with 1 changes to 1 files
17 Date:
17 Date:
18 Subject: changeset in test-notify/b: b
18 Subject: changeset in test-notify/b: b
19 From: test
19 From: test
20 X-Hg-Notification: changeset 0647d048b600
20 X-Hg-Notification: changeset 0647d048b600
21 Message-Id:
21 Message-Id:
22 To: baz, foo@bar
22 To: baz, foo@bar
23
23
24 changeset 0647d048b600 in test-notify/b
24 changeset 0647d048b600 in test-notify/b
25 details: test-notify/b?cmd=changeset;node=0647d048b600
25 details: test-notify/b?cmd=changeset;node=0647d048b600
26 description:
26 description: b
27 b
28
27
29 diffs (6 lines):
28 diffs (6 lines):
30
29
31 diff -r cb9a9f314b8b -r 0647d048b600 a
30 diff -r cb9a9f314b8b -r 0647d048b600 a
32 --- a/a Thu Jan 01 00:00:00 1970 +0000
31 --- a/a Thu Jan 01 00:00:00 1970 +0000
33 +++ b/a Thu Jan 01 00:00:01 1970 +0000
32 +++ b/a Thu Jan 01 00:00:01 1970 +0000
34 @@ -1,1 +1,2 @@
33 @@ -1,1 +1,2 @@
35 a
34 a
36 +a
35 +a
37 (run 'hg update' to get a working copy)
36 (run 'hg update' to get a working copy)
38 % fail for config file is missing
37 % fail for config file is missing
39 rolling back last transaction
38 rolling back last transaction
40 pull failed
39 pull failed
41 % pull
40 % pull
42 rolling back last transaction
41 rolling back last transaction
43 pulling from ../a
42 pulling from ../a
44 searching for changes
43 searching for changes
45 adding changesets
44 adding changesets
46 adding manifests
45 adding manifests
47 adding file changes
46 adding file changes
48 added 1 changesets with 1 changes to 1 files
47 added 1 changesets with 1 changes to 1 files
49 Date:
48 Date:
50 Subject: b
49 Subject: b
51 From: test@test.com
50 From: test@test.com
52 X-Hg-Notification: changeset 0647d048b600
51 X-Hg-Notification: changeset 0647d048b600
53 Message-Id:
52 Message-Id:
54 To: baz@test.com, foo@bar
53 To: baz@test.com, foo@bar
55
54
56 changeset 0647d048b600
55 changeset 0647d048b600
57 description:
56 description:
58 b
57 b
59 diffs (6 lines):
58 diffs (6 lines):
60
59
61 diff -r cb9a9f314b8b -r 0647d048b600 a
60 diff -r cb9a9f314b8b -r 0647d048b600 a
62 --- a/a Thu Jan 01 00:00:00 1970 +0000
61 --- a/a Thu Jan 01 00:00:00 1970 +0000
63 +++ b/a Thu Jan 01 00:00:01 1970 +0000
62 +++ b/a Thu Jan 01 00:00:01 1970 +0000
64 @@ -1,1 +1,2 @@
63 @@ -1,1 +1,2 @@
65 a
64 a
66 +a
65 +a
67 (run 'hg update' to get a working copy)
66 (run 'hg update' to get a working copy)
General Comments 0
You need to be logged in to leave comments. Login now