##// END OF EJS Templates
tests: handle Message-Id line wrapping in test-notify-changegroup.t...
Denis Laxalde -
r43698:9a43cef9 stable
parent child Browse files
Show More
@@ -1,216 +1,219 b''
1
1
2 $ cat <<EOF >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
3 > [extensions]
4 > notify=
4 > notify=
5 >
5 >
6 > [hooks]
6 > [hooks]
7 > changegroup.notify = python:hgext.notify.hook
7 > changegroup.notify = python:hgext.notify.hook
8 >
8 >
9 > [notify]
9 > [notify]
10 > sources = push
10 > sources = push
11 > diffstat = False
11 > diffstat = False
12 > maxsubject = 10
12 > maxsubject = 10
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 $ hg init a
20 $ hg init a
21
21
22 clone
22 clone
23
23
24 $ hg --traceback clone a b
24 $ hg --traceback clone a b
25 updating to branch default
25 updating to branch default
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 $ echo a > b/a
27 $ echo a > b/a
28
28
29 commit
29 commit
30
30
31 $ hg --traceback --cwd b commit -Ama
31 $ hg --traceback --cwd b commit -Ama
32 adding a
32 adding a
33 $ echo a >> b/a
33 $ echo a >> b/a
34
34
35 commit
35 commit
36
36
37 $ hg --traceback --cwd b commit -Amb
37 $ hg --traceback --cwd b commit -Amb
38
38
39 push
39 push
40
40
41 $ hg --traceback --cwd b push ../a 2>&1 |
41 $ hg --traceback --cwd b push ../a 2>&1 |
42 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
42 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
43 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
43 pushing to ../a
44 pushing to ../a
44 searching for changes
45 searching for changes
45 adding changesets
46 adding changesets
46 adding manifests
47 adding manifests
47 adding file changes
48 adding file changes
48 added 2 changesets with 2 changes to 1 files
49 added 2 changesets with 2 changes to 1 files
49 MIME-Version: 1.0
50 MIME-Version: 1.0
50 Content-Type: text/plain; charset="us-ascii"
51 Content-Type: text/plain; charset="us-ascii"
51 Content-Transfer-Encoding: 7bit
52 Content-Transfer-Encoding: 7bit
52 Date: * (glob)
53 Date: * (glob)
53 Subject: * (glob)
54 Subject: * (glob)
54 From: test
55 From: test
55 X-Hg-Notification: changeset cb9a9f314b8b
56 X-Hg-Notification: changeset cb9a9f314b8b
56 Message-Id: <*> (glob)
57 Message-Id: <*> (glob)
57 To: baz, foo@bar
58 To: baz, foo@bar
58
59
59 changeset cb9a9f314b8b in $TESTTMP/a
60 changeset cb9a9f314b8b in $TESTTMP/a
60 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
61 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
61 summary: a
62 summary: a
62
63
63 changeset ba677d0156c1 in $TESTTMP/a
64 changeset ba677d0156c1 in $TESTTMP/a
64 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
65 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
65 summary: b
66 summary: b
66
67
67 diffs (6 lines):
68 diffs (6 lines):
68
69
69 diff -r 000000000000 -r ba677d0156c1 a
70 diff -r 000000000000 -r ba677d0156c1 a
70 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71 +++ b/a Thu Jan 01 00:00:00 1970 +0000
72 +++ b/a Thu Jan 01 00:00:00 1970 +0000
72 @@ -0,0 +1,2 @@
73 @@ -0,0 +1,2 @@
73 +a
74 +a
74 +a
75 +a
75 $ hg --cwd a rollback
76 $ hg --cwd a rollback
76 repository tip rolled back to revision -1 (undo push)
77 repository tip rolled back to revision -1 (undo push)
77
78
78 unbundle with unrelated source
79 unbundle with unrelated source
79
80
80 $ hg --cwd b bundle ../test.hg ../a
81 $ hg --cwd b bundle ../test.hg ../a
81 searching for changes
82 searching for changes
82 2 changesets found
83 2 changesets found
83 $ hg --cwd a unbundle ../test.hg
84 $ hg --cwd a unbundle ../test.hg
84 adding changesets
85 adding changesets
85 adding manifests
86 adding manifests
86 adding file changes
87 adding file changes
87 added 2 changesets with 2 changes to 1 files
88 added 2 changesets with 2 changes to 1 files
88 new changesets cb9a9f314b8b:ba677d0156c1 (2 drafts)
89 new changesets cb9a9f314b8b:ba677d0156c1 (2 drafts)
89 (run 'hg update' to get a working copy)
90 (run 'hg update' to get a working copy)
90 $ hg --cwd a rollback
91 $ hg --cwd a rollback
91 repository tip rolled back to revision -1 (undo unbundle)
92 repository tip rolled back to revision -1 (undo unbundle)
92
93
93 unbundle with correct source
94 unbundle with correct source
94
95
95 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
96 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
97 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
96 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
98 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
97 adding changesets
99 adding changesets
98 adding manifests
100 adding manifests
99 adding file changes
101 adding file changes
100 added 2 changesets with 2 changes to 1 files
102 added 2 changesets with 2 changes to 1 files
101 new changesets cb9a9f314b8b:ba677d0156c1 (2 drafts)
103 new changesets cb9a9f314b8b:ba677d0156c1 (2 drafts)
102 MIME-Version: 1.0
104 MIME-Version: 1.0
103 Content-Type: text/plain; charset="us-ascii"
105 Content-Type: text/plain; charset="us-ascii"
104 Content-Transfer-Encoding: 7bit
106 Content-Transfer-Encoding: 7bit
105 Date: * (glob)
107 Date: * (glob)
106 Subject: * (glob)
108 Subject: * (glob)
107 From: test
109 From: test
108 X-Hg-Notification: changeset cb9a9f314b8b
110 X-Hg-Notification: changeset cb9a9f314b8b
109 Message-Id: <*> (glob)
111 Message-Id: <*> (glob)
110 To: baz, foo@bar
112 To: baz, foo@bar
111
113
112 changeset cb9a9f314b8b in $TESTTMP/a
114 changeset cb9a9f314b8b in $TESTTMP/a
113 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
115 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
114 summary: a
116 summary: a
115
117
116 changeset ba677d0156c1 in $TESTTMP/a
118 changeset ba677d0156c1 in $TESTTMP/a
117 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
119 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
118 summary: b
120 summary: b
119
121
120 diffs (6 lines):
122 diffs (6 lines):
121
123
122 diff -r 000000000000 -r ba677d0156c1 a
124 diff -r 000000000000 -r ba677d0156c1 a
123 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
125 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
124 +++ b/a Thu Jan 01 00:00:00 1970 +0000
126 +++ b/a Thu Jan 01 00:00:00 1970 +0000
125 @@ -0,0 +1,2 @@
127 @@ -0,0 +1,2 @@
126 +a
128 +a
127 +a
129 +a
128 (run 'hg update' to get a working copy)
130 (run 'hg update' to get a working copy)
129
131
130 Check that using the first committer as the author of a changeset works:
132 Check that using the first committer as the author of a changeset works:
131 Check that the config option works.
133 Check that the config option works.
132 Check that the first committer is indeed used for "From:".
134 Check that the first committer is indeed used for "From:".
133 Check that the merge user is NOT used for "From:"
135 Check that the merge user is NOT used for "From:"
134
136
135 Create new file
137 Create new file
136
138
137 $ echo a > b/b
139 $ echo a > b/b
138 $ echo b >> b/b
140 $ echo b >> b/b
139 $ echo c >> b/b
141 $ echo c >> b/b
140 $ hg --traceback --cwd b commit -Amnewfile -u committer_1
142 $ hg --traceback --cwd b commit -Amnewfile -u committer_1
141 adding b
143 adding b
142
144
143 commit as one user
145 commit as one user
144
146
145 $ echo x > b/b
147 $ echo x > b/b
146 $ echo b >> b/b
148 $ echo b >> b/b
147 $ echo c >> b/b
149 $ echo c >> b/b
148 $ hg --traceback --cwd b commit -Amx -u committer_2
150 $ hg --traceback --cwd b commit -Amx -u committer_2
149
151
150 commit as other user, change file so we can do an (automatic) merge
152 commit as other user, change file so we can do an (automatic) merge
151
153
152 $ hg --cwd b up 2
154 $ hg --cwd b up 2
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 $ echo a > b/b
156 $ echo a > b/b
155 $ echo b >> b/b
157 $ echo b >> b/b
156 $ echo y >> b/b
158 $ echo y >> b/b
157 $ hg --traceback --cwd b commit -Amy -u committer_3
159 $ hg --traceback --cwd b commit -Amy -u committer_3
158 created new head
160 created new head
159
161
160 merge as a different user
162 merge as a different user
161
163
162 $ hg --cwd b merge --config notify.fromauthor=True
164 $ hg --cwd b merge --config notify.fromauthor=True
163 merging b
165 merging b
164 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
166 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
165 (branch merge, don't forget to commit)
167 (branch merge, don't forget to commit)
166
168
167 $ hg --traceback --cwd b commit -Am "merged"
169 $ hg --traceback --cwd b commit -Am "merged"
168
170
169 push
171 push
170
172
171 $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
173 $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
174 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
172 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
175 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
173 pushing to ../a
176 pushing to ../a
174 searching for changes
177 searching for changes
175 adding changesets
178 adding changesets
176 adding manifests
179 adding manifests
177 adding file changes
180 adding file changes
178 added 4 changesets with 4 changes to 1 files
181 added 4 changesets with 4 changes to 1 files
179 MIME-Version: 1.0
182 MIME-Version: 1.0
180 Content-Type: text/plain; charset="us-ascii"
183 Content-Type: text/plain; charset="us-ascii"
181 Content-Transfer-Encoding: 7bit
184 Content-Transfer-Encoding: 7bit
182 Date: * (glob)
185 Date: * (glob)
183 Subject: * (glob)
186 Subject: * (glob)
184 From: committer_1
187 From: committer_1
185 X-Hg-Notification: changeset 84e487dddc58
188 X-Hg-Notification: changeset 84e487dddc58
186 Message-Id: <*> (glob)
189 Message-Id: <*> (glob)
187 To: baz, foo@bar
190 To: baz, foo@bar
188
191
189 changeset 84e487dddc58 in $TESTTMP/a
192 changeset 84e487dddc58 in $TESTTMP/a
190 details: $TESTTMP/a?cmd=changeset;node=84e487dddc58
193 details: $TESTTMP/a?cmd=changeset;node=84e487dddc58
191 summary: newfile
194 summary: newfile
192
195
193 changeset b29c7a2b6b0c in $TESTTMP/a
196 changeset b29c7a2b6b0c in $TESTTMP/a
194 details: $TESTTMP/a?cmd=changeset;node=b29c7a2b6b0c
197 details: $TESTTMP/a?cmd=changeset;node=b29c7a2b6b0c
195 summary: x
198 summary: x
196
199
197 changeset 0957c7d64886 in $TESTTMP/a
200 changeset 0957c7d64886 in $TESTTMP/a
198 details: $TESTTMP/a?cmd=changeset;node=0957c7d64886
201 details: $TESTTMP/a?cmd=changeset;node=0957c7d64886
199 summary: y
202 summary: y
200
203
201 changeset 485b4e6b0249 in $TESTTMP/a
204 changeset 485b4e6b0249 in $TESTTMP/a
202 details: $TESTTMP/a?cmd=changeset;node=485b4e6b0249
205 details: $TESTTMP/a?cmd=changeset;node=485b4e6b0249
203 summary: merged
206 summary: merged
204
207
205 diffs (7 lines):
208 diffs (7 lines):
206
209
207 diff -r ba677d0156c1 -r 485b4e6b0249 b
210 diff -r ba677d0156c1 -r 485b4e6b0249 b
208 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
211 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
209 +++ b/b Thu Jan 01 00:00:00 1970 +0000
212 +++ b/b Thu Jan 01 00:00:00 1970 +0000
210 @@ -0,0 +1,3 @@
213 @@ -0,0 +1,3 @@
211 +x
214 +x
212 +b
215 +b
213 +y
216 +y
214 $ hg --cwd a rollback
217 $ hg --cwd a rollback
215 repository tip rolled back to revision 1 (undo push)
218 repository tip rolled back to revision 1 (undo push)
216
219
General Comments 0
You need to be logged in to leave comments. Login now