Debian Codegraph @

tests/test-notify-changegroup.t

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