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