##// END OF EJS Templates
test-push-http: do not clear pid file...
Yuya Nishihara -
r37842:2968ad54 @20 stable
parent child Browse files
Show More
@@ -1,426 +1,426
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 $1 serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
26 > hg $1 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 #if bundle1
73 #if bundle1
74 $ cat >> .hg/hgrc <<EOF
74 $ cat >> .hg/hgrc <<EOF
75 > allow_push = *
75 > allow_push = *
76 > [hooks]
76 > [hooks]
77 > changegroup = sh -c "printenv.py changegroup 0"
77 > changegroup = sh -c "printenv.py changegroup 0"
78 > pushkey = sh -c "printenv.py pushkey 0"
78 > pushkey = sh -c "printenv.py pushkey 0"
79 > txnclose-phase.test = sh $TESTTMP/hook.sh
79 > txnclose-phase.test = sh $TESTTMP/hook.sh
80 > EOF
80 > EOF
81 $ req "--debug --config extensions.blackbox="
81 $ req "--debug --config extensions.blackbox="
82 listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?)
82 listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?)
83 pushing to http://localhost:$HGPORT/
83 pushing to http://localhost:$HGPORT/
84 searching for changes
84 searching for changes
85 remote: redirecting incoming bundle to */hg-unbundle-* (glob)
85 remote: redirecting incoming bundle to */hg-unbundle-* (glob)
86 remote: adding changesets
86 remote: adding changesets
87 remote: add changeset ba677d0156c1
87 remote: add changeset ba677d0156c1
88 remote: adding manifests
88 remote: adding manifests
89 remote: adding file changes
89 remote: adding file changes
90 remote: adding a revisions
90 remote: adding a revisions
91 remote: added 1 changesets with 1 changes to 1 files
91 remote: added 1 changesets with 1 changes to 1 files
92 remote: updating the branch cache
92 remote: updating the branch cache
93 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
93 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
94 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
94 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
95 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
95 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
96 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
96 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
97 remote: running hook changegroup: sh -c "printenv.py changegroup 0"
97 remote: running hook changegroup: sh -c "printenv.py changegroup 0"
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)
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)
99 % serve errors
99 % serve errors
100 $ hg rollback
100 $ hg rollback
101 repository tip rolled back to revision 0 (undo serve)
101 repository tip rolled back to revision 0 (undo serve)
102 $ req "--debug --config server.streamunbundle=True --config extensions.blackbox="
102 $ req "--debug --config server.streamunbundle=True --config extensions.blackbox="
103 listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?)
103 listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?)
104 pushing to http://localhost:$HGPORT/
104 pushing to http://localhost:$HGPORT/
105 searching for changes
105 searching for changes
106 remote: adding changesets
106 remote: adding changesets
107 remote: add changeset ba677d0156c1
107 remote: add changeset ba677d0156c1
108 remote: adding manifests
108 remote: adding manifests
109 remote: adding file changes
109 remote: adding file changes
110 remote: adding a revisions
110 remote: adding a revisions
111 remote: added 1 changesets with 1 changes to 1 files
111 remote: added 1 changesets with 1 changes to 1 files
112 remote: updating the branch cache
112 remote: updating the branch cache
113 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
113 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
114 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
114 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
115 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
115 remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
116 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
116 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
117 remote: running hook changegroup: sh -c "printenv.py changegroup 0"
117 remote: running hook changegroup: sh -c "printenv.py changegroup 0"
118 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)
118 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)
119 % serve errors
119 % serve errors
120 $ hg rollback
120 $ hg rollback
121 repository tip rolled back to revision 0 (undo serve)
121 repository tip rolled back to revision 0 (undo serve)
122 #endif
122 #endif
123
123
124 #if bundle2
124 #if bundle2
125 $ cat >> .hg/hgrc <<EOF
125 $ cat >> .hg/hgrc <<EOF
126 > allow_push = *
126 > allow_push = *
127 > [hooks]
127 > [hooks]
128 > changegroup = sh -c "printenv.py changegroup 0"
128 > changegroup = sh -c "printenv.py changegroup 0"
129 > pushkey = sh -c "printenv.py pushkey 0"
129 > pushkey = sh -c "printenv.py pushkey 0"
130 > txnclose-phase.test = sh $TESTTMP/hook.sh
130 > txnclose-phase.test = sh $TESTTMP/hook.sh
131 > EOF
131 > EOF
132 $ req
132 $ req
133 pushing to http://localhost:$HGPORT/
133 pushing to http://localhost:$HGPORT/
134 searching for changes
134 searching for changes
135 remote: adding changesets
135 remote: adding changesets
136 remote: adding manifests
136 remote: adding manifests
137 remote: adding file changes
137 remote: adding file changes
138 remote: added 1 changesets with 1 changes to 1 files
138 remote: added 1 changesets with 1 changes to 1 files
139 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
139 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
140 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
140 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
141 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)
141 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)
142 % serve errors
142 % serve errors
143 $ hg rollback
143 $ hg rollback
144 repository tip rolled back to revision 0 (undo serve)
144 repository tip rolled back to revision 0 (undo serve)
145 #endif
145 #endif
146
146
147 expect success, server lacks the httpheader capability
147 expect success, server lacks the httpheader capability
148
148
149 $ CAP=httpheader
149 $ CAP=httpheader
150 $ . "$TESTDIR/notcapable"
150 $ . "$TESTDIR/notcapable"
151 $ req
151 $ req
152 pushing to http://localhost:$HGPORT/
152 pushing to http://localhost:$HGPORT/
153 searching for changes
153 searching for changes
154 remote: adding changesets
154 remote: adding changesets
155 remote: adding manifests
155 remote: adding manifests
156 remote: adding file changes
156 remote: adding file changes
157 remote: added 1 changesets with 1 changes to 1 files
157 remote: added 1 changesets with 1 changes to 1 files
158 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
158 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
159 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
159 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
160 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 !)
160 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 !)
161 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 !)
161 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 !)
162 % serve errors
162 % serve errors
163 $ hg rollback
163 $ hg rollback
164 repository tip rolled back to revision 0 (undo serve)
164 repository tip rolled back to revision 0 (undo serve)
165
165
166 expect success, server lacks the unbundlehash capability
166 expect success, server lacks the unbundlehash capability
167
167
168 $ CAP=unbundlehash
168 $ CAP=unbundlehash
169 $ . "$TESTDIR/notcapable"
169 $ . "$TESTDIR/notcapable"
170 $ req
170 $ req
171 pushing to http://localhost:$HGPORT/
171 pushing to http://localhost:$HGPORT/
172 searching for changes
172 searching for changes
173 remote: adding changesets
173 remote: adding changesets
174 remote: adding manifests
174 remote: adding manifests
175 remote: adding file changes
175 remote: adding file changes
176 remote: added 1 changesets with 1 changes to 1 files
176 remote: added 1 changesets with 1 changes to 1 files
177 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
177 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
178 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
178 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
179 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 !)
179 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 !)
180 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 !)
180 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 !)
181 % serve errors
181 % serve errors
182 $ hg rollback
182 $ hg rollback
183 repository tip rolled back to revision 0 (undo serve)
183 repository tip rolled back to revision 0 (undo serve)
184
184
185 expect success, pre-d1b16a746db6 server supports the unbundle capability, but
185 expect success, pre-d1b16a746db6 server supports the unbundle capability, but
186 has no parameter
186 has no parameter
187
187
188 $ cat <<EOF > notcapable-unbundleparam.py
188 $ cat <<EOF > notcapable-unbundleparam.py
189 > from mercurial import extensions, httppeer
189 > from mercurial import extensions, httppeer
190 > def capable(orig, self, name):
190 > def capable(orig, self, name):
191 > if name == 'unbundle':
191 > if name == 'unbundle':
192 > return True
192 > return True
193 > return orig(self, name)
193 > return orig(self, name)
194 > def uisetup(ui):
194 > def uisetup(ui):
195 > extensions.wrapfunction(httppeer.httppeer, 'capable', capable)
195 > extensions.wrapfunction(httppeer.httppeer, 'capable', capable)
196 > EOF
196 > EOF
197 $ cp $HGRCPATH $HGRCPATH.orig
197 $ cp $HGRCPATH $HGRCPATH.orig
198 $ cat <<EOF >> $HGRCPATH
198 $ cat <<EOF >> $HGRCPATH
199 > [extensions]
199 > [extensions]
200 > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py
200 > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py
201 > EOF
201 > EOF
202 $ req
202 $ req
203 pushing to http://localhost:$HGPORT/
203 pushing to http://localhost:$HGPORT/
204 searching for changes
204 searching for changes
205 remote: adding changesets
205 remote: adding changesets
206 remote: adding manifests
206 remote: adding manifests
207 remote: adding file changes
207 remote: adding file changes
208 remote: added 1 changesets with 1 changes to 1 files
208 remote: added 1 changesets with 1 changes to 1 files
209 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
209 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
210 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
210 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
211 remote: changegroup hook: * (glob)
211 remote: changegroup hook: * (glob)
212 % serve errors
212 % serve errors
213 $ hg rollback
213 $ hg rollback
214 repository tip rolled back to revision 0 (undo serve)
214 repository tip rolled back to revision 0 (undo serve)
215 $ mv $HGRCPATH.orig $HGRCPATH
215 $ mv $HGRCPATH.orig $HGRCPATH
216
216
217 Test pushing to a publishing repository with a failing prepushkey hook
217 Test pushing to a publishing repository with a failing prepushkey hook
218
218
219 $ cat > .hg/hgrc <<EOF
219 $ cat > .hg/hgrc <<EOF
220 > [web]
220 > [web]
221 > push_ssl = false
221 > push_ssl = false
222 > allow_push = *
222 > allow_push = *
223 > [hooks]
223 > [hooks]
224 > prepushkey = sh -c "printenv.py prepushkey 1"
224 > prepushkey = sh -c "printenv.py prepushkey 1"
225 > [devel]
225 > [devel]
226 > legacy.exchange=phases
226 > legacy.exchange=phases
227 > EOF
227 > EOF
228
228
229 #if bundle1
229 #if bundle1
230 Bundle1 works because a) phases are updated as part of changegroup application
230 Bundle1 works because a) phases are updated as part of changegroup application
231 and b) client checks phases after the "unbundle" command. Since it sees no
231 and b) client checks phases after the "unbundle" command. Since it sees no
232 phase changes are necessary, it doesn't send the "pushkey" command and the
232 phase changes are necessary, it doesn't send the "pushkey" command and the
233 prepushkey hook never has to fire.
233 prepushkey hook never has to fire.
234
234
235 $ req
235 $ req
236 pushing to http://localhost:$HGPORT/
236 pushing to http://localhost:$HGPORT/
237 searching for changes
237 searching for changes
238 remote: adding changesets
238 remote: adding changesets
239 remote: adding manifests
239 remote: adding manifests
240 remote: adding file changes
240 remote: adding file changes
241 remote: added 1 changesets with 1 changes to 1 files
241 remote: added 1 changesets with 1 changes to 1 files
242 % serve errors
242 % serve errors
243
243
244 #endif
244 #endif
245
245
246 #if bundle2
246 #if bundle2
247 Bundle2 sends a "pushkey" bundle2 part. This runs as part of the transaction
247 Bundle2 sends a "pushkey" bundle2 part. This runs as part of the transaction
248 and fails the entire push.
248 and fails the entire push.
249 $ req
249 $ req
250 pushing to http://localhost:$HGPORT/
250 pushing to http://localhost:$HGPORT/
251 searching for changes
251 searching for changes
252 remote: adding changesets
252 remote: adding changesets
253 remote: adding manifests
253 remote: adding manifests
254 remote: adding file changes
254 remote: adding file changes
255 remote: added 1 changesets with 1 changes to 1 files
255 remote: added 1 changesets with 1 changes to 1 files
256 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)
256 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)
257 remote: pushkey-abort: prepushkey hook exited with status 1
257 remote: pushkey-abort: prepushkey hook exited with status 1
258 remote: transaction abort!
258 remote: transaction abort!
259 remote: rollback completed
259 remote: rollback completed
260 abort: updating ba677d0156c1 to public failed
260 abort: updating ba677d0156c1 to public failed
261 % serve errors
261 % serve errors
262 [255]
262 [255]
263
263
264 #endif
264 #endif
265
265
266 Now remove the failing prepushkey hook.
266 Now remove the failing prepushkey hook.
267
267
268 $ cat >> .hg/hgrc <<EOF
268 $ cat >> .hg/hgrc <<EOF
269 > [hooks]
269 > [hooks]
270 > prepushkey = sh -c "printenv.py prepushkey 0"
270 > prepushkey = sh -c "printenv.py prepushkey 0"
271 > EOF
271 > EOF
272
272
273 We don't need to test bundle1 because it succeeded above.
273 We don't need to test bundle1 because it succeeded above.
274
274
275 #if bundle2
275 #if bundle2
276 $ req
276 $ req
277 pushing to http://localhost:$HGPORT/
277 pushing to http://localhost:$HGPORT/
278 searching for changes
278 searching for changes
279 remote: adding changesets
279 remote: adding changesets
280 remote: adding manifests
280 remote: adding manifests
281 remote: adding file changes
281 remote: adding file changes
282 remote: added 1 changesets with 1 changes to 1 files
282 remote: added 1 changesets with 1 changes to 1 files
283 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)
283 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)
284 % serve errors
284 % serve errors
285 #endif
285 #endif
286
286
287 $ hg --config extensions.strip= strip -r 1:
287 $ hg --config extensions.strip= strip -r 1:
288 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
288 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
289
289
290 Now do a variant of the above, except on a non-publishing repository
290 Now do a variant of the above, except on a non-publishing repository
291
291
292 $ cat >> .hg/hgrc <<EOF
292 $ cat >> .hg/hgrc <<EOF
293 > [phases]
293 > [phases]
294 > publish = false
294 > publish = false
295 > [hooks]
295 > [hooks]
296 > prepushkey = sh -c "printenv.py prepushkey 1"
296 > prepushkey = sh -c "printenv.py prepushkey 1"
297 > EOF
297 > EOF
298
298
299 #if bundle1
299 #if bundle1
300 $ req
300 $ req
301 pushing to http://localhost:$HGPORT/
301 pushing to http://localhost:$HGPORT/
302 searching for changes
302 searching for changes
303 remote: adding changesets
303 remote: adding changesets
304 remote: adding manifests
304 remote: adding manifests
305 remote: adding file changes
305 remote: adding file changes
306 remote: added 1 changesets with 1 changes to 1 files
306 remote: added 1 changesets with 1 changes to 1 files
307 remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
307 remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
308 remote: pushkey-abort: prepushkey hook exited with status 1
308 remote: pushkey-abort: prepushkey hook exited with status 1
309 updating ba677d0156c1 to public failed!
309 updating ba677d0156c1 to public failed!
310 % serve errors
310 % serve errors
311 #endif
311 #endif
312
312
313 #if bundle2
313 #if bundle2
314 $ req
314 $ req
315 pushing to http://localhost:$HGPORT/
315 pushing to http://localhost:$HGPORT/
316 searching for changes
316 searching for changes
317 remote: adding changesets
317 remote: adding changesets
318 remote: adding manifests
318 remote: adding manifests
319 remote: adding file changes
319 remote: adding file changes
320 remote: added 1 changesets with 1 changes to 1 files
320 remote: added 1 changesets with 1 changes to 1 files
321 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)
321 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)
322 remote: pushkey-abort: prepushkey hook exited with status 1
322 remote: pushkey-abort: prepushkey hook exited with status 1
323 remote: transaction abort!
323 remote: transaction abort!
324 remote: rollback completed
324 remote: rollback completed
325 abort: updating ba677d0156c1 to public failed
325 abort: updating ba677d0156c1 to public failed
326 % serve errors
326 % serve errors
327 [255]
327 [255]
328 #endif
328 #endif
329
329
330 Make phases updates work
330 Make phases updates work
331
331
332 $ cat >> .hg/hgrc <<EOF
332 $ cat >> .hg/hgrc <<EOF
333 > [hooks]
333 > [hooks]
334 > prepushkey = sh -c "printenv.py prepushkey 0"
334 > prepushkey = sh -c "printenv.py prepushkey 0"
335 > EOF
335 > EOF
336
336
337 #if bundle1
337 #if bundle1
338 $ req
338 $ req
339 pushing to http://localhost:$HGPORT/
339 pushing to http://localhost:$HGPORT/
340 searching for changes
340 searching for changes
341 no changes found
341 no changes found
342 remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
342 remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
343 % serve errors
343 % serve errors
344 [1]
344 [1]
345 #endif
345 #endif
346
346
347 #if bundle2
347 #if bundle2
348 $ req
348 $ req
349 pushing to http://localhost:$HGPORT/
349 pushing to http://localhost:$HGPORT/
350 searching for changes
350 searching for changes
351 remote: adding changesets
351 remote: adding changesets
352 remote: adding manifests
352 remote: adding manifests
353 remote: adding file changes
353 remote: adding file changes
354 remote: added 1 changesets with 1 changes to 1 files
354 remote: added 1 changesets with 1 changes to 1 files
355 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)
355 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)
356 % serve errors
356 % serve errors
357 #endif
357 #endif
358
358
359 $ hg --config extensions.strip= strip -r 1:
359 $ hg --config extensions.strip= strip -r 1:
360 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
360 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
361
361
362 #if bundle2
362 #if bundle2
363
363
364 $ cat > .hg/hgrc <<EOF
364 $ cat > .hg/hgrc <<EOF
365 > [web]
365 > [web]
366 > push_ssl = false
366 > push_ssl = false
367 > allow_push = *
367 > allow_push = *
368 > [experimental]
368 > [experimental]
369 > httppostargs=true
369 > httppostargs=true
370 > EOF
370 > EOF
371 $ req
371 $ req
372 pushing to http://localhost:$HGPORT/
372 pushing to http://localhost:$HGPORT/
373 searching for changes
373 searching for changes
374 remote: adding changesets
374 remote: adding changesets
375 remote: adding manifests
375 remote: adding manifests
376 remote: adding file changes
376 remote: adding file changes
377 remote: added 1 changesets with 1 changes to 1 files
377 remote: added 1 changesets with 1 changes to 1 files
378 % serve errors
378 % serve errors
379
379
380 #endif
380 #endif
381
381
382 $ cd ..
382 $ cd ..
383
383
384 Pushing via hgwebdir works
384 Pushing via hgwebdir works
385
385
386 $ hg init hgwebdir
386 $ hg init hgwebdir
387 $ cd hgwebdir
387 $ cd hgwebdir
388 $ echo 0 > a
388 $ echo 0 > a
389 $ hg -q commit -A -m initial
389 $ hg -q commit -A -m initial
390 $ cd ..
390 $ cd ..
391
391
392 $ cat > web.conf << EOF
392 $ cat > web.conf << EOF
393 > [paths]
393 > [paths]
394 > / = *
394 > / = *
395 > [web]
395 > [web]
396 > push_ssl = false
396 > push_ssl = false
397 > allow_push = *
397 > allow_push = *
398 > EOF
398 > EOF
399
399
400 $ hg serve --web-conf web.conf -p $HGPORT -d --pid-file hg.pid
400 $ hg serve --web-conf web.conf -p $HGPORT -d --pid-file hg.pid
401 $ cat hg.pid > $DAEMON_PIDS
401 $ cat hg.pid >> $DAEMON_PIDS
402
402
403 $ hg clone http://localhost:$HGPORT/hgwebdir hgwebdir-local
403 $ hg clone http://localhost:$HGPORT/hgwebdir hgwebdir-local
404 requesting all changes
404 requesting all changes
405 adding changesets
405 adding changesets
406 adding manifests
406 adding manifests
407 adding file changes
407 adding file changes
408 added 1 changesets with 1 changes to 1 files
408 added 1 changesets with 1 changes to 1 files
409 new changesets 98a3f8f02ba7
409 new changesets 98a3f8f02ba7
410 updating to branch default
410 updating to branch default
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ cd hgwebdir-local
412 $ cd hgwebdir-local
413 $ echo commit > a
413 $ echo commit > a
414 $ hg commit -m 'local commit'
414 $ hg commit -m 'local commit'
415
415
416 $ hg push
416 $ hg push
417 pushing to http://localhost:$HGPORT/hgwebdir
417 pushing to http://localhost:$HGPORT/hgwebdir
418 searching for changes
418 searching for changes
419 remote: adding changesets
419 remote: adding changesets
420 remote: adding manifests
420 remote: adding manifests
421 remote: adding file changes
421 remote: adding file changes
422 remote: added 1 changesets with 1 changes to 1 files
422 remote: added 1 changesets with 1 changes to 1 files
423
423
424 $ killdaemons.py
424 $ killdaemons.py
425
425
426 $ cd ..
426 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now