Show More
@@ -1,288 +1,352 b'' | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | #testcases bundle1 bundle2 |
|
3 | #testcases bundle1 bundle2 | |
4 |
|
4 | |||
5 | #if bundle1 |
|
5 | #if bundle1 | |
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 | > [devel] |
|
7 | > [devel] | |
8 | > # This test is dedicated to interaction through old bundle |
|
8 | > # This test is dedicated to interaction through old bundle | |
9 | > legacy.exchange = bundle1 |
|
9 | > legacy.exchange = bundle1 | |
10 | > EOF |
|
10 | > EOF | |
11 | #endif |
|
11 | #endif | |
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' |
|
69 | $ cat > $TESTTMP/hook.sh <<'EOF' | |
70 | > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" |
|
70 | > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" | |
71 | > EOF |
|
71 | > EOF | |
72 |
|
72 | |||
73 | $ cat >> .hg/hgrc <<EOF |
|
73 | $ cat >> .hg/hgrc <<EOF | |
74 | > allow_push = * |
|
74 | > allow_push = * | |
75 | > [hooks] |
|
75 | > [hooks] | |
76 | > changegroup = sh -c "printenv.py changegroup 0" |
|
76 | > changegroup = sh -c "printenv.py changegroup 0" | |
77 | > pushkey = sh -c "printenv.py pushkey 0" |
|
77 | > pushkey = sh -c "printenv.py pushkey 0" | |
78 | > txnclose-phase.test = sh $TESTTMP/hook.sh |
|
78 | > txnclose-phase.test = sh $TESTTMP/hook.sh | |
79 | > EOF |
|
79 | > EOF | |
80 | $ req |
|
80 | $ req | |
81 | pushing to http://localhost:$HGPORT/ |
|
81 | pushing to http://localhost:$HGPORT/ | |
82 | searching for changes |
|
82 | searching for changes | |
83 | remote: adding changesets |
|
83 | remote: adding changesets | |
84 | remote: adding manifests |
|
84 | remote: adding manifests | |
85 | remote: adding file changes |
|
85 | remote: adding file changes | |
86 | 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 |
|
87 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
88 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
88 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
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) (bundle1 !) |
|
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) (bundle1 !) | |
90 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) |
|
90 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) | |
91 | % serve errors |
|
91 | % serve errors | |
92 | $ hg rollback |
|
92 | $ hg rollback | |
93 | repository tip rolled back to revision 0 (undo serve) |
|
93 | repository tip rolled back to revision 0 (undo serve) | |
94 |
|
94 | |||
95 | expect success, server lacks the httpheader capability |
|
95 | expect success, server lacks the httpheader capability | |
96 |
|
96 | |||
97 | $ CAP=httpheader |
|
97 | $ CAP=httpheader | |
98 | $ . "$TESTDIR/notcapable" |
|
98 | $ . "$TESTDIR/notcapable" | |
99 | $ req |
|
99 | $ req | |
100 | pushing to http://localhost:$HGPORT/ |
|
100 | pushing to http://localhost:$HGPORT/ | |
101 | searching for changes |
|
101 | searching for changes | |
102 | remote: adding changesets |
|
102 | remote: adding changesets | |
103 | remote: adding manifests |
|
103 | remote: adding manifests | |
104 | remote: adding file changes |
|
104 | remote: adding file changes | |
105 | remote: added 1 changesets with 1 changes to 1 files |
|
105 | remote: added 1 changesets with 1 changes to 1 files | |
106 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
106 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
107 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
107 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
108 | 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) (bundle1 !) |
|
108 | 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) (bundle1 !) | |
109 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) |
|
109 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) | |
110 | % serve errors |
|
110 | % serve errors | |
111 | $ hg rollback |
|
111 | $ hg rollback | |
112 | repository tip rolled back to revision 0 (undo serve) |
|
112 | repository tip rolled back to revision 0 (undo serve) | |
113 |
|
113 | |||
114 | expect success, server lacks the unbundlehash capability |
|
114 | expect success, server lacks the unbundlehash capability | |
115 |
|
115 | |||
116 | $ CAP=unbundlehash |
|
116 | $ CAP=unbundlehash | |
117 | $ . "$TESTDIR/notcapable" |
|
117 | $ . "$TESTDIR/notcapable" | |
118 | $ req |
|
118 | $ req | |
119 | pushing to http://localhost:$HGPORT/ |
|
119 | pushing to http://localhost:$HGPORT/ | |
120 | searching for changes |
|
120 | searching for changes | |
121 | remote: adding changesets |
|
121 | remote: adding changesets | |
122 | remote: adding manifests |
|
122 | remote: adding manifests | |
123 | remote: adding file changes |
|
123 | remote: adding file changes | |
124 | remote: added 1 changesets with 1 changes to 1 files |
|
124 | remote: added 1 changesets with 1 changes to 1 files | |
125 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
125 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
126 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
126 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
127 | 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) (bundle1 !) |
|
127 | 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) (bundle1 !) | |
128 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) |
|
128 | remote: changegroup hook: HG_BUNDLE2=1 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) (bundle2 !) | |
129 | % serve errors |
|
129 | % serve errors | |
130 | $ hg rollback |
|
130 | $ hg rollback | |
131 | repository tip rolled back to revision 0 (undo serve) |
|
131 | repository tip rolled back to revision 0 (undo serve) | |
132 |
|
132 | |||
133 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
133 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but | |
134 | has no parameter |
|
134 | has no parameter | |
135 |
|
135 | |||
136 | $ cat <<EOF > notcapable-unbundleparam.py |
|
136 | $ cat <<EOF > notcapable-unbundleparam.py | |
137 | > from mercurial import extensions, httppeer |
|
137 | > from mercurial import extensions, httppeer | |
138 | > def capable(orig, self, name): |
|
138 | > def capable(orig, self, name): | |
139 | > if name == 'unbundle': |
|
139 | > if name == 'unbundle': | |
140 | > return True |
|
140 | > return True | |
141 | > return orig(self, name) |
|
141 | > return orig(self, name) | |
142 | > def uisetup(ui): |
|
142 | > def uisetup(ui): | |
143 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
143 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) | |
144 | > EOF |
|
144 | > EOF | |
145 | $ cp $HGRCPATH $HGRCPATH.orig |
|
145 | $ cp $HGRCPATH $HGRCPATH.orig | |
146 | $ cat <<EOF >> $HGRCPATH |
|
146 | $ cat <<EOF >> $HGRCPATH | |
147 | > [extensions] |
|
147 | > [extensions] | |
148 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
148 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py | |
149 | > EOF |
|
149 | > EOF | |
150 | $ req |
|
150 | $ req | |
151 | pushing to http://localhost:$HGPORT/ |
|
151 | pushing to http://localhost:$HGPORT/ | |
152 | searching for changes |
|
152 | searching for changes | |
153 | remote: adding changesets |
|
153 | remote: adding changesets | |
154 | remote: adding manifests |
|
154 | remote: adding manifests | |
155 | remote: adding file changes |
|
155 | remote: adding file changes | |
156 | remote: added 1 changesets with 1 changes to 1 files |
|
156 | remote: added 1 changesets with 1 changes to 1 files | |
157 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
157 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public | |
158 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
158 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public | |
159 | remote: changegroup hook: * (glob) |
|
159 | remote: changegroup hook: * (glob) | |
160 | % serve errors |
|
160 | % serve errors | |
161 | $ hg rollback |
|
161 | $ hg rollback | |
162 | repository tip rolled back to revision 0 (undo serve) |
|
162 | repository tip rolled back to revision 0 (undo serve) | |
163 | $ mv $HGRCPATH.orig $HGRCPATH |
|
163 | $ mv $HGRCPATH.orig $HGRCPATH | |
164 |
|
164 | |||
165 | expect push success, phase change failure |
|
165 | Test pushing to a publishing repository with a failing prepushkey hook | |
166 |
|
166 | |||
167 | $ cat > .hg/hgrc <<EOF |
|
167 | $ cat > .hg/hgrc <<EOF | |
168 | > [web] |
|
168 | > [web] | |
169 | > push_ssl = false |
|
169 | > push_ssl = false | |
170 | > allow_push = * |
|
170 | > allow_push = * | |
171 | > [hooks] |
|
171 | > [hooks] | |
172 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
172 | > prepushkey = sh -c "printenv.py prepushkey 1" | |
173 | > [devel] |
|
173 | > [devel] | |
174 | > legacy.exchange=phases |
|
174 | > legacy.exchange=phases | |
175 | > EOF |
|
175 | > EOF | |
176 |
|
176 | |||
177 | #if bundle1 |
|
177 | #if bundle1 | |
|
178 | Bundle1 works because a) phases are updated as part of changegroup application | |||
|
179 | and b) client checks phases after the "unbundle" command. Since it sees no | |||
|
180 | phase changes are necessary, it doesn't send the "pushkey" command and the | |||
|
181 | prepushkey hook never has to fire. | |||
178 |
|
|
182 | ||
179 | $ req |
|
183 | $ req | |
180 | pushing to http://localhost:$HGPORT/ |
|
184 | pushing to http://localhost:$HGPORT/ | |
181 | searching for changes |
|
185 | searching for changes | |
182 | remote: adding changesets |
|
186 | remote: adding changesets | |
183 | remote: adding manifests |
|
187 | remote: adding manifests | |
184 | remote: adding file changes |
|
188 | remote: adding file changes | |
185 | remote: added 1 changesets with 1 changes to 1 files |
|
189 | remote: added 1 changesets with 1 changes to 1 files | |
186 | % serve errors |
|
190 | % serve errors | |
187 |
|
191 | |||
188 |
|
|
192 | #endif | |
189 |
|
|
193 | ||
190 |
|
|
194 | #if bundle2 | |
191 |
|
195 | Bundle2 sends a "pushkey" bundle2 part. This runs as part of the transaction | ||
|
196 | and fails the entire push. | |||
192 | $ req |
|
197 | $ req | |
193 | pushing to http://localhost:$HGPORT/ |
|
198 | pushing to http://localhost:$HGPORT/ | |
194 | searching for changes |
|
199 | searching for changes | |
195 | remote: adding changesets |
|
200 | remote: adding changesets | |
196 | remote: adding manifests |
|
201 | remote: adding manifests | |
197 | remote: adding file changes |
|
202 | remote: adding file changes | |
198 | remote: added 1 changesets with 1 changes to 1 files |
|
203 | remote: added 1 changesets with 1 changes to 1 files | |
199 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
204 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |
200 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
205 | remote: pushkey-abort: prepushkey hook exited with status 1 | |
201 | remote: transaction abort! |
|
206 | remote: transaction abort! | |
202 | remote: rollback completed |
|
207 | remote: rollback completed | |
203 | abort: updating ba677d0156c1 to public failed |
|
208 | abort: updating ba677d0156c1 to public failed | |
204 | % serve errors |
|
209 | % serve errors | |
205 | [255] |
|
210 | [255] | |
206 |
|
211 | |||
207 |
|
|
212 | #endif | |
208 |
|
|
213 | ||
209 | expect phase change success |
|
214 | Now remove the failing prepushkey hook. | |
210 |
|
215 | |||
211 | $ cat >> .hg/hgrc <<EOF |
|
216 | $ cat >> .hg/hgrc <<EOF | |
212 | > [hooks] |
|
217 | > [hooks] | |
213 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
218 | > prepushkey = sh -c "printenv.py prepushkey 0" | |
214 | > [devel] |
|
|||
215 | > legacy.exchange= |
|
|||
216 | > EOF |
|
219 | > EOF | |
217 |
|
220 | |||
218 | #if bundle1 |
|
221 | We don't need to test bundle1 because it succeeded above. | |
219 |
|
|
222 | ||
|
223 | #if bundle2 | |||
220 | $ req |
|
224 | $ req | |
221 | pushing to http://localhost:$HGPORT/ |
|
225 | pushing to http://localhost:$HGPORT/ | |
222 | searching for changes |
|
226 | searching for changes | |
223 | no changes found |
|
227 | remote: adding changesets | |
|
228 | remote: adding manifests | |||
|
229 | remote: adding file changes | |||
|
230 | remote: added 1 changesets with 1 changes to 1 files | |||
|
231 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |||
224 | % serve errors |
|
232 | % serve errors | |
225 | [1] |
|
|||
226 | $ hg rollback |
|
|||
227 | repository tip rolled back to revision 0 (undo serve) |
|
|||
228 |
|
||||
229 |
|
|
233 | #endif | |
230 |
|
|
234 | ||
231 | #if bundle2 |
|
235 | $ hg --config extensions.strip= strip -r 1: | |
|
236 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg | |||
|
237 | ||||
|
238 | Now do a variant of the above, except on a non-publishing repository | |||
232 |
|
|
239 | ||
|
240 | $ cat >> .hg/hgrc <<EOF | |||
|
241 | > [phases] | |||
|
242 | > publish = false | |||
|
243 | > [hooks] | |||
|
244 | > prepushkey = sh -c "printenv.py prepushkey 1" | |||
|
245 | > EOF | |||
|
246 | ||||
|
247 | #if bundle1 | |||
233 | $ req |
|
248 | $ req | |
234 | pushing to http://localhost:$HGPORT/ |
|
249 | pushing to http://localhost:$HGPORT/ | |
235 | searching for changes |
|
250 | searching for changes | |
236 | remote: adding changesets |
|
251 | remote: adding changesets | |
237 | remote: adding manifests |
|
252 | remote: adding manifests | |
238 | remote: adding file changes |
|
253 | remote: adding file changes | |
239 | remote: added 1 changesets with 1 changes to 1 files |
|
254 | remote: added 1 changesets with 1 changes to 1 files | |
|
255 | remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |||
|
256 | remote: pushkey-abort: prepushkey hook exited with status 1 | |||
|
257 | updating ba677d0156c1 to public failed! | |||
240 | % serve errors |
|
258 | % serve errors | |
241 | $ hg rollback |
|
259 | #endif | |
242 | repository tip rolled back to revision 0 (undo serve) |
|
260 | ||
|
261 | #if bundle2 | |||
|
262 | $ req | |||
|
263 | pushing to http://localhost:$HGPORT/ | |||
|
264 | searching for changes | |||
|
265 | remote: adding changesets | |||
|
266 | remote: adding manifests | |||
|
267 | remote: adding file changes | |||
|
268 | remote: added 1 changesets with 1 changes to 1 files | |||
|
269 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |||
|
270 | remote: pushkey-abort: prepushkey hook exited with status 1 | |||
|
271 | remote: transaction abort! | |||
|
272 | remote: rollback completed | |||
|
273 | abort: updating ba677d0156c1 to public failed | |||
|
274 | % serve errors | |||
|
275 | [255] | |||
|
276 | #endif | |||
|
277 | ||||
|
278 | Make phases updates work | |||
243 |
|
279 | |||
|
280 | $ cat >> .hg/hgrc <<EOF | |||
|
281 | > [hooks] | |||
|
282 | > prepushkey = sh -c "printenv.py prepushkey 0" | |||
|
283 | > EOF | |||
|
284 | ||||
|
285 | #if bundle1 | |||
|
286 | $ req | |||
|
287 | pushing to http://localhost:$HGPORT/ | |||
|
288 | searching for changes | |||
|
289 | no changes found | |||
|
290 | remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |||
|
291 | % serve errors | |||
|
292 | [1] | |||
244 | #endif |
|
293 | #endif | |
245 |
|
294 | |||
|
295 | #if bundle2 | |||
|
296 | $ req | |||
|
297 | pushing to http://localhost:$HGPORT/ | |||
|
298 | searching for changes | |||
|
299 | remote: adding changesets | |||
|
300 | remote: adding manifests | |||
|
301 | remote: adding file changes | |||
|
302 | remote: added 1 changesets with 1 changes to 1 files | |||
|
303 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) | |||
|
304 | % serve errors | |||
|
305 | #endif | |||
|
306 | ||||
|
307 | $ hg --config extensions.strip= strip -r 1: | |||
|
308 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg | |||
|
309 | ||||
246 | expect authorization error: all users denied |
|
310 | expect authorization error: all users denied | |
247 |
|
311 | |||
248 | $ echo '[web]' > .hg/hgrc |
|
312 | $ echo '[web]' > .hg/hgrc | |
249 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
313 | $ echo 'push_ssl = false' >> .hg/hgrc | |
250 |
|
|
314 | $ echo 'deny_push = *' >> .hg/hgrc | |
251 | $ req |
|
315 | $ req | |
252 | pushing to http://localhost:$HGPORT/ |
|
316 | pushing to http://localhost:$HGPORT/ | |
253 | searching for changes |
|
317 | searching for changes | |
254 | abort: authorization failed |
|
318 | abort: authorization failed | |
255 | % serve errors |
|
319 | % serve errors | |
256 | [255] |
|
320 | [255] | |
257 |
|
321 | |||
258 | expect authorization error: some users denied, users must be authenticated |
|
322 | expect authorization error: some users denied, users must be authenticated | |
259 |
|
323 | |||
260 |
|
|
324 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
261 | $ req |
|
325 | $ req | |
262 | pushing to http://localhost:$HGPORT/ |
|
326 | pushing to http://localhost:$HGPORT/ | |
263 | searching for changes |
|
327 | searching for changes | |
264 | abort: authorization failed |
|
328 | abort: authorization failed | |
265 | % serve errors |
|
329 | % serve errors | |
266 | [255] |
|
330 | [255] | |
267 |
|
331 | |||
268 |
|
|
332 | #if bundle2 | |
269 |
|
|
333 | ||
270 | $ cat > .hg/hgrc <<EOF |
|
334 | $ cat > .hg/hgrc <<EOF | |
271 | > [web] |
|
335 | > [web] | |
272 | > push_ssl = false |
|
336 | > push_ssl = false | |
273 | > allow_push = * |
|
337 | > allow_push = * | |
274 | > [experimental] |
|
338 | > [experimental] | |
275 | > httppostargs=true |
|
339 | > httppostargs=true | |
276 | > EOF |
|
340 | > EOF | |
277 | $ req |
|
341 | $ req | |
278 | pushing to http://localhost:$HGPORT/ |
|
342 | pushing to http://localhost:$HGPORT/ | |
279 | searching for changes |
|
343 | searching for changes | |
280 | remote: adding changesets |
|
344 | remote: adding changesets | |
281 | remote: adding manifests |
|
345 | remote: adding manifests | |
282 | remote: adding file changes |
|
346 | remote: adding file changes | |
283 | remote: added 1 changesets with 1 changes to 1 files |
|
347 | remote: added 1 changesets with 1 changes to 1 files | |
284 | % serve errors |
|
348 | % serve errors | |
285 |
|
349 | |||
286 | #endif |
|
350 | #endif | |
287 |
|
351 | |||
288 | $ cd .. |
|
352 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now