Show More
@@ -1,333 +1,333 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | This test is a duplicate of 'test-http.t', feel free to factor out |
|
4 | 4 | parts that are not bundle1/bundle2 specific. |
|
5 | 5 | |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 |
> [ |
|
|
7 | > [devel] | |
|
8 | 8 | > # This test is dedicated to interaction through old bundle |
|
9 | > bundle2-exp = False | |
|
9 | > legacy.exchange = bundle1 | |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ hg init test |
|
13 | 13 | $ cd test |
|
14 | 14 | $ echo foo>foo |
|
15 | 15 | $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg |
|
16 | 16 | $ echo foo>foo.d/foo |
|
17 | 17 | $ echo bar>foo.d/bAr.hg.d/BaR |
|
18 | 18 | $ echo bar>foo.d/baR.d.hg/bAR |
|
19 | 19 | $ hg commit -A -m 1 |
|
20 | 20 | adding foo |
|
21 | 21 | adding foo.d/bAr.hg.d/BaR |
|
22 | 22 | adding foo.d/baR.d.hg/bAR |
|
23 | 23 | adding foo.d/foo |
|
24 | 24 | $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log |
|
25 | 25 | $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid |
|
26 | 26 | |
|
27 | 27 | Test server address cannot be reused |
|
28 | 28 | |
|
29 | 29 | #if windows |
|
30 | 30 | $ hg serve -p $HGPORT1 2>&1 |
|
31 | 31 | abort: cannot start server at ':$HGPORT1': * (glob) |
|
32 | 32 | [255] |
|
33 | 33 | #else |
|
34 | 34 | $ hg serve -p $HGPORT1 2>&1 |
|
35 | 35 | abort: cannot start server at ':$HGPORT1': Address already in use |
|
36 | 36 | [255] |
|
37 | 37 | #endif |
|
38 | 38 | $ cd .. |
|
39 | 39 | $ cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
40 | 40 | |
|
41 | 41 | clone via stream |
|
42 | 42 | |
|
43 | 43 | $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 |
|
44 | 44 | streaming all changes |
|
45 | 45 | 6 files to transfer, 606 bytes of data |
|
46 | 46 | transferred * bytes in * seconds (*/sec) (glob) |
|
47 | 47 | searching for changes |
|
48 | 48 | no changes found |
|
49 | 49 | updating to branch default |
|
50 | 50 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
51 | 51 | $ hg verify -R copy |
|
52 | 52 | checking changesets |
|
53 | 53 | checking manifests |
|
54 | 54 | crosschecking files in changesets and manifests |
|
55 | 55 | checking files |
|
56 | 56 | 4 files, 1 changesets, 4 total revisions |
|
57 | 57 | |
|
58 | 58 | try to clone via stream, should use pull instead |
|
59 | 59 | |
|
60 | 60 | $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 |
|
61 | 61 | requesting all changes |
|
62 | 62 | adding changesets |
|
63 | 63 | adding manifests |
|
64 | 64 | adding file changes |
|
65 | 65 | added 1 changesets with 4 changes to 4 files |
|
66 | 66 | updating to branch default |
|
67 | 67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 68 | |
|
69 | 69 | clone via pull |
|
70 | 70 | |
|
71 | 71 | $ hg clone http://localhost:$HGPORT1/ copy-pull |
|
72 | 72 | requesting all changes |
|
73 | 73 | adding changesets |
|
74 | 74 | adding manifests |
|
75 | 75 | adding file changes |
|
76 | 76 | added 1 changesets with 4 changes to 4 files |
|
77 | 77 | updating to branch default |
|
78 | 78 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 79 | $ hg verify -R copy-pull |
|
80 | 80 | checking changesets |
|
81 | 81 | checking manifests |
|
82 | 82 | crosschecking files in changesets and manifests |
|
83 | 83 | checking files |
|
84 | 84 | 4 files, 1 changesets, 4 total revisions |
|
85 | 85 | $ cd test |
|
86 | 86 | $ echo bar > bar |
|
87 | 87 | $ hg commit -A -d '1 0' -m 2 |
|
88 | 88 | adding bar |
|
89 | 89 | $ cd .. |
|
90 | 90 | |
|
91 | 91 | clone over http with --update |
|
92 | 92 | |
|
93 | 93 | $ hg clone http://localhost:$HGPORT1/ updated --update 0 |
|
94 | 94 | requesting all changes |
|
95 | 95 | adding changesets |
|
96 | 96 | adding manifests |
|
97 | 97 | adding file changes |
|
98 | 98 | added 2 changesets with 5 changes to 5 files |
|
99 | 99 | updating to branch default |
|
100 | 100 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 101 | $ hg log -r . -R updated |
|
102 | 102 | changeset: 0:8b6053c928fe |
|
103 | 103 | user: test |
|
104 | 104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
105 | 105 | summary: 1 |
|
106 | 106 | |
|
107 | 107 | $ rm -rf updated |
|
108 | 108 | |
|
109 | 109 | incoming via HTTP |
|
110 | 110 | |
|
111 | 111 | $ hg clone http://localhost:$HGPORT1/ --rev 0 partial |
|
112 | 112 | adding changesets |
|
113 | 113 | adding manifests |
|
114 | 114 | adding file changes |
|
115 | 115 | added 1 changesets with 4 changes to 4 files |
|
116 | 116 | updating to branch default |
|
117 | 117 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
118 | 118 | $ cd partial |
|
119 | 119 | $ touch LOCAL |
|
120 | 120 | $ hg ci -qAm LOCAL |
|
121 | 121 | $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' |
|
122 | 122 | comparing with http://localhost:$HGPORT1/ |
|
123 | 123 | searching for changes |
|
124 | 124 | 2 |
|
125 | 125 | $ cd .. |
|
126 | 126 | |
|
127 | 127 | pull |
|
128 | 128 | |
|
129 | 129 | $ cd copy-pull |
|
130 | 130 | $ echo '[hooks]' >> .hg/hgrc |
|
131 | 131 | $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc |
|
132 | 132 | $ hg pull |
|
133 | 133 | pulling from http://localhost:$HGPORT1/ |
|
134 | 134 | searching for changes |
|
135 | 135 | adding changesets |
|
136 | 136 | adding manifests |
|
137 | 137 | adding file changes |
|
138 | 138 | added 1 changesets with 1 changes to 1 files |
|
139 | 139 | changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob) |
|
140 | 140 | (run 'hg update' to get a working copy) |
|
141 | 141 | $ cd .. |
|
142 | 142 | |
|
143 | 143 | clone from invalid URL |
|
144 | 144 | |
|
145 | 145 | $ hg clone http://localhost:$HGPORT/bad |
|
146 | 146 | abort: HTTP Error 404: Not Found |
|
147 | 147 | [255] |
|
148 | 148 | |
|
149 | 149 | test http authentication |
|
150 | 150 | + use the same server to test server side streaming preference |
|
151 | 151 | |
|
152 | 152 | $ cd test |
|
153 | 153 | $ cat << EOT > userpass.py |
|
154 | 154 | > import base64 |
|
155 | 155 | > from mercurial.hgweb import common |
|
156 | 156 | > def perform_authentication(hgweb, req, op): |
|
157 | 157 | > auth = req.env.get('HTTP_AUTHORIZATION') |
|
158 | 158 | > if not auth: |
|
159 | 159 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', |
|
160 | 160 | > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) |
|
161 | 161 | > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: |
|
162 | 162 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') |
|
163 | 163 | > def extsetup(): |
|
164 | 164 | > common.permhooks.insert(0, perform_authentication) |
|
165 | 165 | > EOT |
|
166 | 166 | $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ |
|
167 | 167 | > --config server.preferuncompressed=True \ |
|
168 | 168 | > --config web.push_ssl=False --config web.allow_push=* -A ../access.log |
|
169 | 169 | $ cat pid >> $DAEMON_PIDS |
|
170 | 170 | |
|
171 | 171 | $ cat << EOF > get_pass.py |
|
172 | 172 | > import getpass |
|
173 | 173 | > def newgetpass(arg): |
|
174 | 174 | > return "pass" |
|
175 | 175 | > getpass.getpass = newgetpass |
|
176 | 176 | > EOF |
|
177 | 177 | |
|
178 | 178 | $ hg id http://localhost:$HGPORT2/ |
|
179 | 179 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
180 | 180 | [255] |
|
181 | 181 | $ hg id http://localhost:$HGPORT2/ |
|
182 | 182 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
183 | 183 | [255] |
|
184 | 184 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ |
|
185 | 185 | http authorization required for http://localhost:$HGPORT2/ |
|
186 | 186 | realm: mercurial |
|
187 | 187 | user: user |
|
188 | 188 | password: 5fed3813f7f5 |
|
189 | 189 | $ hg id http://user:pass@localhost:$HGPORT2/ |
|
190 | 190 | 5fed3813f7f5 |
|
191 | 191 | $ echo '[auth]' >> .hg/hgrc |
|
192 | 192 | $ echo 'l.schemes=http' >> .hg/hgrc |
|
193 | 193 | $ echo 'l.prefix=lo' >> .hg/hgrc |
|
194 | 194 | $ echo 'l.username=user' >> .hg/hgrc |
|
195 | 195 | $ echo 'l.password=pass' >> .hg/hgrc |
|
196 | 196 | $ hg id http://localhost:$HGPORT2/ |
|
197 | 197 | 5fed3813f7f5 |
|
198 | 198 | $ hg id http://localhost:$HGPORT2/ |
|
199 | 199 | 5fed3813f7f5 |
|
200 | 200 | $ hg id http://user@localhost:$HGPORT2/ |
|
201 | 201 | 5fed3813f7f5 |
|
202 | 202 | $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 |
|
203 | 203 | streaming all changes |
|
204 | 204 | 7 files to transfer, 916 bytes of data |
|
205 | 205 | transferred * bytes in * seconds (*/sec) (glob) |
|
206 | 206 | searching for changes |
|
207 | 207 | no changes found |
|
208 | 208 | updating to branch default |
|
209 | 209 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
210 | 210 | --pull should override server's preferuncompressed |
|
211 | 211 | $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 |
|
212 | 212 | requesting all changes |
|
213 | 213 | adding changesets |
|
214 | 214 | adding manifests |
|
215 | 215 | adding file changes |
|
216 | 216 | added 2 changesets with 5 changes to 5 files |
|
217 | 217 | updating to branch default |
|
218 | 218 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
219 | 219 | |
|
220 | 220 | $ hg id http://user2@localhost:$HGPORT2/ |
|
221 | 221 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
222 | 222 | [255] |
|
223 | 223 | $ hg id http://user:pass2@localhost:$HGPORT2/ |
|
224 | 224 | abort: HTTP Error 403: no |
|
225 | 225 | [255] |
|
226 | 226 | |
|
227 | 227 | $ hg -R dest tag -r tip top |
|
228 | 228 | $ hg -R dest push http://user:pass@localhost:$HGPORT2/ |
|
229 | 229 | pushing to http://user:***@localhost:$HGPORT2/ |
|
230 | 230 | searching for changes |
|
231 | 231 | remote: adding changesets |
|
232 | 232 | remote: adding manifests |
|
233 | 233 | remote: adding file changes |
|
234 | 234 | remote: added 1 changesets with 1 changes to 1 files |
|
235 | 235 | $ hg rollback -q |
|
236 | 236 | |
|
237 | 237 | $ sed 's/.*] "/"/' < ../access.log |
|
238 | 238 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
239 | 239 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
240 | 240 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
241 | 241 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
242 | 242 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
243 | 243 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
244 | 244 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
245 | 245 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
246 | 246 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
247 | 247 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
248 | 248 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
249 | 249 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
250 | 250 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
251 | 251 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
252 | 252 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
253 | 253 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
254 | 254 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
255 | 255 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
256 | 256 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
257 | 257 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
258 | 258 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
259 | 259 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
260 | 260 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
261 | 261 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
262 | 262 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
263 | 263 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
264 | 264 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
265 | 265 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
266 | 266 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
267 | 267 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces |
|
268 | 268 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
269 | 269 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
270 | 270 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
271 | 271 | "GET /?cmd=stream_out HTTP/1.1" 401 - |
|
272 | 272 | "GET /?cmd=stream_out HTTP/1.1" 200 - |
|
273 | 273 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
274 | 274 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d |
|
275 | 275 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
276 | 276 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
277 | 277 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks |
|
278 | 278 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
279 | 279 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D |
|
280 | 280 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d |
|
281 | 281 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
282 | 282 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
283 | 283 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
284 | 284 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
285 | 285 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
286 | 286 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip |
|
287 | 287 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces |
|
288 | 288 | "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces |
|
289 | 289 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
290 | 290 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 |
|
291 | 291 | "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases |
|
292 | 292 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
293 | 293 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
294 | 294 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
295 | 295 | "GET /?cmd=branchmap HTTP/1.1" 200 - |
|
296 | 296 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks |
|
297 | 297 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) |
|
298 | 298 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases |
|
299 | 299 | |
|
300 | 300 | $ cd .. |
|
301 | 301 | |
|
302 | 302 | clone of serve with repo in root and unserved subrepo (issue2970) |
|
303 | 303 | |
|
304 | 304 | $ hg --cwd test init sub |
|
305 | 305 | $ echo empty > test/sub/empty |
|
306 | 306 | $ hg --cwd test/sub add empty |
|
307 | 307 | $ hg --cwd test/sub commit -qm 'add empty' |
|
308 | 308 | $ hg --cwd test/sub tag -r 0 something |
|
309 | 309 | $ echo sub = sub > test/.hgsub |
|
310 | 310 | $ hg --cwd test add .hgsub |
|
311 | 311 | $ hg --cwd test commit -qm 'add subrepo' |
|
312 | 312 | $ hg clone http://localhost:$HGPORT noslash-clone |
|
313 | 313 | requesting all changes |
|
314 | 314 | adding changesets |
|
315 | 315 | adding manifests |
|
316 | 316 | adding file changes |
|
317 | 317 | added 3 changesets with 7 changes to 7 files |
|
318 | 318 | updating to branch default |
|
319 | 319 | abort: HTTP Error 404: Not Found |
|
320 | 320 | [255] |
|
321 | 321 | $ hg clone http://localhost:$HGPORT/ slash-clone |
|
322 | 322 | requesting all changes |
|
323 | 323 | adding changesets |
|
324 | 324 | adding manifests |
|
325 | 325 | adding file changes |
|
326 | 326 | added 3 changesets with 7 changes to 7 files |
|
327 | 327 | updating to branch default |
|
328 | 328 | abort: HTTP Error 404: Not Found |
|
329 | 329 | [255] |
|
330 | 330 | |
|
331 | 331 | check error log |
|
332 | 332 | |
|
333 | 333 | $ cat error.log |
@@ -1,199 +1,199 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | This test checks behavior related to bundle1 that changed or is likely |
|
4 | 4 | to change with bundle2. Feel free to factor out any part of the test |
|
5 | 5 | which does not need to exist to keep bundle1 working. |
|
6 | 6 | |
|
7 | 7 | $ cat << EOF >> $HGRCPATH |
|
8 |
> [ |
|
|
8 | > [devel] | |
|
9 | 9 | > # This test is dedicated to interaction through old bundle |
|
10 | > bundle2-exp = False | |
|
10 | > legacy.exchange = bundle1 | |
|
11 | 11 | > EOF |
|
12 | 12 | |
|
13 | 13 | $ hg init test |
|
14 | 14 | $ cd test |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg ci -Ama |
|
17 | 17 | adding a |
|
18 | 18 | $ cd .. |
|
19 | 19 | $ hg clone test test2 |
|
20 | 20 | updating to branch default |
|
21 | 21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 22 | $ cd test2 |
|
23 | 23 | $ echo a >> a |
|
24 | 24 | $ hg ci -mb |
|
25 | 25 | $ req() { |
|
26 | 26 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
27 | 27 | > cat hg.pid >> $DAEMON_PIDS |
|
28 | 28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
29 | 29 | > exitstatus=$? |
|
30 | 30 | > killdaemons.py |
|
31 | 31 | > echo % serve errors |
|
32 | 32 | > cat errors.log |
|
33 | 33 | > return $exitstatus |
|
34 | 34 | > } |
|
35 | 35 | $ cd ../test |
|
36 | 36 | |
|
37 | 37 | expect ssl error |
|
38 | 38 | |
|
39 | 39 | $ req |
|
40 | 40 | pushing to http://localhost:$HGPORT/ |
|
41 | 41 | searching for changes |
|
42 | 42 | abort: HTTP Error 403: ssl required |
|
43 | 43 | % serve errors |
|
44 | 44 | [255] |
|
45 | 45 | |
|
46 | 46 | expect authorization error |
|
47 | 47 | |
|
48 | 48 | $ echo '[web]' > .hg/hgrc |
|
49 | 49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
50 | 50 | $ req |
|
51 | 51 | pushing to http://localhost:$HGPORT/ |
|
52 | 52 | searching for changes |
|
53 | 53 | abort: authorization failed |
|
54 | 54 | % serve errors |
|
55 | 55 | [255] |
|
56 | 56 | |
|
57 | 57 | expect authorization error: must have authorized user |
|
58 | 58 | |
|
59 | 59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
60 | 60 | $ req |
|
61 | 61 | pushing to http://localhost:$HGPORT/ |
|
62 | 62 | searching for changes |
|
63 | 63 | abort: authorization failed |
|
64 | 64 | % serve errors |
|
65 | 65 | [255] |
|
66 | 66 | |
|
67 | 67 | expect success |
|
68 | 68 | |
|
69 | 69 | $ echo 'allow_push = *' >> .hg/hgrc |
|
70 | 70 | $ echo '[hooks]' >> .hg/hgrc |
|
71 | 71 | $ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc |
|
72 | 72 | $ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc |
|
73 | 73 | $ req |
|
74 | 74 | pushing to http://localhost:$HGPORT/ |
|
75 | 75 | searching for changes |
|
76 | 76 | remote: adding changesets |
|
77 | 77 | remote: adding manifests |
|
78 | 78 | remote: adding file changes |
|
79 | 79 | remote: added 1 changesets with 1 changes to 1 files |
|
80 | 80 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
81 | 81 | % serve errors |
|
82 | 82 | $ hg rollback |
|
83 | 83 | repository tip rolled back to revision 0 (undo serve) |
|
84 | 84 | |
|
85 | 85 | expect success, server lacks the httpheader capability |
|
86 | 86 | |
|
87 | 87 | $ CAP=httpheader |
|
88 | 88 | $ . "$TESTDIR/notcapable" |
|
89 | 89 | $ req |
|
90 | 90 | pushing to http://localhost:$HGPORT/ |
|
91 | 91 | searching for changes |
|
92 | 92 | remote: adding changesets |
|
93 | 93 | remote: adding manifests |
|
94 | 94 | remote: adding file changes |
|
95 | 95 | remote: added 1 changesets with 1 changes to 1 files |
|
96 | 96 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
97 | 97 | % serve errors |
|
98 | 98 | $ hg rollback |
|
99 | 99 | repository tip rolled back to revision 0 (undo serve) |
|
100 | 100 | |
|
101 | 101 | expect success, server lacks the unbundlehash capability |
|
102 | 102 | |
|
103 | 103 | $ CAP=unbundlehash |
|
104 | 104 | $ . "$TESTDIR/notcapable" |
|
105 | 105 | $ req |
|
106 | 106 | pushing to http://localhost:$HGPORT/ |
|
107 | 107 | searching for changes |
|
108 | 108 | remote: adding changesets |
|
109 | 109 | remote: adding manifests |
|
110 | 110 | remote: adding file changes |
|
111 | 111 | remote: added 1 changesets with 1 changes to 1 files |
|
112 | 112 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob) |
|
113 | 113 | % serve errors |
|
114 | 114 | $ hg rollback |
|
115 | 115 | repository tip rolled back to revision 0 (undo serve) |
|
116 | 116 | |
|
117 | 117 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
118 | 118 | has no parameter |
|
119 | 119 | |
|
120 | 120 | $ cat <<EOF > notcapable-unbundleparam.py |
|
121 | 121 | > from mercurial import extensions, httppeer |
|
122 | 122 | > def capable(orig, self, name): |
|
123 | 123 | > if name == 'unbundle': |
|
124 | 124 | > return True |
|
125 | 125 | > return orig(self, name) |
|
126 | 126 | > def uisetup(ui): |
|
127 | 127 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
128 | 128 | > EOF |
|
129 | 129 | $ cp $HGRCPATH $HGRCPATH.orig |
|
130 | 130 | $ cat <<EOF >> $HGRCPATH |
|
131 | 131 | > [extensions] |
|
132 | 132 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
133 | 133 | > EOF |
|
134 | 134 | $ req |
|
135 | 135 | pushing to http://localhost:$HGPORT/ |
|
136 | 136 | searching for changes |
|
137 | 137 | remote: adding changesets |
|
138 | 138 | remote: adding manifests |
|
139 | 139 | remote: adding file changes |
|
140 | 140 | remote: added 1 changesets with 1 changes to 1 files |
|
141 | 141 | remote: changegroup hook: * (glob) |
|
142 | 142 | % serve errors |
|
143 | 143 | $ hg rollback |
|
144 | 144 | repository tip rolled back to revision 0 (undo serve) |
|
145 | 145 | $ mv $HGRCPATH.orig $HGRCPATH |
|
146 | 146 | |
|
147 | 147 | expect push success, phase change failure |
|
148 | 148 | |
|
149 | 149 | $ cat > .hg/hgrc <<EOF |
|
150 | 150 | > [web] |
|
151 | 151 | > push_ssl = false |
|
152 | 152 | > allow_push = * |
|
153 | 153 | > [hooks] |
|
154 | 154 | > prepushkey = printenv.py prepushkey 1 |
|
155 | 155 | > EOF |
|
156 | 156 | $ req |
|
157 | 157 | pushing to http://localhost:$HGPORT/ |
|
158 | 158 | searching for changes |
|
159 | 159 | remote: adding changesets |
|
160 | 160 | remote: adding manifests |
|
161 | 161 | remote: adding file changes |
|
162 | 162 | remote: added 1 changesets with 1 changes to 1 files |
|
163 | 163 | % serve errors |
|
164 | 164 | |
|
165 | 165 | expect phase change success |
|
166 | 166 | |
|
167 | 167 | $ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc |
|
168 | 168 | $ req |
|
169 | 169 | pushing to http://localhost:$HGPORT/ |
|
170 | 170 | searching for changes |
|
171 | 171 | no changes found |
|
172 | 172 | % serve errors |
|
173 | 173 | [1] |
|
174 | 174 | $ hg rollback |
|
175 | 175 | repository tip rolled back to revision 0 (undo serve) |
|
176 | 176 | |
|
177 | 177 | expect authorization error: all users denied |
|
178 | 178 | |
|
179 | 179 | $ echo '[web]' > .hg/hgrc |
|
180 | 180 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
181 | 181 | $ echo 'deny_push = *' >> .hg/hgrc |
|
182 | 182 | $ req |
|
183 | 183 | pushing to http://localhost:$HGPORT/ |
|
184 | 184 | searching for changes |
|
185 | 185 | abort: authorization failed |
|
186 | 186 | % serve errors |
|
187 | 187 | [255] |
|
188 | 188 | |
|
189 | 189 | expect authorization error: some users denied, users must be authenticated |
|
190 | 190 | |
|
191 | 191 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
192 | 192 | $ req |
|
193 | 193 | pushing to http://localhost:$HGPORT/ |
|
194 | 194 | searching for changes |
|
195 | 195 | abort: authorization failed |
|
196 | 196 | % serve errors |
|
197 | 197 | [255] |
|
198 | 198 | |
|
199 | 199 | $ cd .. |
@@ -1,543 +1,543 b'' | |||
|
1 | 1 | This test is a duplicate of 'test-http.t' feel free to factor out |
|
2 | 2 | parts that are not bundle1/bundle2 specific. |
|
3 | 3 | |
|
4 | 4 | $ cat << EOF >> $HGRCPATH |
|
5 |
> [ |
|
|
5 | > [devel] | |
|
6 | 6 | > # This test is dedicated to interaction through old bundle |
|
7 | > bundle2-exp = False | |
|
7 | > legacy.exchange = bundle1 | |
|
8 | 8 | > [format] # temporary settings |
|
9 | 9 | > usegeneraldelta=yes |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | This test tries to exercise the ssh functionality with a dummy script |
|
14 | 14 | |
|
15 | 15 | creating 'remote' repo |
|
16 | 16 | |
|
17 | 17 | $ hg init remote |
|
18 | 18 | $ cd remote |
|
19 | 19 | $ echo this > foo |
|
20 | 20 | $ echo this > fooO |
|
21 | 21 | $ hg ci -A -m "init" foo fooO |
|
22 | 22 | |
|
23 | 23 | insert a closed branch (issue4428) |
|
24 | 24 | |
|
25 | 25 | $ hg up null |
|
26 | 26 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
27 | 27 | $ hg branch closed |
|
28 | 28 | marked working directory as branch closed |
|
29 | 29 | (branches are permanent and global, did you want a bookmark?) |
|
30 | 30 | $ hg ci -mc0 |
|
31 | 31 | $ hg ci --close-branch -mc1 |
|
32 | 32 | $ hg up -q default |
|
33 | 33 | |
|
34 | 34 | configure for serving |
|
35 | 35 | |
|
36 | 36 | $ cat <<EOF > .hg/hgrc |
|
37 | 37 | > [server] |
|
38 | 38 | > uncompressed = True |
|
39 | 39 | > |
|
40 | 40 | > [hooks] |
|
41 | 41 | > changegroup = printenv.py changegroup-in-remote 0 ../dummylog |
|
42 | 42 | > EOF |
|
43 | 43 | $ cd .. |
|
44 | 44 | |
|
45 | 45 | repo not found error |
|
46 | 46 | |
|
47 | 47 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local |
|
48 | 48 | remote: abort: repository nonexistent not found! |
|
49 | 49 | abort: no suitable response from remote hg! |
|
50 | 50 | [255] |
|
51 | 51 | |
|
52 | 52 | non-existent absolute path |
|
53 | 53 | |
|
54 | 54 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local |
|
55 | 55 | remote: abort: repository /$TESTTMP/nonexistent not found! |
|
56 | 56 | abort: no suitable response from remote hg! |
|
57 | 57 | [255] |
|
58 | 58 | |
|
59 | 59 | clone remote via stream |
|
60 | 60 | |
|
61 | 61 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/remote local-stream |
|
62 | 62 | streaming all changes |
|
63 | 63 | 4 files to transfer, 615 bytes of data |
|
64 | 64 | transferred 615 bytes in * seconds (*) (glob) |
|
65 | 65 | searching for changes |
|
66 | 66 | no changes found |
|
67 | 67 | updating to branch default |
|
68 | 68 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 69 | $ cd local-stream |
|
70 | 70 | $ hg verify |
|
71 | 71 | checking changesets |
|
72 | 72 | checking manifests |
|
73 | 73 | crosschecking files in changesets and manifests |
|
74 | 74 | checking files |
|
75 | 75 | 2 files, 3 changesets, 2 total revisions |
|
76 | 76 | $ hg branches |
|
77 | 77 | default 0:1160648e36ce |
|
78 | 78 | $ cd .. |
|
79 | 79 | |
|
80 | 80 | clone bookmarks via stream |
|
81 | 81 | |
|
82 | 82 | $ hg -R local-stream book mybook |
|
83 | 83 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" --uncompressed ssh://user@dummy/local-stream stream2 |
|
84 | 84 | streaming all changes |
|
85 | 85 | 4 files to transfer, 615 bytes of data |
|
86 | 86 | transferred 615 bytes in * seconds (*) (glob) |
|
87 | 87 | searching for changes |
|
88 | 88 | no changes found |
|
89 | 89 | updating to branch default |
|
90 | 90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 91 | $ cd stream2 |
|
92 | 92 | $ hg book |
|
93 | 93 | mybook 0:1160648e36ce |
|
94 | 94 | $ cd .. |
|
95 | 95 | $ rm -rf local-stream stream2 |
|
96 | 96 | |
|
97 | 97 | clone remote via pull |
|
98 | 98 | |
|
99 | 99 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local |
|
100 | 100 | requesting all changes |
|
101 | 101 | adding changesets |
|
102 | 102 | adding manifests |
|
103 | 103 | adding file changes |
|
104 | 104 | added 3 changesets with 2 changes to 2 files |
|
105 | 105 | updating to branch default |
|
106 | 106 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 107 | |
|
108 | 108 | verify |
|
109 | 109 | |
|
110 | 110 | $ cd local |
|
111 | 111 | $ hg verify |
|
112 | 112 | checking changesets |
|
113 | 113 | checking manifests |
|
114 | 114 | crosschecking files in changesets and manifests |
|
115 | 115 | checking files |
|
116 | 116 | 2 files, 3 changesets, 2 total revisions |
|
117 | 117 | $ echo '[hooks]' >> .hg/hgrc |
|
118 | 118 | $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc |
|
119 | 119 | |
|
120 | 120 | empty default pull |
|
121 | 121 | |
|
122 | 122 | $ hg paths |
|
123 | 123 | default = ssh://user@dummy/remote |
|
124 | 124 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" |
|
125 | 125 | pulling from ssh://user@dummy/remote |
|
126 | 126 | searching for changes |
|
127 | 127 | no changes found |
|
128 | 128 | |
|
129 | 129 | pull from wrong ssh URL |
|
130 | 130 | |
|
131 | 131 | $ hg pull -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist |
|
132 | 132 | pulling from ssh://user@dummy/doesnotexist |
|
133 | 133 | remote: abort: repository doesnotexist not found! |
|
134 | 134 | abort: no suitable response from remote hg! |
|
135 | 135 | [255] |
|
136 | 136 | |
|
137 | 137 | local change |
|
138 | 138 | |
|
139 | 139 | $ echo bleah > foo |
|
140 | 140 | $ hg ci -m "add" |
|
141 | 141 | |
|
142 | 142 | updating rc |
|
143 | 143 | |
|
144 | 144 | $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
145 | 145 | $ echo "[ui]" >> .hg/hgrc |
|
146 | 146 | $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc |
|
147 | 147 | |
|
148 | 148 | find outgoing |
|
149 | 149 | |
|
150 | 150 | $ hg out ssh://user@dummy/remote |
|
151 | 151 | comparing with ssh://user@dummy/remote |
|
152 | 152 | searching for changes |
|
153 | 153 | changeset: 3:a28a9d1a809c |
|
154 | 154 | tag: tip |
|
155 | 155 | parent: 0:1160648e36ce |
|
156 | 156 | user: test |
|
157 | 157 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
158 | 158 | summary: add |
|
159 | 159 | |
|
160 | 160 | |
|
161 | 161 | find incoming on the remote side |
|
162 | 162 | |
|
163 | 163 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/local |
|
164 | 164 | comparing with ssh://user@dummy/local |
|
165 | 165 | searching for changes |
|
166 | 166 | changeset: 3:a28a9d1a809c |
|
167 | 167 | tag: tip |
|
168 | 168 | parent: 0:1160648e36ce |
|
169 | 169 | user: test |
|
170 | 170 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
171 | 171 | summary: add |
|
172 | 172 | |
|
173 | 173 | |
|
174 | 174 | find incoming on the remote side (using absolute path) |
|
175 | 175 | |
|
176 | 176 | $ hg incoming -R ../remote -e "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" |
|
177 | 177 | comparing with ssh://user@dummy/$TESTTMP/local |
|
178 | 178 | searching for changes |
|
179 | 179 | changeset: 3:a28a9d1a809c |
|
180 | 180 | tag: tip |
|
181 | 181 | parent: 0:1160648e36ce |
|
182 | 182 | user: test |
|
183 | 183 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
184 | 184 | summary: add |
|
185 | 185 | |
|
186 | 186 | |
|
187 | 187 | push |
|
188 | 188 | |
|
189 | 189 | $ hg push |
|
190 | 190 | pushing to ssh://user@dummy/remote |
|
191 | 191 | searching for changes |
|
192 | 192 | remote: adding changesets |
|
193 | 193 | remote: adding manifests |
|
194 | 194 | remote: adding file changes |
|
195 | 195 | remote: added 1 changesets with 1 changes to 1 files |
|
196 | 196 | $ cd ../remote |
|
197 | 197 | |
|
198 | 198 | check remote tip |
|
199 | 199 | |
|
200 | 200 | $ hg tip |
|
201 | 201 | changeset: 3:a28a9d1a809c |
|
202 | 202 | tag: tip |
|
203 | 203 | parent: 0:1160648e36ce |
|
204 | 204 | user: test |
|
205 | 205 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
206 | 206 | summary: add |
|
207 | 207 | |
|
208 | 208 | $ hg verify |
|
209 | 209 | checking changesets |
|
210 | 210 | checking manifests |
|
211 | 211 | crosschecking files in changesets and manifests |
|
212 | 212 | checking files |
|
213 | 213 | 2 files, 4 changesets, 3 total revisions |
|
214 | 214 | $ hg cat -r tip foo |
|
215 | 215 | bleah |
|
216 | 216 | $ echo z > z |
|
217 | 217 | $ hg ci -A -m z z |
|
218 | 218 | created new head |
|
219 | 219 | |
|
220 | 220 | test pushkeys and bookmarks |
|
221 | 221 | |
|
222 | 222 | $ cd ../local |
|
223 | 223 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces |
|
224 | 224 | bookmarks |
|
225 | 225 | namespaces |
|
226 | 226 | phases |
|
227 | 227 | $ hg book foo -r 0 |
|
228 | 228 | $ hg out -B |
|
229 | 229 | comparing with ssh://user@dummy/remote |
|
230 | 230 | searching for changed bookmarks |
|
231 | 231 | foo 1160648e36ce |
|
232 | 232 | $ hg push -B foo |
|
233 | 233 | pushing to ssh://user@dummy/remote |
|
234 | 234 | searching for changes |
|
235 | 235 | no changes found |
|
236 | 236 | exporting bookmark foo |
|
237 | 237 | [1] |
|
238 | 238 | $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks |
|
239 | 239 | foo 1160648e36cec0054048a7edc4110c6f84fde594 |
|
240 | 240 | $ hg book -f foo |
|
241 | 241 | $ hg push --traceback |
|
242 | 242 | pushing to ssh://user@dummy/remote |
|
243 | 243 | searching for changes |
|
244 | 244 | no changes found |
|
245 | 245 | updating bookmark foo |
|
246 | 246 | [1] |
|
247 | 247 | $ hg book -d foo |
|
248 | 248 | $ hg in -B |
|
249 | 249 | comparing with ssh://user@dummy/remote |
|
250 | 250 | searching for changed bookmarks |
|
251 | 251 | foo a28a9d1a809c |
|
252 | 252 | $ hg book -f -r 0 foo |
|
253 | 253 | $ hg pull -B foo |
|
254 | 254 | pulling from ssh://user@dummy/remote |
|
255 | 255 | no changes found |
|
256 | 256 | updating bookmark foo |
|
257 | 257 | $ hg book -d foo |
|
258 | 258 | $ hg push -B foo |
|
259 | 259 | pushing to ssh://user@dummy/remote |
|
260 | 260 | searching for changes |
|
261 | 261 | no changes found |
|
262 | 262 | deleting remote bookmark foo |
|
263 | 263 | [1] |
|
264 | 264 | |
|
265 | 265 | a bad, evil hook that prints to stdout |
|
266 | 266 | |
|
267 | 267 | $ cat <<EOF > $TESTTMP/badhook |
|
268 | 268 | > import sys |
|
269 | 269 | > sys.stdout.write("KABOOM\n") |
|
270 | 270 | > EOF |
|
271 | 271 | |
|
272 | 272 | $ echo '[hooks]' >> ../remote/.hg/hgrc |
|
273 | 273 | $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc |
|
274 | 274 | $ echo r > r |
|
275 | 275 | $ hg ci -A -m z r |
|
276 | 276 | |
|
277 | 277 | push should succeed even though it has an unexpected response |
|
278 | 278 | |
|
279 | 279 | $ hg push |
|
280 | 280 | pushing to ssh://user@dummy/remote |
|
281 | 281 | searching for changes |
|
282 | 282 | remote has heads on branch 'default' that are not known locally: 6c0482d977a3 |
|
283 | 283 | remote: adding changesets |
|
284 | 284 | remote: adding manifests |
|
285 | 285 | remote: adding file changes |
|
286 | 286 | remote: added 1 changesets with 1 changes to 1 files |
|
287 | 287 | remote: KABOOM |
|
288 | 288 | $ hg -R ../remote heads |
|
289 | 289 | changeset: 5:1383141674ec |
|
290 | 290 | tag: tip |
|
291 | 291 | parent: 3:a28a9d1a809c |
|
292 | 292 | user: test |
|
293 | 293 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
294 | 294 | summary: z |
|
295 | 295 | |
|
296 | 296 | changeset: 4:6c0482d977a3 |
|
297 | 297 | parent: 0:1160648e36ce |
|
298 | 298 | user: test |
|
299 | 299 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
300 | 300 | summary: z |
|
301 | 301 | |
|
302 | 302 | |
|
303 | 303 | clone bookmarks |
|
304 | 304 | |
|
305 | 305 | $ hg -R ../remote bookmark test |
|
306 | 306 | $ hg -R ../remote bookmarks |
|
307 | 307 | * test 4:6c0482d977a3 |
|
308 | 308 | $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks |
|
309 | 309 | requesting all changes |
|
310 | 310 | adding changesets |
|
311 | 311 | adding manifests |
|
312 | 312 | adding file changes |
|
313 | 313 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
314 | 314 | updating to branch default |
|
315 | 315 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
316 | 316 | $ hg -R local-bookmarks bookmarks |
|
317 | 317 | test 4:6c0482d977a3 |
|
318 | 318 | |
|
319 | 319 | passwords in ssh urls are not supported |
|
320 | 320 | (we use a glob here because different Python versions give different |
|
321 | 321 | results here) |
|
322 | 322 | |
|
323 | 323 | $ hg push ssh://user:erroneouspwd@dummy/remote |
|
324 | 324 | pushing to ssh://user:*@dummy/remote (glob) |
|
325 | 325 | abort: password in URL not supported! |
|
326 | 326 | [255] |
|
327 | 327 | |
|
328 | 328 | $ cd .. |
|
329 | 329 | |
|
330 | 330 | hide outer repo |
|
331 | 331 | $ hg init |
|
332 | 332 | |
|
333 | 333 | Test remote paths with spaces (issue2983): |
|
334 | 334 | |
|
335 | 335 | $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
336 | 336 | $ touch "$TESTTMP/a repo/test" |
|
337 | 337 | $ hg -R 'a repo' commit -A -m "test" |
|
338 | 338 | adding test |
|
339 | 339 | $ hg -R 'a repo' tag tag |
|
340 | 340 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
341 | 341 | 73649e48688a |
|
342 | 342 | |
|
343 | 343 | $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" |
|
344 | 344 | abort: unknown revision 'noNoNO'! |
|
345 | 345 | [255] |
|
346 | 346 | |
|
347 | 347 | Test (non-)escaping of remote paths with spaces when cloning (issue3145): |
|
348 | 348 | |
|
349 | 349 | $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" |
|
350 | 350 | destination directory: a repo |
|
351 | 351 | abort: destination 'a repo' is not empty |
|
352 | 352 | [255] |
|
353 | 353 | |
|
354 | 354 | Test hg-ssh using a helper script that will restore PYTHONPATH (which might |
|
355 | 355 | have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right |
|
356 | 356 | parameters: |
|
357 | 357 | |
|
358 | 358 | $ cat > ssh.sh << EOF |
|
359 | 359 | > userhost="\$1" |
|
360 | 360 | > SSH_ORIGINAL_COMMAND="\$2" |
|
361 | 361 | > export SSH_ORIGINAL_COMMAND |
|
362 | 362 | > PYTHONPATH="$PYTHONPATH" |
|
363 | 363 | > export PYTHONPATH |
|
364 | 364 | > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" |
|
365 | 365 | > EOF |
|
366 | 366 | |
|
367 | 367 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" |
|
368 | 368 | 73649e48688a |
|
369 | 369 | |
|
370 | 370 | $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" |
|
371 | 371 | remote: Illegal repository "$TESTTMP/a'repo" (glob) |
|
372 | 372 | abort: no suitable response from remote hg! |
|
373 | 373 | [255] |
|
374 | 374 | |
|
375 | 375 | $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" |
|
376 | 376 | remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" |
|
377 | 377 | abort: no suitable response from remote hg! |
|
378 | 378 | [255] |
|
379 | 379 | |
|
380 | 380 | $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh" |
|
381 | 381 | Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation |
|
382 | 382 | [255] |
|
383 | 383 | |
|
384 | 384 | Test hg-ssh in read-only mode: |
|
385 | 385 | |
|
386 | 386 | $ cat > ssh.sh << EOF |
|
387 | 387 | > userhost="\$1" |
|
388 | 388 | > SSH_ORIGINAL_COMMAND="\$2" |
|
389 | 389 | > export SSH_ORIGINAL_COMMAND |
|
390 | 390 | > PYTHONPATH="$PYTHONPATH" |
|
391 | 391 | > export PYTHONPATH |
|
392 | 392 | > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" |
|
393 | 393 | > EOF |
|
394 | 394 | |
|
395 | 395 | $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local |
|
396 | 396 | requesting all changes |
|
397 | 397 | adding changesets |
|
398 | 398 | adding manifests |
|
399 | 399 | adding file changes |
|
400 | 400 | added 6 changesets with 5 changes to 4 files (+1 heads) |
|
401 | 401 | updating to branch default |
|
402 | 402 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
403 | 403 | |
|
404 | 404 | $ cd read-only-local |
|
405 | 405 | $ echo "baz" > bar |
|
406 | 406 | $ hg ci -A -m "unpushable commit" bar |
|
407 | 407 | $ hg push --ssh "sh ../ssh.sh" |
|
408 | 408 | pushing to ssh://user@dummy/*/remote (glob) |
|
409 | 409 | searching for changes |
|
410 | 410 | remote: Permission denied |
|
411 | 411 | remote: abort: pretxnopen.hg-ssh hook failed |
|
412 | 412 | remote: Permission denied |
|
413 | 413 | remote: pushkey-abort: prepushkey.hg-ssh hook failed |
|
414 | 414 | updating 6c0482d977a3 to public failed! |
|
415 | 415 | [1] |
|
416 | 416 | |
|
417 | 417 | $ cd .. |
|
418 | 418 | |
|
419 | 419 | stderr from remote commands should be printed before stdout from local code (issue4336) |
|
420 | 420 | |
|
421 | 421 | $ hg clone remote stderr-ordering |
|
422 | 422 | updating to branch default |
|
423 | 423 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
424 | 424 | $ cd stderr-ordering |
|
425 | 425 | $ cat >> localwrite.py << EOF |
|
426 | 426 | > from mercurial import exchange, extensions |
|
427 | 427 | > |
|
428 | 428 | > def wrappedpush(orig, repo, *args, **kwargs): |
|
429 | 429 | > res = orig(repo, *args, **kwargs) |
|
430 | 430 | > repo.ui.write('local stdout\n') |
|
431 | 431 | > return res |
|
432 | 432 | > |
|
433 | 433 | > def extsetup(ui): |
|
434 | 434 | > extensions.wrapfunction(exchange, 'push', wrappedpush) |
|
435 | 435 | > EOF |
|
436 | 436 | |
|
437 | 437 | $ cat >> .hg/hgrc << EOF |
|
438 | 438 | > [paths] |
|
439 | 439 | > default-push = ssh://user@dummy/remote |
|
440 | 440 | > [ui] |
|
441 | 441 | > ssh = python "$TESTDIR/dummyssh" |
|
442 | 442 | > [extensions] |
|
443 | 443 | > localwrite = localwrite.py |
|
444 | 444 | > EOF |
|
445 | 445 | |
|
446 | 446 | $ echo localwrite > foo |
|
447 | 447 | $ hg commit -m 'testing localwrite' |
|
448 | 448 | $ hg push |
|
449 | 449 | pushing to ssh://user@dummy/remote |
|
450 | 450 | searching for changes |
|
451 | 451 | remote: adding changesets |
|
452 | 452 | remote: adding manifests |
|
453 | 453 | remote: adding file changes |
|
454 | 454 | remote: added 1 changesets with 1 changes to 1 files |
|
455 | 455 | remote: KABOOM |
|
456 | 456 | local stdout |
|
457 | 457 | |
|
458 | 458 | debug output |
|
459 | 459 | |
|
460 | 460 | $ hg pull --debug ssh://user@dummy/remote |
|
461 | 461 | pulling from ssh://user@dummy/remote |
|
462 | 462 | running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re) |
|
463 | 463 | sending hello command |
|
464 | 464 | sending between command |
|
465 | 465 | remote: 371 |
|
466 | 466 | remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 |
|
467 | 467 | remote: 1 |
|
468 | 468 | preparing listkeys for "bookmarks" |
|
469 | 469 | sending listkeys command |
|
470 | 470 | received listkey for "bookmarks": 45 bytes |
|
471 | 471 | query 1; heads |
|
472 | 472 | sending batch command |
|
473 | 473 | searching for changes |
|
474 | 474 | all remote heads known locally |
|
475 | 475 | no changes found |
|
476 | 476 | preparing listkeys for "phases" |
|
477 | 477 | sending listkeys command |
|
478 | 478 | received listkey for "phases": 15 bytes |
|
479 | 479 | checking for updated bookmarks |
|
480 | 480 | |
|
481 | 481 | $ cd .. |
|
482 | 482 | |
|
483 | 483 | $ cat dummylog |
|
484 | 484 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
485 | 485 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio |
|
486 | 486 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
487 | 487 | Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio |
|
488 | 488 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
489 | 489 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
490 | 490 | Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio |
|
491 | 491 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
492 | 492 | Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
493 | 493 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio |
|
494 | 494 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
495 | 495 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob) |
|
496 | 496 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
497 | 497 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
498 | 498 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
499 | 499 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
500 | 500 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
501 | 501 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
502 | 502 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
503 | 503 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
504 | 504 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
505 | 505 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob) |
|
506 | 506 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
507 | 507 | Got arguments 1:user@dummy 2:hg init 'a repo' |
|
508 | 508 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
509 | 509 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
510 | 510 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
511 | 511 | Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio |
|
512 | 512 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
513 | 513 | changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob) |
|
514 | 514 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
515 | 515 | |
|
516 | 516 | remote hook failure is attributed to remote |
|
517 | 517 | |
|
518 | 518 | $ cat > $TESTTMP/failhook << EOF |
|
519 | 519 | > def hook(ui, repo, **kwargs): |
|
520 | 520 | > ui.write('hook failure!\n') |
|
521 | 521 | > ui.flush() |
|
522 | 522 | > return 1 |
|
523 | 523 | > EOF |
|
524 | 524 | |
|
525 | 525 | $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc |
|
526 | 526 | |
|
527 | 527 | $ hg -q --config ui.ssh="python $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout |
|
528 | 528 | $ cd hookout |
|
529 | 529 | $ touch hookfailure |
|
530 | 530 | $ hg -q commit -A -m 'remote hook failure' |
|
531 | 531 | $ hg --config ui.ssh="python $TESTDIR/dummyssh" push |
|
532 | 532 | pushing to ssh://user@dummy/remote |
|
533 | 533 | searching for changes |
|
534 | 534 | remote: adding changesets |
|
535 | 535 | remote: adding manifests |
|
536 | 536 | remote: adding file changes |
|
537 | 537 | remote: added 1 changesets with 1 changes to 1 files |
|
538 | 538 | remote: hook failure! |
|
539 | 539 | remote: transaction abort! |
|
540 | 540 | remote: rollback completed |
|
541 | 541 | remote: abort: pretxnchangegroup.fail hook failed |
|
542 | 542 | [1] |
|
543 | 543 |
@@ -1,45 +1,45 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | Test wire protocol unbundle with hashed heads (capability: unbundlehash) |
|
4 | 4 | |
|
5 | 5 | $ cat << EOF >> $HGRCPATH |
|
6 |
> [ |
|
|
6 | > [devel] | |
|
7 | 7 | > # This tests is intended for bundle1 only. |
|
8 | 8 | > # bundle2 carries the head information inside the bundle itself and |
|
9 | 9 | > # always uses 'force' as the heads value. |
|
10 | > bundle2-exp = False | |
|
10 | > legacy.exchange = bundle1 | |
|
11 | 11 | > EOF |
|
12 | 12 | |
|
13 | 13 | Create a remote repository. |
|
14 | 14 | |
|
15 | 15 | $ hg init remote |
|
16 | 16 | $ hg serve -R remote --config web.push_ssl=False --config web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log |
|
17 | 17 | $ cat hg1.pid >> $DAEMON_PIDS |
|
18 | 18 | |
|
19 | 19 | Clone the repository and push a change. |
|
20 | 20 | |
|
21 | 21 | $ hg clone http://localhost:$HGPORT/ local |
|
22 | 22 | no changes found |
|
23 | 23 | updating to branch default |
|
24 | 24 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
25 | 25 | $ touch local/README |
|
26 | 26 | $ hg ci -R local -A -m hoge |
|
27 | 27 | adding README |
|
28 | 28 | $ hg push -R local |
|
29 | 29 | pushing to http://localhost:$HGPORT/ |
|
30 | 30 | searching for changes |
|
31 | 31 | remote: adding changesets |
|
32 | 32 | remote: adding manifests |
|
33 | 33 | remote: adding file changes |
|
34 | 34 | remote: added 1 changesets with 1 changes to 1 files |
|
35 | 35 | |
|
36 | 36 | Ensure hashed heads format is used. |
|
37 | 37 | The hash here is always the same since the remote repository only has the null head. |
|
38 | 38 | |
|
39 | 39 | $ cat access.log | grep unbundle |
|
40 | 40 | * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f* (glob) |
|
41 | 41 | |
|
42 | 42 | Explicitly kill daemons to let the test exit on Windows |
|
43 | 43 | |
|
44 | 44 | $ killdaemons.py |
|
45 | 45 |
General Comments 0
You need to be logged in to leave comments.
Login now