##// END OF EJS Templates
tests: test that the pid returned by `hg serve` looks reasonable...
Simon Heimberg -
r20426:00f2d293 default
parent child Browse files
Show More
@@ -1,502 +1,511 b''
1 1 $ "$TESTDIR/hghave" killdaemons || exit 80
2 2
3 3 Tests discovery against servers without getbundle support:
4 4
5 5 $ CAP=getbundle
6 6 $ . "$TESTDIR/notcapable"
7 7 $ cat >> $HGRCPATH <<EOF
8 8 > [ui]
9 9 > logtemplate="{rev} {node|short}: {desc} {branches}\n"
10 10 > EOF
11 11
12 12 Setup HTTP server control:
13 13
14 14 $ remote=http://localhost:$HGPORT/
15 15 $ export remote
16 16 $ tstart() {
17 17 > echo '[web]' > $1/.hg/hgrc
18 18 > echo 'push_ssl = false' >> $1/.hg/hgrc
19 19 > echo 'allow_push = *' >> $1/.hg/hgrc
20 20 > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log
21 21 > cat hg.pid >> $DAEMON_PIDS
22 22 > }
23 23 $ tstop() {
24 24 > "$TESTDIR/killdaemons.py" $DAEMON_PIDS
25 25 > }
26 26
27 27 Both are empty:
28 28
29 29 $ hg init empty1
30 30 $ hg init empty2
31 31 $ tstart empty2
32 check if process of pid looks reasonable ('hg' normally, 'python' for run-tests.py -l)
33 #if windows
34 ps of mingw does not support -p, tasklist is on any windows machine since XP
35 $ tasklist //NH //fi "pid eq `cat hg.pid`" | grep ' '
36 (.* )?(hg|python)\.exe( .*)? (re)
37 #else
38 $ ps --no-heading -p `cat hg.pid`
39 (.* )?(hg|python)( .*)? (re)
40 #endif
32 41 $ hg incoming -R empty1 $remote
33 42 comparing with http://localhost:$HGPORT/
34 43 no changes found
35 44 [1]
36 45 $ hg outgoing -R empty1 $remote
37 46 comparing with http://localhost:$HGPORT/
38 47 no changes found
39 48 [1]
40 49 $ hg pull -R empty1 $remote
41 50 pulling from http://localhost:$HGPORT/
42 51 no changes found
43 52 $ hg push -R empty1 $remote
44 53 pushing to http://localhost:$HGPORT/
45 54 no changes found
46 55 [1]
47 56 $ tstop
48 57
49 58 Base repo:
50 59
51 60 $ hg init main
52 61 $ cd main
53 62 $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 <tbase @name2 +4:thead2 @both /thead1 +2:tmaintip'
54 63 $ hg log -G
55 64 o 11 a19bfa7e7328: r11 both
56 65 |
57 66 o 10 8b6bad1512e1: r10 both
58 67 |
59 68 o 9 025829e08038: r9 both
60 69 |\
61 70 | o 8 d8f638ac69e9: r8 name2
62 71 | |
63 72 | o 7 b6b4d315a2ac: r7 name2
64 73 | |
65 74 | o 6 6c6f5d5f3c11: r6 name2
66 75 | |
67 76 | o 5 70314b29987d: r5 name2
68 77 | |
69 78 o | 4 e71dbbc70e03: r4 name1
70 79 | |
71 80 o | 3 2c8d5d5ec612: r3 name1
72 81 | |
73 82 o | 2 a7892891da29: r2 name1
74 83 |/
75 84 o 1 0019a3b924fd: r1
76 85 |
77 86 o 0 d57206cc072a: r0
78 87
79 88 $ cd ..
80 89 $ tstart main
81 90
82 91 Full clone:
83 92
84 93 $ hg clone main full
85 94 updating to branch default
86 95 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 96 $ cd full
88 97 $ hg incoming $remote
89 98 comparing with http://localhost:$HGPORT/
90 99 searching for changes
91 100 no changes found
92 101 [1]
93 102 $ hg outgoing $remote
94 103 comparing with http://localhost:$HGPORT/
95 104 searching for changes
96 105 no changes found
97 106 [1]
98 107 $ hg pull $remote
99 108 pulling from http://localhost:$HGPORT/
100 109 searching for changes
101 110 no changes found
102 111 $ hg push $remote
103 112 pushing to http://localhost:$HGPORT/
104 113 searching for changes
105 114 no changes found
106 115 [1]
107 116 $ cd ..
108 117
109 118 Local is empty:
110 119
111 120 $ cd empty1
112 121 $ hg incoming $remote
113 122 comparing with http://localhost:$HGPORT/
114 123 0 d57206cc072a: r0
115 124 1 0019a3b924fd: r1
116 125 2 a7892891da29: r2 name1
117 126 3 2c8d5d5ec612: r3 name1
118 127 4 e71dbbc70e03: r4 name1
119 128 5 70314b29987d: r5 name2
120 129 6 6c6f5d5f3c11: r6 name2
121 130 7 b6b4d315a2ac: r7 name2
122 131 8 d8f638ac69e9: r8 name2
123 132 9 025829e08038: r9 both
124 133 10 8b6bad1512e1: r10 both
125 134 11 a19bfa7e7328: r11 both
126 135 $ hg outgoing $remote
127 136 comparing with http://localhost:$HGPORT/
128 137 no changes found
129 138 [1]
130 139 $ hg push $remote
131 140 pushing to http://localhost:$HGPORT/
132 141 no changes found
133 142 [1]
134 143 $ hg pull $remote
135 144 pulling from http://localhost:$HGPORT/
136 145 requesting all changes
137 146 adding changesets
138 147 adding manifests
139 148 adding file changes
140 149 added 12 changesets with 24 changes to 2 files
141 150 (run 'hg update' to get a working copy)
142 151 $ hg incoming $remote
143 152 comparing with http://localhost:$HGPORT/
144 153 searching for changes
145 154 no changes found
146 155 [1]
147 156 $ cd ..
148 157
149 158 Local is subset:
150 159
151 160 $ hg clone main subset --rev name2 ; cd subset
152 161 adding changesets
153 162 adding manifests
154 163 adding file changes
155 164 added 6 changesets with 12 changes to 2 files
156 165 updating to branch name2
157 166 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 167 $ hg incoming $remote
159 168 comparing with http://localhost:$HGPORT/
160 169 searching for changes
161 170 6 a7892891da29: r2 name1
162 171 7 2c8d5d5ec612: r3 name1
163 172 8 e71dbbc70e03: r4 name1
164 173 9 025829e08038: r9 both
165 174 10 8b6bad1512e1: r10 both
166 175 11 a19bfa7e7328: r11 both
167 176 $ hg outgoing $remote
168 177 comparing with http://localhost:$HGPORT/
169 178 searching for changes
170 179 no changes found
171 180 [1]
172 181 $ hg push $remote
173 182 pushing to http://localhost:$HGPORT/
174 183 searching for changes
175 184 no changes found
176 185 [1]
177 186 $ hg pull $remote
178 187 pulling from http://localhost:$HGPORT/
179 188 searching for changes
180 189 adding changesets
181 190 adding manifests
182 191 adding file changes
183 192 added 6 changesets with 12 changes to 2 files
184 193 (run 'hg update' to get a working copy)
185 194 $ hg incoming $remote
186 195 comparing with http://localhost:$HGPORT/
187 196 searching for changes
188 197 no changes found
189 198 [1]
190 199 $ cd ..
191 200
192 201 Remote is empty:
193 202
194 203 $ tstop ; tstart empty2
195 204 $ cd main
196 205 $ hg incoming $remote
197 206 comparing with http://localhost:$HGPORT/
198 207 searching for changes
199 208 no changes found
200 209 [1]
201 210 $ hg outgoing $remote
202 211 comparing with http://localhost:$HGPORT/
203 212 searching for changes
204 213 0 d57206cc072a: r0
205 214 1 0019a3b924fd: r1
206 215 2 a7892891da29: r2 name1
207 216 3 2c8d5d5ec612: r3 name1
208 217 4 e71dbbc70e03: r4 name1
209 218 5 70314b29987d: r5 name2
210 219 6 6c6f5d5f3c11: r6 name2
211 220 7 b6b4d315a2ac: r7 name2
212 221 8 d8f638ac69e9: r8 name2
213 222 9 025829e08038: r9 both
214 223 10 8b6bad1512e1: r10 both
215 224 11 a19bfa7e7328: r11 both
216 225 $ hg pull $remote
217 226 pulling from http://localhost:$HGPORT/
218 227 searching for changes
219 228 no changes found
220 229 $ hg push $remote
221 230 pushing to http://localhost:$HGPORT/
222 231 searching for changes
223 232 remote: adding changesets
224 233 remote: adding manifests
225 234 remote: adding file changes
226 235 remote: added 12 changesets with 24 changes to 2 files
227 236 $ hg outgoing $remote
228 237 comparing with http://localhost:$HGPORT/
229 238 searching for changes
230 239 no changes found
231 240 [1]
232 241 $ cd ..
233 242
234 243 Local is superset:
235 244
236 245 $ tstop
237 246 $ hg clone main subset2 --rev name2
238 247 adding changesets
239 248 adding manifests
240 249 adding file changes
241 250 added 6 changesets with 12 changes to 2 files
242 251 updating to branch name2
243 252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 253 $ tstart subset2
245 254 $ cd main
246 255 $ hg incoming $remote
247 256 comparing with http://localhost:$HGPORT/
248 257 searching for changes
249 258 no changes found
250 259 [1]
251 260 $ hg outgoing $remote
252 261 comparing with http://localhost:$HGPORT/
253 262 searching for changes
254 263 2 a7892891da29: r2 name1
255 264 3 2c8d5d5ec612: r3 name1
256 265 4 e71dbbc70e03: r4 name1
257 266 9 025829e08038: r9 both
258 267 10 8b6bad1512e1: r10 both
259 268 11 a19bfa7e7328: r11 both
260 269 $ hg pull $remote
261 270 pulling from http://localhost:$HGPORT/
262 271 searching for changes
263 272 no changes found
264 273 $ hg push $remote
265 274 pushing to http://localhost:$HGPORT/
266 275 searching for changes
267 276 abort: push creates new remote branches: both, name1!
268 277 (use 'hg push --new-branch' to create new remote branches)
269 278 [255]
270 279 $ hg push $remote --new-branch
271 280 pushing to http://localhost:$HGPORT/
272 281 searching for changes
273 282 remote: adding changesets
274 283 remote: adding manifests
275 284 remote: adding file changes
276 285 remote: added 6 changesets with 12 changes to 2 files
277 286 $ hg outgoing $remote
278 287 comparing with http://localhost:$HGPORT/
279 288 searching for changes
280 289 no changes found
281 290 [1]
282 291 $ cd ..
283 292
284 293 Partial pull:
285 294
286 295 $ tstop ; tstart main
287 296 $ hg clone $remote partial --rev name2
288 297 adding changesets
289 298 adding manifests
290 299 adding file changes
291 300 added 6 changesets with 12 changes to 2 files
292 301 updating to branch name2
293 302 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
294 303 $ cd partial
295 304 $ hg incoming $remote
296 305 comparing with http://localhost:$HGPORT/
297 306 searching for changes
298 307 6 a7892891da29: r2 name1
299 308 7 2c8d5d5ec612: r3 name1
300 309 8 e71dbbc70e03: r4 name1
301 310 9 025829e08038: r9 both
302 311 10 8b6bad1512e1: r10 both
303 312 11 a19bfa7e7328: r11 both
304 313 $ hg incoming $remote --rev name1
305 314 comparing with http://localhost:$HGPORT/
306 315 searching for changes
307 316 6 a7892891da29: r2 name1
308 317 7 2c8d5d5ec612: r3 name1
309 318 8 e71dbbc70e03: r4 name1
310 319 $ hg pull $remote --rev name1
311 320 pulling from http://localhost:$HGPORT/
312 321 searching for changes
313 322 adding changesets
314 323 adding manifests
315 324 adding file changes
316 325 added 3 changesets with 6 changes to 2 files (+1 heads)
317 326 (run 'hg heads' to see heads)
318 327 $ hg incoming $remote
319 328 comparing with http://localhost:$HGPORT/
320 329 searching for changes
321 330 9 025829e08038: r9 both
322 331 10 8b6bad1512e1: r10 both
323 332 11 a19bfa7e7328: r11 both
324 333 $ cd ..
325 334
326 335 Both have new stuff in new named branches:
327 336
328 337 $ tstop
329 338 $ hg clone main repo1a --rev name1 -q
330 339 $ hg clone repo1a repo1b -q
331 340 $ hg clone main repo2a --rev name2 -q
332 341 $ hg clone repo2a repo2b -q
333 342 $ tstart repo1a
334 343
335 344 $ cd repo2a
336 345 $ hg incoming $remote
337 346 comparing with http://localhost:$HGPORT/
338 347 searching for changes
339 348 6 a7892891da29: r2 name1
340 349 7 2c8d5d5ec612: r3 name1
341 350 8 e71dbbc70e03: r4 name1
342 351 $ hg outgoing $remote
343 352 comparing with http://localhost:$HGPORT/
344 353 searching for changes
345 354 2 70314b29987d: r5 name2
346 355 3 6c6f5d5f3c11: r6 name2
347 356 4 b6b4d315a2ac: r7 name2
348 357 5 d8f638ac69e9: r8 name2
349 358 $ hg push $remote --new-branch
350 359 pushing to http://localhost:$HGPORT/
351 360 searching for changes
352 361 remote: adding changesets
353 362 remote: adding manifests
354 363 remote: adding file changes
355 364 remote: added 4 changesets with 8 changes to 2 files (+1 heads)
356 365 $ hg pull $remote
357 366 pulling from http://localhost:$HGPORT/
358 367 searching for changes
359 368 adding changesets
360 369 adding manifests
361 370 adding file changes
362 371 added 3 changesets with 6 changes to 2 files (+1 heads)
363 372 (run 'hg heads' to see heads)
364 373 $ hg incoming $remote
365 374 comparing with http://localhost:$HGPORT/
366 375 searching for changes
367 376 no changes found
368 377 [1]
369 378 $ hg outgoing $remote
370 379 comparing with http://localhost:$HGPORT/
371 380 searching for changes
372 381 no changes found
373 382 [1]
374 383 $ cd ..
375 384
376 385 $ tstop ; tstart repo1b
377 386 $ cd repo2b
378 387 $ hg incoming $remote
379 388 comparing with http://localhost:$HGPORT/
380 389 searching for changes
381 390 6 a7892891da29: r2 name1
382 391 7 2c8d5d5ec612: r3 name1
383 392 8 e71dbbc70e03: r4 name1
384 393 $ hg outgoing $remote
385 394 comparing with http://localhost:$HGPORT/
386 395 searching for changes
387 396 2 70314b29987d: r5 name2
388 397 3 6c6f5d5f3c11: r6 name2
389 398 4 b6b4d315a2ac: r7 name2
390 399 5 d8f638ac69e9: r8 name2
391 400 $ hg pull $remote
392 401 pulling from http://localhost:$HGPORT/
393 402 searching for changes
394 403 adding changesets
395 404 adding manifests
396 405 adding file changes
397 406 added 3 changesets with 6 changes to 2 files (+1 heads)
398 407 (run 'hg heads' to see heads)
399 408 $ hg push $remote --new-branch
400 409 pushing to http://localhost:$HGPORT/
401 410 searching for changes
402 411 remote: adding changesets
403 412 remote: adding manifests
404 413 remote: adding file changes
405 414 remote: added 4 changesets with 8 changes to 2 files (+1 heads)
406 415 $ hg incoming $remote
407 416 comparing with http://localhost:$HGPORT/
408 417 searching for changes
409 418 no changes found
410 419 [1]
411 420 $ hg outgoing $remote
412 421 comparing with http://localhost:$HGPORT/
413 422 searching for changes
414 423 no changes found
415 424 [1]
416 425 $ cd ..
417 426
418 427 Both have new stuff in existing named branches:
419 428
420 429 $ tstop
421 430 $ rm -r repo1a repo1b repo2a repo2b
422 431 $ hg clone main repo1a --rev 3 --rev 8 -q
423 432 $ hg clone repo1a repo1b -q
424 433 $ hg clone main repo2a --rev 4 --rev 7 -q
425 434 $ hg clone repo2a repo2b -q
426 435 $ tstart repo1a
427 436
428 437 $ cd repo2a
429 438 $ hg incoming $remote
430 439 comparing with http://localhost:$HGPORT/
431 440 searching for changes
432 441 8 d8f638ac69e9: r8 name2
433 442 $ hg outgoing $remote
434 443 comparing with http://localhost:$HGPORT/
435 444 searching for changes
436 445 4 e71dbbc70e03: r4 name1
437 446 $ hg push $remote --new-branch
438 447 pushing to http://localhost:$HGPORT/
439 448 searching for changes
440 449 remote: adding changesets
441 450 remote: adding manifests
442 451 remote: adding file changes
443 452 remote: added 1 changesets with 2 changes to 2 files
444 453 $ hg pull $remote
445 454 pulling from http://localhost:$HGPORT/
446 455 searching for changes
447 456 adding changesets
448 457 adding manifests
449 458 adding file changes
450 459 added 1 changesets with 2 changes to 2 files
451 460 (run 'hg update' to get a working copy)
452 461 $ hg incoming $remote
453 462 comparing with http://localhost:$HGPORT/
454 463 searching for changes
455 464 no changes found
456 465 [1]
457 466 $ hg outgoing $remote
458 467 comparing with http://localhost:$HGPORT/
459 468 searching for changes
460 469 no changes found
461 470 [1]
462 471 $ cd ..
463 472
464 473 $ tstop ; tstart repo1b
465 474 $ cd repo2b
466 475 $ hg incoming $remote
467 476 comparing with http://localhost:$HGPORT/
468 477 searching for changes
469 478 8 d8f638ac69e9: r8 name2
470 479 $ hg outgoing $remote
471 480 comparing with http://localhost:$HGPORT/
472 481 searching for changes
473 482 4 e71dbbc70e03: r4 name1
474 483 $ hg pull $remote
475 484 pulling from http://localhost:$HGPORT/
476 485 searching for changes
477 486 adding changesets
478 487 adding manifests
479 488 adding file changes
480 489 added 1 changesets with 2 changes to 2 files
481 490 (run 'hg update' to get a working copy)
482 491 $ hg push $remote --new-branch
483 492 pushing to http://localhost:$HGPORT/
484 493 searching for changes
485 494 remote: adding changesets
486 495 remote: adding manifests
487 496 remote: adding file changes
488 497 remote: added 1 changesets with 2 changes to 2 files
489 498 $ hg incoming $remote
490 499 comparing with http://localhost:$HGPORT/
491 500 searching for changes
492 501 no changes found
493 502 [1]
494 503 $ hg outgoing $remote
495 504 comparing with http://localhost:$HGPORT/
496 505 searching for changes
497 506 no changes found
498 507 [1]
499 508 $ cd ..
500 509
501 510 $ tstop
502 511
General Comments 0
You need to be logged in to leave comments. Login now