Show More
@@ -1,203 +1,216 b'' | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | This test checks behavior related to bundle1 that changed or is likely |
|
3 | This test checks behavior related to bundle1 that changed or is likely | |
4 | to change with bundle2. Feel free to factor out any part of the test |
|
4 | to change with bundle2. Feel free to factor out any part of the test | |
5 | which does not need to exist to keep bundle1 working. |
|
5 | which does not need to exist to keep bundle1 working. | |
6 |
|
6 | |||
7 | $ cat << EOF >> $HGRCPATH |
|
7 | $ cat << EOF >> $HGRCPATH | |
8 | > [devel] |
|
8 | > [devel] | |
9 | > # This test is dedicated to interaction through old bundle |
|
9 | > # This test is dedicated to interaction through old bundle | |
10 | > legacy.exchange = bundle1 |
|
10 | > legacy.exchange = bundle1 | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ hg init test |
|
13 | $ hg init test | |
14 | $ cd test |
|
14 | $ cd test | |
15 | $ echo a > a |
|
15 | $ echo a > a | |
16 | $ hg ci -Ama |
|
16 | $ hg ci -Ama | |
17 | adding a |
|
17 | adding a | |
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ hg clone test test2 |
|
19 | $ hg clone test test2 | |
20 | updating to branch default |
|
20 | updating to branch default | |
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | $ cd test2 |
|
22 | $ cd test2 | |
23 | $ echo a >> a |
|
23 | $ echo a >> a | |
24 | $ hg ci -mb |
|
24 | $ hg ci -mb | |
25 | $ req() { |
|
25 | $ req() { | |
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
27 | > cat hg.pid >> $DAEMON_PIDS |
|
27 | > cat hg.pid >> $DAEMON_PIDS | |
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
29 | > exitstatus=$? |
|
29 | > exitstatus=$? | |
30 | > killdaemons.py |
|
30 | > killdaemons.py | |
31 | > echo % serve errors |
|
31 | > echo % serve errors | |
32 | > cat errors.log |
|
32 | > cat errors.log | |
33 | > return $exitstatus |
|
33 | > return $exitstatus | |
34 | > } |
|
34 | > } | |
35 | $ cd ../test |
|
35 | $ cd ../test | |
36 |
|
36 | |||
37 | expect ssl error |
|
37 | expect ssl error | |
38 |
|
38 | |||
39 | $ req |
|
39 | $ req | |
40 | pushing to http://localhost:$HGPORT/ |
|
40 | pushing to http://localhost:$HGPORT/ | |
41 | searching for changes |
|
41 | searching for changes | |
42 | abort: HTTP Error 403: ssl required |
|
42 | abort: HTTP Error 403: ssl required | |
43 | % serve errors |
|
43 | % serve errors | |
44 | [255] |
|
44 | [255] | |
45 |
|
45 | |||
46 | expect authorization error |
|
46 | expect authorization error | |
47 |
|
47 | |||
48 | $ echo '[web]' > .hg/hgrc |
|
48 | $ echo '[web]' > .hg/hgrc | |
49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
49 | $ echo 'push_ssl = false' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect authorization error: must have authorized user |
|
57 | expect authorization error: must have authorized user | |
58 |
|
58 | |||
59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
59 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
60 | $ req |
|
60 | $ req | |
61 | pushing to http://localhost:$HGPORT/ |
|
61 | pushing to http://localhost:$HGPORT/ | |
62 | searching for changes |
|
62 | searching for changes | |
63 | abort: authorization failed |
|
63 | abort: authorization failed | |
64 | % serve errors |
|
64 | % serve errors | |
65 | [255] |
|
65 | [255] | |
66 |
|
66 | |||
67 | expect success |
|
67 | expect success | |
68 |
|
68 | |||
|
69 | $ cat > $TESTTMP/hook.sh <<'EOF' | |||
|
70 | > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" | |||
|
71 | > EOF | |||
|
72 | ||||
69 | $ cat >> .hg/hgrc <<EOF |
|
73 | $ cat >> .hg/hgrc <<EOF | |
70 | > allow_push = * |
|
74 | > allow_push = * | |
71 | > [hooks] |
|
75 | > [hooks] | |
72 | > changegroup = sh -c "printenv.py changegroup 0" |
|
76 | > changegroup = sh -c "printenv.py changegroup 0" | |
73 | > pushkey = sh -c "printenv.py pushkey 0" |
|
77 | > pushkey = sh -c "printenv.py pushkey 0" | |
|
78 | > txnclose-phase.test = sh $TESTTMP/hook.sh | |||
74 | > EOF |
|
79 | > EOF | |
75 | $ req |
|
80 | $ req | |
76 | pushing to http://localhost:$HGPORT/ |
|
81 | pushing to http://localhost:$HGPORT/ | |
77 | searching for changes |
|
82 | searching for changes | |
78 | remote: adding changesets |
|
83 | remote: adding changesets | |
79 | remote: adding manifests |
|
84 | remote: adding manifests | |
80 | remote: adding file changes |
|
85 | remote: adding file changes | |
81 | remote: added 1 changesets with 1 changes to 1 files |
|
86 | remote: added 1 changesets with 1 changes to 1 files | |
|
87 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |||
|
88 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |||
82 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
89 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
83 | % serve errors |
|
90 | % serve errors | |
84 | $ hg rollback |
|
91 | $ hg rollback | |
85 | repository tip rolled back to revision 0 (undo serve) |
|
92 | repository tip rolled back to revision 0 (undo serve) | |
86 |
|
93 | |||
87 | expect success, server lacks the httpheader capability |
|
94 | expect success, server lacks the httpheader capability | |
88 |
|
95 | |||
89 | $ CAP=httpheader |
|
96 | $ CAP=httpheader | |
90 | $ . "$TESTDIR/notcapable" |
|
97 | $ . "$TESTDIR/notcapable" | |
91 | $ req |
|
98 | $ req | |
92 | pushing to http://localhost:$HGPORT/ |
|
99 | pushing to http://localhost:$HGPORT/ | |
93 | searching for changes |
|
100 | searching for changes | |
94 | remote: adding changesets |
|
101 | remote: adding changesets | |
95 | remote: adding manifests |
|
102 | remote: adding manifests | |
96 | remote: adding file changes |
|
103 | remote: adding file changes | |
97 | remote: added 1 changesets with 1 changes to 1 files |
|
104 | remote: added 1 changesets with 1 changes to 1 files | |
|
105 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |||
|
106 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |||
98 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
107 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
99 | % serve errors |
|
108 | % serve errors | |
100 | $ hg rollback |
|
109 | $ hg rollback | |
101 | repository tip rolled back to revision 0 (undo serve) |
|
110 | repository tip rolled back to revision 0 (undo serve) | |
102 |
|
111 | |||
103 | expect success, server lacks the unbundlehash capability |
|
112 | expect success, server lacks the unbundlehash capability | |
104 |
|
113 | |||
105 | $ CAP=unbundlehash |
|
114 | $ CAP=unbundlehash | |
106 | $ . "$TESTDIR/notcapable" |
|
115 | $ . "$TESTDIR/notcapable" | |
107 | $ req |
|
116 | $ req | |
108 | pushing to http://localhost:$HGPORT/ |
|
117 | pushing to http://localhost:$HGPORT/ | |
109 | searching for changes |
|
118 | searching for changes | |
110 | remote: adding changesets |
|
119 | remote: adding changesets | |
111 | remote: adding manifests |
|
120 | remote: adding manifests | |
112 | remote: adding file changes |
|
121 | remote: adding file changes | |
113 | remote: added 1 changesets with 1 changes to 1 files |
|
122 | remote: added 1 changesets with 1 changes to 1 files | |
|
123 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |||
|
124 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |||
114 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
125 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
115 | % serve errors |
|
126 | % serve errors | |
116 | $ hg rollback |
|
127 | $ hg rollback | |
117 | repository tip rolled back to revision 0 (undo serve) |
|
128 | repository tip rolled back to revision 0 (undo serve) | |
118 |
|
129 | |||
119 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
130 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but | |
120 | has no parameter |
|
131 | has no parameter | |
121 |
|
132 | |||
122 | $ cat <<EOF > notcapable-unbundleparam.py |
|
133 | $ cat <<EOF > notcapable-unbundleparam.py | |
123 | > from mercurial import extensions, httppeer |
|
134 | > from mercurial import extensions, httppeer | |
124 | > def capable(orig, self, name): |
|
135 | > def capable(orig, self, name): | |
125 | > if name == 'unbundle': |
|
136 | > if name == 'unbundle': | |
126 | > return True |
|
137 | > return True | |
127 | > return orig(self, name) |
|
138 | > return orig(self, name) | |
128 | > def uisetup(ui): |
|
139 | > def uisetup(ui): | |
129 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
140 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) | |
130 | > EOF |
|
141 | > EOF | |
131 | $ cp $HGRCPATH $HGRCPATH.orig |
|
142 | $ cp $HGRCPATH $HGRCPATH.orig | |
132 | $ cat <<EOF >> $HGRCPATH |
|
143 | $ cat <<EOF >> $HGRCPATH | |
133 | > [extensions] |
|
144 | > [extensions] | |
134 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
145 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py | |
135 | > EOF |
|
146 | > EOF | |
136 | $ req |
|
147 | $ req | |
137 | pushing to http://localhost:$HGPORT/ |
|
148 | pushing to http://localhost:$HGPORT/ | |
138 | searching for changes |
|
149 | searching for changes | |
139 | remote: adding changesets |
|
150 | remote: adding changesets | |
140 | remote: adding manifests |
|
151 | remote: adding manifests | |
141 | remote: adding file changes |
|
152 | remote: adding file changes | |
142 | remote: added 1 changesets with 1 changes to 1 files |
|
153 | remote: added 1 changesets with 1 changes to 1 files | |
|
154 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |||
|
155 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |||
143 | remote: changegroup hook: * (glob) |
|
156 | remote: changegroup hook: * (glob) | |
144 | % serve errors |
|
157 | % serve errors | |
145 | $ hg rollback |
|
158 | $ hg rollback | |
146 | repository tip rolled back to revision 0 (undo serve) |
|
159 | repository tip rolled back to revision 0 (undo serve) | |
147 | $ mv $HGRCPATH.orig $HGRCPATH |
|
160 | $ mv $HGRCPATH.orig $HGRCPATH | |
148 |
|
161 | |||
149 | expect push success, phase change failure |
|
162 | expect push success, phase change failure | |
150 |
|
163 | |||
151 | $ cat > .hg/hgrc <<EOF |
|
164 | $ cat > .hg/hgrc <<EOF | |
152 | > [web] |
|
165 | > [web] | |
153 | > push_ssl = false |
|
166 | > push_ssl = false | |
154 | > allow_push = * |
|
167 | > allow_push = * | |
155 | > [hooks] |
|
168 | > [hooks] | |
156 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
169 | > prepushkey = sh -c "printenv.py prepushkey 1" | |
157 | > EOF |
|
170 | > EOF | |
158 | $ req |
|
171 | $ req | |
159 | pushing to http://localhost:$HGPORT/ |
|
172 | pushing to http://localhost:$HGPORT/ | |
160 | searching for changes |
|
173 | searching for changes | |
161 | remote: adding changesets |
|
174 | remote: adding changesets | |
162 | remote: adding manifests |
|
175 | remote: adding manifests | |
163 | remote: adding file changes |
|
176 | remote: adding file changes | |
164 | remote: added 1 changesets with 1 changes to 1 files |
|
177 | remote: added 1 changesets with 1 changes to 1 files | |
165 | % serve errors |
|
178 | % serve errors | |
166 |
|
179 | |||
167 | expect phase change success |
|
180 | expect phase change success | |
168 |
|
181 | |||
169 | $ cat >> .hg/hgrc <<EOF |
|
182 | $ cat >> .hg/hgrc <<EOF | |
170 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
183 | > prepushkey = sh -c "printenv.py prepushkey 0" | |
171 | > EOF |
|
184 | > EOF | |
172 | $ req |
|
185 | $ req | |
173 | pushing to http://localhost:$HGPORT/ |
|
186 | pushing to http://localhost:$HGPORT/ | |
174 | searching for changes |
|
187 | searching for changes | |
175 | no changes found |
|
188 | no changes found | |
176 | % serve errors |
|
189 | % serve errors | |
177 | [1] |
|
190 | [1] | |
178 | $ hg rollback |
|
191 | $ hg rollback | |
179 | repository tip rolled back to revision 0 (undo serve) |
|
192 | repository tip rolled back to revision 0 (undo serve) | |
180 |
|
193 | |||
181 | expect authorization error: all users denied |
|
194 | expect authorization error: all users denied | |
182 |
|
195 | |||
183 | $ echo '[web]' > .hg/hgrc |
|
196 | $ echo '[web]' > .hg/hgrc | |
184 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
197 | $ echo 'push_ssl = false' >> .hg/hgrc | |
185 | $ echo 'deny_push = *' >> .hg/hgrc |
|
198 | $ echo 'deny_push = *' >> .hg/hgrc | |
186 | $ req |
|
199 | $ req | |
187 | pushing to http://localhost:$HGPORT/ |
|
200 | pushing to http://localhost:$HGPORT/ | |
188 | searching for changes |
|
201 | searching for changes | |
189 | abort: authorization failed |
|
202 | abort: authorization failed | |
190 | % serve errors |
|
203 | % serve errors | |
191 | [255] |
|
204 | [255] | |
192 |
|
205 | |||
193 | expect authorization error: some users denied, users must be authenticated |
|
206 | expect authorization error: some users denied, users must be authenticated | |
194 |
|
207 | |||
195 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
208 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
196 | $ req |
|
209 | $ req | |
197 | pushing to http://localhost:$HGPORT/ |
|
210 | pushing to http://localhost:$HGPORT/ | |
198 | searching for changes |
|
211 | searching for changes | |
199 | abort: authorization failed |
|
212 | abort: authorization failed | |
200 | % serve errors |
|
213 | % serve errors | |
201 | [255] |
|
214 | [255] | |
202 |
|
215 | |||
203 | $ cd .. |
|
216 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now