##// END OF EJS Templates
test: adjust test-push-race.t timeout's to overall test timeout...
marmoute -
r50551:c6f0bcb7 stable
parent child Browse files
Show More
@@ -1,1892 +1,1900 b''
1 1 ============================================================================================
2 2 Test cases where there are race condition between two clients pushing to the same repository
3 3 ============================================================================================
4 4
5 5 This file tests cases where two clients push to a server at the same time. The
6 6 "raced" client is done preparing it push bundle when the "racing" client
7 7 perform its push. The "raced" client starts its actual push after the "racing"
8 8 client push is fully complete.
9 9
10 10 A set of extension and shell functions ensures this scheduling.
11 11
12 12 $ cat >> delaypush.py << EOF
13 13 > """small extension orchestrate push race
14 14 >
15 15 > Client with the extensions will create a file when ready and get stuck until
16 16 > a file is created."""
17 17 >
18 18 > import errno
19 19 > import os
20 20 > import time
21 21 >
22 22 > from mercurial import (
23 23 > exchange,
24 24 > extensions,
25 25 > registrar,
26 26 > )
27 27 >
28 28 > configtable = {}
29 29 > configitem = registrar.configitem(configtable)
30 30 >
31 31 > configitem(b'delaypush', b'ready-path',
32 32 > default=None,
33 33 > )
34 34 > configitem(b'delaypush', b'release-path',
35 35 > default=None,
36 36 > )
37 37 >
38 38 > def delaypush(orig, pushop):
39 39 > # notify we are done preparing
40 40 > ui = pushop.repo.ui
41 41 > readypath = ui.config(b'delaypush', b'ready-path')
42 42 > if readypath is not None:
43 43 > with open(readypath, 'w') as r:
44 44 > r.write('foo')
45 45 > ui.status(b'wrote ready: %s\n' % readypath)
46 46 > # now wait for the other process to be done
47 47 > watchpath = ui.config(b'delaypush', b'release-path')
48 48 > if watchpath is not None:
49 49 > ui.status(b'waiting on: %s\n' % watchpath)
50 50 > limit = 100
51 > test_default_timeout = os.environ.get('HGTEST_TIMEOUT_DEFAULT')
52 > test_timeout = os.environ.get('HGTEST_TIMEOUT')
53 > if (
54 > test_default_timeout is not None
55 > and test_timeout is not None
56 > and test_default_timeout < test_timeout
57 > ):
58 > limit = int(limit * (test_timeout / test_default_timeout))
51 59 > while 0 < limit and not os.path.exists(watchpath):
52 60 > limit -= 1
53 61 > time.sleep(0.1)
54 62 > if limit <= 0:
55 63 > ui.warn(b'exiting without watchfile: %s' % watchpath)
56 64 > else:
57 65 > # delete the file at the end of the push
58 66 > def delete():
59 67 > try:
60 68 > os.unlink(watchpath)
61 69 > except FileNotFoundError:
62 70 > pass
63 71 > ui.atexit(delete)
64 72 > return orig(pushop)
65 73 >
66 74 > def uisetup(ui):
67 75 > extensions.wrapfunction(exchange, b'_pushbundle2', delaypush)
68 76 > EOF
69 77
70 78 $ waiton () {
71 79 > # wait for a file to be created (then delete it)
72 80 > count=100
73 81 > while [ ! -f $1 ] ;
74 82 > do
75 83 > sleep 0.1;
76 84 > count=`expr $count - 1`;
77 85 > if [ $count -lt 0 ];
78 86 > then
79 87 > break
80 88 > fi;
81 89 > done
82 90 > [ -f $1 ] || echo "ready file still missing: $1"
83 91 > rm -f $1
84 92 > }
85 93
86 94 $ release () {
87 95 > # create a file and wait for it be deleted
88 96 > count=100
89 97 > touch $1
90 98 > while [ -f $1 ] ;
91 99 > do
92 100 > sleep 0.1;
93 101 > count=`expr $count - 1`;
94 102 > if [ $count -lt 0 ];
95 103 > then
96 104 > break
97 105 > fi;
98 106 > done
99 107 > [ ! -f $1 ] || echo "delay file still exist: $1"
100 108 > }
101 109
102 110 $ cat >> $HGRCPATH << EOF
103 111 > [ui]
104 112 > # simplify output
105 113 > logtemplate = {node|short} {desc} ({branch})
106 114 > [phases]
107 115 > publish = no
108 116 > [experimental]
109 117 > evolution=true
110 118 > [alias]
111 119 > graph = log -G --rev 'sort(all(), "topo")'
112 120 > EOF
113 121
114 122 We tests multiple cases:
115 123 * strict: no race detected,
116 124 * unrelated: race on unrelated heads are allowed.
117 125
118 126 #testcases strict unrelated
119 127
120 128 #if strict
121 129
122 130 $ cat >> $HGRCPATH << EOF
123 131 > [server]
124 132 > concurrent-push-mode = strict
125 133 > EOF
126 134
127 135 #endif
128 136
129 137 Setup
130 138 -----
131 139
132 140 create a repo with one root
133 141
134 142 $ hg init server
135 143 $ cd server
136 144 $ echo root > root
137 145 $ hg ci -Am "C-ROOT"
138 146 adding root
139 147 $ cd ..
140 148
141 149 clone it in two clients
142 150
143 151 $ hg clone ssh://user@dummy/server client-racy
144 152 requesting all changes
145 153 adding changesets
146 154 adding manifests
147 155 adding file changes
148 156 added 1 changesets with 1 changes to 1 files
149 157 new changesets 842e2fac6304 (1 drafts)
150 158 updating to branch default
151 159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 160 $ hg clone ssh://user@dummy/server client-other
153 161 requesting all changes
154 162 adding changesets
155 163 adding manifests
156 164 adding file changes
157 165 added 1 changesets with 1 changes to 1 files
158 166 new changesets 842e2fac6304 (1 drafts)
159 167 updating to branch default
160 168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 169
162 170 setup one to allow race on push
163 171
164 172 $ cat >> client-racy/.hg/hgrc << EOF
165 173 > [extensions]
166 174 > delaypush = $TESTTMP/delaypush.py
167 175 > [delaypush]
168 176 > ready-path = $TESTTMP/readyfile
169 177 > release-path = $TESTTMP/watchfile
170 178 > EOF
171 179
172 180 Simple race, both try to push to the server at the same time
173 181 ------------------------------------------------------------
174 182
175 183 Both try to replace the same head
176 184
177 185 # a
178 186 # | b
179 187 # |/
180 188 # *
181 189
182 190 Creating changesets
183 191
184 192 $ echo b > client-other/a
185 193 $ hg -R client-other/ add client-other/a
186 194 $ hg -R client-other/ commit -m "C-A"
187 195 $ echo b > client-racy/b
188 196 $ hg -R client-racy/ add client-racy/b
189 197 $ hg -R client-racy/ commit -m "C-B"
190 198
191 199 Pushing
192 200
193 201 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
194 202
195 203 $ waiton $TESTTMP/readyfile
196 204
197 205 $ hg -R client-other push -r 'tip'
198 206 pushing to ssh://user@dummy/server
199 207 searching for changes
200 208 remote: adding changesets
201 209 remote: adding manifests
202 210 remote: adding file changes
203 211 remote: added 1 changesets with 1 changes to 1 files
204 212
205 213 $ release $TESTTMP/watchfile
206 214
207 215 Check the result of the push
208 216
209 217 $ cat ./push-log
210 218 pushing to ssh://user@dummy/server
211 219 searching for changes
212 220 wrote ready: $TESTTMP/readyfile
213 221 waiting on: $TESTTMP/watchfile
214 222 abort: push failed:
215 223 'remote repository changed while pushing - please try again'
216 224
217 225 $ hg -R server graph
218 226 o 98217d5a1659 C-A (default)
219 227 |
220 228 @ 842e2fac6304 C-ROOT (default)
221 229
222 230
223 231 Pushing on two different heads
224 232 ------------------------------
225 233
226 234 Both try to replace a different head
227 235
228 236 # a b
229 237 # | |
230 238 # * *
231 239 # |/
232 240 # *
233 241
234 242 (resync-all)
235 243
236 244 $ hg -R ./server pull ./client-racy
237 245 pulling from ./client-racy
238 246 searching for changes
239 247 adding changesets
240 248 adding manifests
241 249 adding file changes
242 250 added 1 changesets with 1 changes to 1 files (+1 heads)
243 251 new changesets a9149a1428e2 (1 drafts)
244 252 (run 'hg heads' to see heads, 'hg merge' to merge)
245 253 $ hg -R ./client-other pull
246 254 pulling from ssh://user@dummy/server
247 255 searching for changes
248 256 adding changesets
249 257 adding manifests
250 258 adding file changes
251 259 added 1 changesets with 1 changes to 1 files (+1 heads)
252 260 new changesets a9149a1428e2 (1 drafts)
253 261 (run 'hg heads' to see heads, 'hg merge' to merge)
254 262 $ hg -R ./client-racy pull
255 263 pulling from ssh://user@dummy/server
256 264 searching for changes
257 265 adding changesets
258 266 adding manifests
259 267 adding file changes
260 268 added 1 changesets with 1 changes to 1 files (+1 heads)
261 269 new changesets 98217d5a1659 (1 drafts)
262 270 (run 'hg heads' to see heads, 'hg merge' to merge)
263 271
264 272 $ hg -R server graph
265 273 o a9149a1428e2 C-B (default)
266 274 |
267 275 | o 98217d5a1659 C-A (default)
268 276 |/
269 277 @ 842e2fac6304 C-ROOT (default)
270 278
271 279
272 280 Creating changesets
273 281
274 282 $ echo aa >> client-other/a
275 283 $ hg -R client-other/ commit -m "C-C"
276 284 $ echo bb >> client-racy/b
277 285 $ hg -R client-racy/ commit -m "C-D"
278 286
279 287 Pushing
280 288
281 289 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
282 290
283 291 $ waiton $TESTTMP/readyfile
284 292
285 293 $ hg -R client-other push -r 'tip'
286 294 pushing to ssh://user@dummy/server
287 295 searching for changes
288 296 remote: adding changesets
289 297 remote: adding manifests
290 298 remote: adding file changes
291 299 remote: added 1 changesets with 1 changes to 1 files
292 300
293 301 $ release $TESTTMP/watchfile
294 302
295 303 Check the result of the push
296 304
297 305 #if strict
298 306 $ cat ./push-log
299 307 pushing to ssh://user@dummy/server
300 308 searching for changes
301 309 wrote ready: $TESTTMP/readyfile
302 310 waiting on: $TESTTMP/watchfile
303 311 abort: push failed:
304 312 'remote repository changed while pushing - please try again'
305 313
306 314 $ hg -R server graph
307 315 o 51c544a58128 C-C (default)
308 316 |
309 317 o 98217d5a1659 C-A (default)
310 318 |
311 319 | o a9149a1428e2 C-B (default)
312 320 |/
313 321 @ 842e2fac6304 C-ROOT (default)
314 322
315 323 #endif
316 324 #if unrelated
317 325
318 326 (The two heads are unrelated, push should be allowed)
319 327
320 328 $ cat ./push-log
321 329 pushing to ssh://user@dummy/server
322 330 searching for changes
323 331 wrote ready: $TESTTMP/readyfile
324 332 waiting on: $TESTTMP/watchfile
325 333 remote: adding changesets
326 334 remote: adding manifests
327 335 remote: adding file changes
328 336 remote: added 1 changesets with 1 changes to 1 files
329 337
330 338 $ hg -R server graph
331 339 o 59e76faf78bd C-D (default)
332 340 |
333 341 o a9149a1428e2 C-B (default)
334 342 |
335 343 | o 51c544a58128 C-C (default)
336 344 | |
337 345 | o 98217d5a1659 C-A (default)
338 346 |/
339 347 @ 842e2fac6304 C-ROOT (default)
340 348
341 349 #endif
342 350
343 351 Pushing while someone creates a new head
344 352 -----------------------------------------
345 353
346 354 Pushing a new changeset while someone creates a new branch.
347 355
348 356 # a (raced)
349 357 # |
350 358 # * b
351 359 # |/
352 360 # *
353 361
354 362 (resync-all)
355 363
356 364 #if strict
357 365
358 366 $ hg -R ./server pull ./client-racy
359 367 pulling from ./client-racy
360 368 searching for changes
361 369 adding changesets
362 370 adding manifests
363 371 adding file changes
364 372 added 1 changesets with 1 changes to 1 files
365 373 new changesets 59e76faf78bd (1 drafts)
366 374 (run 'hg update' to get a working copy)
367 375
368 376 #endif
369 377 #if unrelated
370 378
371 379 $ hg -R ./server pull ./client-racy
372 380 pulling from ./client-racy
373 381 searching for changes
374 382 no changes found
375 383
376 384 #endif
377 385
378 386 $ hg -R ./client-other pull
379 387 pulling from ssh://user@dummy/server
380 388 searching for changes
381 389 adding changesets
382 390 adding manifests
383 391 adding file changes
384 392 added 1 changesets with 1 changes to 1 files
385 393 new changesets 59e76faf78bd (1 drafts)
386 394 (run 'hg update' to get a working copy)
387 395 $ hg -R ./client-racy pull
388 396 pulling from ssh://user@dummy/server
389 397 searching for changes
390 398 adding changesets
391 399 adding manifests
392 400 adding file changes
393 401 added 1 changesets with 1 changes to 1 files
394 402 new changesets 51c544a58128 (1 drafts)
395 403 (run 'hg update' to get a working copy)
396 404
397 405 $ hg -R server graph
398 406 o 59e76faf78bd C-D (default)
399 407 |
400 408 o a9149a1428e2 C-B (default)
401 409 |
402 410 | o 51c544a58128 C-C (default)
403 411 | |
404 412 | o 98217d5a1659 C-A (default)
405 413 |/
406 414 @ 842e2fac6304 C-ROOT (default)
407 415
408 416
409 417 Creating changesets
410 418
411 419 (new head)
412 420
413 421 $ hg -R client-other/ up 'desc("C-A")'
414 422 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 423 $ echo aaa >> client-other/a
416 424 $ hg -R client-other/ commit -m "C-E"
417 425 created new head
418 426
419 427 (children of existing head)
420 428
421 429 $ hg -R client-racy/ up 'desc("C-C")'
422 430 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 431 $ echo bbb >> client-racy/a
424 432 $ hg -R client-racy/ commit -m "C-F"
425 433
426 434 Pushing
427 435
428 436 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
429 437
430 438 $ waiton $TESTTMP/readyfile
431 439
432 440 $ hg -R client-other push -fr 'tip'
433 441 pushing to ssh://user@dummy/server
434 442 searching for changes
435 443 remote: adding changesets
436 444 remote: adding manifests
437 445 remote: adding file changes
438 446 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
439 447
440 448 $ release $TESTTMP/watchfile
441 449
442 450 Check the result of the push
443 451
444 452 #if strict
445 453
446 454 $ cat ./push-log
447 455 pushing to ssh://user@dummy/server
448 456 searching for changes
449 457 wrote ready: $TESTTMP/readyfile
450 458 waiting on: $TESTTMP/watchfile
451 459 abort: push failed:
452 460 'remote repository changed while pushing - please try again'
453 461
454 462 $ hg -R server graph
455 463 o d603e2c0cdd7 C-E (default)
456 464 |
457 465 | o 51c544a58128 C-C (default)
458 466 |/
459 467 o 98217d5a1659 C-A (default)
460 468 |
461 469 | o 59e76faf78bd C-D (default)
462 470 | |
463 471 | o a9149a1428e2 C-B (default)
464 472 |/
465 473 @ 842e2fac6304 C-ROOT (default)
466 474
467 475
468 476 #endif
469 477
470 478 #if unrelated
471 479
472 480 (The racing new head do not affect existing heads, push should go through)
473 481
474 482 $ cat ./push-log
475 483 pushing to ssh://user@dummy/server
476 484 searching for changes
477 485 wrote ready: $TESTTMP/readyfile
478 486 waiting on: $TESTTMP/watchfile
479 487 remote: adding changesets
480 488 remote: adding manifests
481 489 remote: adding file changes
482 490 remote: added 1 changesets with 1 changes to 1 files
483 491
484 492 $ hg -R server graph
485 493 o d9e379a8c432 C-F (default)
486 494 |
487 495 o 51c544a58128 C-C (default)
488 496 |
489 497 | o d603e2c0cdd7 C-E (default)
490 498 |/
491 499 o 98217d5a1659 C-A (default)
492 500 |
493 501 | o 59e76faf78bd C-D (default)
494 502 | |
495 503 | o a9149a1428e2 C-B (default)
496 504 |/
497 505 @ 842e2fac6304 C-ROOT (default)
498 506
499 507 #endif
500 508
501 509 Pushing touching different named branch (same topo): new branch raced
502 510 ---------------------------------------------------------------------
503 511
504 512 Pushing two children on the same head, one is a different named branch
505 513
506 514 # a (raced, branch-a)
507 515 # |
508 516 # | b (default branch)
509 517 # |/
510 518 # *
511 519
512 520 (resync-all)
513 521
514 522 #if strict
515 523
516 524 $ hg -R ./server pull ./client-racy
517 525 pulling from ./client-racy
518 526 searching for changes
519 527 adding changesets
520 528 adding manifests
521 529 adding file changes
522 530 added 1 changesets with 1 changes to 1 files
523 531 new changesets d9e379a8c432 (1 drafts)
524 532 (run 'hg update' to get a working copy)
525 533
526 534 #endif
527 535 #if unrelated
528 536
529 537 $ hg -R ./server pull ./client-racy
530 538 pulling from ./client-racy
531 539 searching for changes
532 540 no changes found
533 541
534 542 #endif
535 543
536 544 $ hg -R ./client-other pull
537 545 pulling from ssh://user@dummy/server
538 546 searching for changes
539 547 adding changesets
540 548 adding manifests
541 549 adding file changes
542 550 added 1 changesets with 1 changes to 1 files
543 551 new changesets d9e379a8c432 (1 drafts)
544 552 (run 'hg update' to get a working copy)
545 553 $ hg -R ./client-racy pull
546 554 pulling from ssh://user@dummy/server
547 555 searching for changes
548 556 adding changesets
549 557 adding manifests
550 558 adding file changes
551 559 added 1 changesets with 1 changes to 1 files (+1 heads)
552 560 new changesets d603e2c0cdd7 (1 drafts)
553 561 (run 'hg heads .' to see heads, 'hg merge' to merge)
554 562
555 563 $ hg -R server graph
556 564 o d9e379a8c432 C-F (default)
557 565 |
558 566 o 51c544a58128 C-C (default)
559 567 |
560 568 | o d603e2c0cdd7 C-E (default)
561 569 |/
562 570 o 98217d5a1659 C-A (default)
563 571 |
564 572 | o 59e76faf78bd C-D (default)
565 573 | |
566 574 | o a9149a1428e2 C-B (default)
567 575 |/
568 576 @ 842e2fac6304 C-ROOT (default)
569 577
570 578
571 579 Creating changesets
572 580
573 581 (update existing head)
574 582
575 583 $ hg -R client-other/ up 'desc("C-F")'
576 584 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
577 585 $ echo aaa >> client-other/a
578 586 $ hg -R client-other/ commit -m "C-G"
579 587
580 588 (new named branch from that existing head)
581 589
582 590 $ hg -R client-racy/ up 'desc("C-F")'
583 591 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 592 $ echo bbb >> client-racy/a
585 593 $ hg -R client-racy/ branch my-first-test-branch
586 594 marked working directory as branch my-first-test-branch
587 595 (branches are permanent and global, did you want a bookmark?)
588 596 $ hg -R client-racy/ commit -m "C-H"
589 597
590 598 Pushing
591 599
592 600 $ hg -R client-racy push -r 'tip' --new-branch > ./push-log 2>&1 &
593 601
594 602 $ waiton $TESTTMP/readyfile
595 603
596 604 $ hg -R client-other push -fr 'tip'
597 605 pushing to ssh://user@dummy/server
598 606 searching for changes
599 607 remote: adding changesets
600 608 remote: adding manifests
601 609 remote: adding file changes
602 610 remote: added 1 changesets with 1 changes to 1 files
603 611
604 612 $ release $TESTTMP/watchfile
605 613
606 614 Check the result of the push
607 615
608 616 #if strict
609 617 $ cat ./push-log
610 618 pushing to ssh://user@dummy/server
611 619 searching for changes
612 620 wrote ready: $TESTTMP/readyfile
613 621 waiting on: $TESTTMP/watchfile
614 622 abort: push failed:
615 623 'remote repository changed while pushing - please try again'
616 624
617 625 $ hg -R server graph
618 626 o 75d69cba5402 C-G (default)
619 627 |
620 628 o d9e379a8c432 C-F (default)
621 629 |
622 630 o 51c544a58128 C-C (default)
623 631 |
624 632 | o d603e2c0cdd7 C-E (default)
625 633 |/
626 634 o 98217d5a1659 C-A (default)
627 635 |
628 636 | o 59e76faf78bd C-D (default)
629 637 | |
630 638 | o a9149a1428e2 C-B (default)
631 639 |/
632 640 @ 842e2fac6304 C-ROOT (default)
633 641
634 642 #endif
635 643 #if unrelated
636 644
637 645 (unrelated named branches are unrelated)
638 646
639 647 $ cat ./push-log
640 648 pushing to ssh://user@dummy/server
641 649 searching for changes
642 650 wrote ready: $TESTTMP/readyfile
643 651 waiting on: $TESTTMP/watchfile
644 652 remote: adding changesets
645 653 remote: adding manifests
646 654 remote: adding file changes
647 655 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
648 656
649 657 $ hg -R server graph
650 658 o 833be552cfe6 C-H (my-first-test-branch)
651 659 |
652 660 | o 75d69cba5402 C-G (default)
653 661 |/
654 662 o d9e379a8c432 C-F (default)
655 663 |
656 664 o 51c544a58128 C-C (default)
657 665 |
658 666 | o d603e2c0cdd7 C-E (default)
659 667 |/
660 668 o 98217d5a1659 C-A (default)
661 669 |
662 670 | o 59e76faf78bd C-D (default)
663 671 | |
664 672 | o a9149a1428e2 C-B (default)
665 673 |/
666 674 @ 842e2fac6304 C-ROOT (default)
667 675
668 676 #endif
669 677
670 678 The racing new head do not affect existing heads, push should go through
671 679
672 680 pushing touching different named branch (same topo): old branch raced
673 681 ---------------------------------------------------------------------
674 682
675 683 Pushing two children on the same head, one is a different named branch
676 684
677 685 # a (raced, default-branch)
678 686 # |
679 687 # | b (new branch)
680 688 # |/
681 689 # * (default-branch)
682 690
683 691 (resync-all)
684 692
685 693 #if strict
686 694
687 695 $ hg -R ./server pull ./client-racy
688 696 pulling from ./client-racy
689 697 searching for changes
690 698 adding changesets
691 699 adding manifests
692 700 adding file changes
693 701 added 1 changesets with 1 changes to 1 files (+1 heads)
694 702 new changesets 833be552cfe6 (1 drafts)
695 703 (run 'hg heads .' to see heads, 'hg merge' to merge)
696 704
697 705 #endif
698 706 #if unrelated
699 707
700 708 $ hg -R ./server pull ./client-racy
701 709 pulling from ./client-racy
702 710 searching for changes
703 711 no changes found
704 712
705 713 #endif
706 714
707 715 $ hg -R ./client-other pull
708 716 pulling from ssh://user@dummy/server
709 717 searching for changes
710 718 adding changesets
711 719 adding manifests
712 720 adding file changes
713 721 added 1 changesets with 1 changes to 1 files (+1 heads)
714 722 new changesets 833be552cfe6 (1 drafts)
715 723 (run 'hg heads .' to see heads, 'hg merge' to merge)
716 724 $ hg -R ./client-racy pull
717 725 pulling from ssh://user@dummy/server
718 726 searching for changes
719 727 adding changesets
720 728 adding manifests
721 729 adding file changes
722 730 added 1 changesets with 1 changes to 1 files (+1 heads)
723 731 new changesets 75d69cba5402 (1 drafts)
724 732 (run 'hg heads' to see heads)
725 733
726 734 $ hg -R server graph
727 735 o 833be552cfe6 C-H (my-first-test-branch)
728 736 |
729 737 | o 75d69cba5402 C-G (default)
730 738 |/
731 739 o d9e379a8c432 C-F (default)
732 740 |
733 741 o 51c544a58128 C-C (default)
734 742 |
735 743 | o d603e2c0cdd7 C-E (default)
736 744 |/
737 745 o 98217d5a1659 C-A (default)
738 746 |
739 747 | o 59e76faf78bd C-D (default)
740 748 | |
741 749 | o a9149a1428e2 C-B (default)
742 750 |/
743 751 @ 842e2fac6304 C-ROOT (default)
744 752
745 753
746 754 Creating changesets
747 755
748 756 (new named branch from one head)
749 757
750 758 $ hg -R client-other/ up 'desc("C-G")'
751 759 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 760 $ echo aaa >> client-other/a
753 761 $ hg -R client-other/ branch my-second-test-branch
754 762 marked working directory as branch my-second-test-branch
755 763 $ hg -R client-other/ commit -m "C-I"
756 764
757 765 (children "updating" that same head)
758 766
759 767 $ hg -R client-racy/ up 'desc("C-G")'
760 768 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 769 $ echo bbb >> client-racy/a
762 770 $ hg -R client-racy/ commit -m "C-J"
763 771
764 772 Pushing
765 773
766 774 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
767 775
768 776 $ waiton $TESTTMP/readyfile
769 777
770 778 $ hg -R client-other push -fr 'tip' --new-branch
771 779 pushing to ssh://user@dummy/server
772 780 searching for changes
773 781 remote: adding changesets
774 782 remote: adding manifests
775 783 remote: adding file changes
776 784 remote: added 1 changesets with 1 changes to 1 files
777 785
778 786 $ release $TESTTMP/watchfile
779 787
780 788 Check the result of the push
781 789
782 790 #if strict
783 791
784 792 $ cat ./push-log
785 793 pushing to ssh://user@dummy/server
786 794 searching for changes
787 795 wrote ready: $TESTTMP/readyfile
788 796 waiting on: $TESTTMP/watchfile
789 797 abort: push failed:
790 798 'remote repository changed while pushing - please try again'
791 799
792 800 $ hg -R server graph
793 801 o b35ed749f288 C-I (my-second-test-branch)
794 802 |
795 803 o 75d69cba5402 C-G (default)
796 804 |
797 805 | o 833be552cfe6 C-H (my-first-test-branch)
798 806 |/
799 807 o d9e379a8c432 C-F (default)
800 808 |
801 809 o 51c544a58128 C-C (default)
802 810 |
803 811 | o d603e2c0cdd7 C-E (default)
804 812 |/
805 813 o 98217d5a1659 C-A (default)
806 814 |
807 815 | o 59e76faf78bd C-D (default)
808 816 | |
809 817 | o a9149a1428e2 C-B (default)
810 818 |/
811 819 @ 842e2fac6304 C-ROOT (default)
812 820
813 821
814 822 #endif
815 823
816 824 #if unrelated
817 825
818 826 (unrelated named branches are unrelated)
819 827
820 828 $ cat ./push-log
821 829 pushing to ssh://user@dummy/server
822 830 searching for changes
823 831 wrote ready: $TESTTMP/readyfile
824 832 waiting on: $TESTTMP/watchfile
825 833 remote: adding changesets
826 834 remote: adding manifests
827 835 remote: adding file changes
828 836 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
829 837
830 838 $ hg -R server graph
831 839 o 89420bf00fae C-J (default)
832 840 |
833 841 | o b35ed749f288 C-I (my-second-test-branch)
834 842 |/
835 843 o 75d69cba5402 C-G (default)
836 844 |
837 845 | o 833be552cfe6 C-H (my-first-test-branch)
838 846 |/
839 847 o d9e379a8c432 C-F (default)
840 848 |
841 849 o 51c544a58128 C-C (default)
842 850 |
843 851 | o d603e2c0cdd7 C-E (default)
844 852 |/
845 853 o 98217d5a1659 C-A (default)
846 854 |
847 855 | o 59e76faf78bd C-D (default)
848 856 | |
849 857 | o a9149a1428e2 C-B (default)
850 858 |/
851 859 @ 842e2fac6304 C-ROOT (default)
852 860
853 861
854 862 #endif
855 863
856 864 pushing racing push touch multiple heads
857 865 ----------------------------------------
858 866
859 867 There are multiple heads, but the racing push touch all of them
860 868
861 869 # a (raced)
862 870 # | b
863 871 # |/|
864 872 # * *
865 873 # |/
866 874 # *
867 875
868 876 (resync-all)
869 877
870 878 #if strict
871 879
872 880 $ hg -R ./server pull ./client-racy
873 881 pulling from ./client-racy
874 882 searching for changes
875 883 adding changesets
876 884 adding manifests
877 885 adding file changes
878 886 added 1 changesets with 1 changes to 1 files (+1 heads)
879 887 new changesets 89420bf00fae (1 drafts)
880 888 (run 'hg heads .' to see heads, 'hg merge' to merge)
881 889
882 890 #endif
883 891
884 892 #if unrelated
885 893
886 894 $ hg -R ./server pull ./client-racy
887 895 pulling from ./client-racy
888 896 searching for changes
889 897 no changes found
890 898
891 899 #endif
892 900
893 901 $ hg -R ./client-other pull
894 902 pulling from ssh://user@dummy/server
895 903 searching for changes
896 904 adding changesets
897 905 adding manifests
898 906 adding file changes
899 907 added 1 changesets with 1 changes to 1 files (+1 heads)
900 908 new changesets 89420bf00fae (1 drafts)
901 909 (run 'hg heads' to see heads)
902 910 $ hg -R ./client-racy pull
903 911 pulling from ssh://user@dummy/server
904 912 searching for changes
905 913 adding changesets
906 914 adding manifests
907 915 adding file changes
908 916 added 1 changesets with 1 changes to 1 files (+1 heads)
909 917 new changesets b35ed749f288 (1 drafts)
910 918 (run 'hg heads .' to see heads, 'hg merge' to merge)
911 919
912 920 $ hg -R server graph
913 921 o 89420bf00fae C-J (default)
914 922 |
915 923 | o b35ed749f288 C-I (my-second-test-branch)
916 924 |/
917 925 o 75d69cba5402 C-G (default)
918 926 |
919 927 | o 833be552cfe6 C-H (my-first-test-branch)
920 928 |/
921 929 o d9e379a8c432 C-F (default)
922 930 |
923 931 o 51c544a58128 C-C (default)
924 932 |
925 933 | o d603e2c0cdd7 C-E (default)
926 934 |/
927 935 o 98217d5a1659 C-A (default)
928 936 |
929 937 | o 59e76faf78bd C-D (default)
930 938 | |
931 939 | o a9149a1428e2 C-B (default)
932 940 |/
933 941 @ 842e2fac6304 C-ROOT (default)
934 942
935 943
936 944 Creating changesets
937 945
938 946 (merges heads)
939 947
940 948 $ hg -R client-other/ up 'desc("C-E")'
941 949 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
942 950 $ hg -R client-other/ merge 'desc("C-D")'
943 951 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
944 952 (branch merge, don't forget to commit)
945 953 $ hg -R client-other/ commit -m "C-K"
946 954
947 955 (update one head)
948 956
949 957 $ hg -R client-racy/ up 'desc("C-D")'
950 958 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
951 959 $ echo bbb >> client-racy/b
952 960 $ hg -R client-racy/ commit -m "C-L"
953 961
954 962 Pushing
955 963
956 964 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
957 965
958 966 $ waiton $TESTTMP/readyfile
959 967
960 968 $ hg -R client-other push -fr 'tip' --new-branch
961 969 pushing to ssh://user@dummy/server
962 970 searching for changes
963 971 remote: adding changesets
964 972 remote: adding manifests
965 973 remote: adding file changes
966 974 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
967 975
968 976 $ release $TESTTMP/watchfile
969 977
970 978 Check the result of the push
971 979
972 980 $ cat ./push-log
973 981 pushing to ssh://user@dummy/server
974 982 searching for changes
975 983 wrote ready: $TESTTMP/readyfile
976 984 waiting on: $TESTTMP/watchfile
977 985 abort: push failed:
978 986 'remote repository changed while pushing - please try again'
979 987
980 988 $ hg -R server graph
981 989 o be705100c623 C-K (default)
982 990 |\
983 991 | o d603e2c0cdd7 C-E (default)
984 992 | |
985 993 o | 59e76faf78bd C-D (default)
986 994 | |
987 995 | | o 89420bf00fae C-J (default)
988 996 | | |
989 997 | | | o b35ed749f288 C-I (my-second-test-branch)
990 998 | | |/
991 999 | | o 75d69cba5402 C-G (default)
992 1000 | | |
993 1001 | | | o 833be552cfe6 C-H (my-first-test-branch)
994 1002 | | |/
995 1003 | | o d9e379a8c432 C-F (default)
996 1004 | | |
997 1005 | | o 51c544a58128 C-C (default)
998 1006 | |/
999 1007 o | a9149a1428e2 C-B (default)
1000 1008 | |
1001 1009 | o 98217d5a1659 C-A (default)
1002 1010 |/
1003 1011 @ 842e2fac6304 C-ROOT (default)
1004 1012
1005 1013
1006 1014 pushing raced push touch multiple heads
1007 1015 ---------------------------------------
1008 1016
1009 1017 There are multiple heads, the raced push touch all of them
1010 1018
1011 1019 # b
1012 1020 # | a (raced)
1013 1021 # |/|
1014 1022 # * *
1015 1023 # |/
1016 1024 # *
1017 1025
1018 1026 (resync-all)
1019 1027
1020 1028 $ hg -R ./server pull ./client-racy
1021 1029 pulling from ./client-racy
1022 1030 searching for changes
1023 1031 adding changesets
1024 1032 adding manifests
1025 1033 adding file changes
1026 1034 added 1 changesets with 1 changes to 1 files (+1 heads)
1027 1035 new changesets cac2cead0ff0 (1 drafts)
1028 1036 (run 'hg heads .' to see heads, 'hg merge' to merge)
1029 1037 $ hg -R ./client-other pull
1030 1038 pulling from ssh://user@dummy/server
1031 1039 searching for changes
1032 1040 adding changesets
1033 1041 adding manifests
1034 1042 adding file changes
1035 1043 added 1 changesets with 1 changes to 1 files (+1 heads)
1036 1044 new changesets cac2cead0ff0 (1 drafts)
1037 1045 (run 'hg heads .' to see heads, 'hg merge' to merge)
1038 1046 $ hg -R ./client-racy pull
1039 1047 pulling from ssh://user@dummy/server
1040 1048 searching for changes
1041 1049 adding changesets
1042 1050 adding manifests
1043 1051 adding file changes
1044 1052 added 1 changesets with 0 changes to 0 files
1045 1053 new changesets be705100c623 (1 drafts)
1046 1054 (run 'hg update' to get a working copy)
1047 1055
1048 1056 $ hg -R server graph
1049 1057 o cac2cead0ff0 C-L (default)
1050 1058 |
1051 1059 | o be705100c623 C-K (default)
1052 1060 |/|
1053 1061 | o d603e2c0cdd7 C-E (default)
1054 1062 | |
1055 1063 o | 59e76faf78bd C-D (default)
1056 1064 | |
1057 1065 | | o 89420bf00fae C-J (default)
1058 1066 | | |
1059 1067 | | | o b35ed749f288 C-I (my-second-test-branch)
1060 1068 | | |/
1061 1069 | | o 75d69cba5402 C-G (default)
1062 1070 | | |
1063 1071 | | | o 833be552cfe6 C-H (my-first-test-branch)
1064 1072 | | |/
1065 1073 | | o d9e379a8c432 C-F (default)
1066 1074 | | |
1067 1075 | | o 51c544a58128 C-C (default)
1068 1076 | |/
1069 1077 o | a9149a1428e2 C-B (default)
1070 1078 | |
1071 1079 | o 98217d5a1659 C-A (default)
1072 1080 |/
1073 1081 @ 842e2fac6304 C-ROOT (default)
1074 1082
1075 1083
1076 1084 Creating changesets
1077 1085
1078 1086 (update existing head)
1079 1087
1080 1088 $ echo aaa >> client-other/a
1081 1089 $ hg -R client-other/ commit -m "C-M"
1082 1090
1083 1091 (merge heads)
1084 1092
1085 1093 $ hg -R client-racy/ merge 'desc("C-K")'
1086 1094 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1087 1095 (branch merge, don't forget to commit)
1088 1096 $ hg -R client-racy/ commit -m "C-N"
1089 1097
1090 1098 Pushing
1091 1099
1092 1100 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
1093 1101
1094 1102 $ waiton $TESTTMP/readyfile
1095 1103
1096 1104 $ hg -R client-other push -fr 'tip' --new-branch
1097 1105 pushing to ssh://user@dummy/server
1098 1106 searching for changes
1099 1107 remote: adding changesets
1100 1108 remote: adding manifests
1101 1109 remote: adding file changes
1102 1110 remote: added 1 changesets with 1 changes to 1 files
1103 1111
1104 1112 $ release $TESTTMP/watchfile
1105 1113
1106 1114 Check the result of the push
1107 1115
1108 1116 $ cat ./push-log
1109 1117 pushing to ssh://user@dummy/server
1110 1118 searching for changes
1111 1119 wrote ready: $TESTTMP/readyfile
1112 1120 waiting on: $TESTTMP/watchfile
1113 1121 abort: push failed:
1114 1122 'remote repository changed while pushing - please try again'
1115 1123
1116 1124 $ hg -R server graph
1117 1125 o 6fd3090135df C-M (default)
1118 1126 |
1119 1127 o be705100c623 C-K (default)
1120 1128 |\
1121 1129 | o d603e2c0cdd7 C-E (default)
1122 1130 | |
1123 1131 +---o cac2cead0ff0 C-L (default)
1124 1132 | |
1125 1133 o | 59e76faf78bd C-D (default)
1126 1134 | |
1127 1135 | | o 89420bf00fae C-J (default)
1128 1136 | | |
1129 1137 | | | o b35ed749f288 C-I (my-second-test-branch)
1130 1138 | | |/
1131 1139 | | o 75d69cba5402 C-G (default)
1132 1140 | | |
1133 1141 | | | o 833be552cfe6 C-H (my-first-test-branch)
1134 1142 | | |/
1135 1143 | | o d9e379a8c432 C-F (default)
1136 1144 | | |
1137 1145 | | o 51c544a58128 C-C (default)
1138 1146 | |/
1139 1147 o | a9149a1428e2 C-B (default)
1140 1148 | |
1141 1149 | o 98217d5a1659 C-A (default)
1142 1150 |/
1143 1151 @ 842e2fac6304 C-ROOT (default)
1144 1152
1145 1153
1146 1154 racing commit push a new head behind another named branch
1147 1155 ---------------------------------------------------------
1148 1156
1149 1157 non-continuous branch are valid case, we tests for them.
1150 1158
1151 1159 # b (branch default)
1152 1160 # |
1153 1161 # o (branch foo)
1154 1162 # |
1155 1163 # | a (raced, branch default)
1156 1164 # |/
1157 1165 # * (branch foo)
1158 1166 # |
1159 1167 # * (branch default)
1160 1168
1161 1169 (resync-all + other branch)
1162 1170
1163 1171 $ hg -R ./server pull ./client-racy
1164 1172 pulling from ./client-racy
1165 1173 searching for changes
1166 1174 adding changesets
1167 1175 adding manifests
1168 1176 adding file changes
1169 1177 added 1 changesets with 0 changes to 0 files
1170 1178 new changesets 866a66e18630 (1 drafts)
1171 1179 (run 'hg update' to get a working copy)
1172 1180
1173 1181 (creates named branch on head)
1174 1182
1175 1183 $ hg -R ./server/ up 'desc("C-N")'
1176 1184 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1177 1185 $ hg -R ./server/ branch other
1178 1186 marked working directory as branch other
1179 1187 $ hg -R ./server/ ci -m "C-Z"
1180 1188 $ hg -R ./server/ up null
1181 1189 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
1182 1190
1183 1191 (sync client)
1184 1192
1185 1193 $ hg -R ./client-other pull
1186 1194 pulling from ssh://user@dummy/server
1187 1195 searching for changes
1188 1196 adding changesets
1189 1197 adding manifests
1190 1198 adding file changes
1191 1199 added 2 changesets with 0 changes to 0 files
1192 1200 new changesets 866a66e18630:55a6f1c01b48 (2 drafts)
1193 1201 (run 'hg update' to get a working copy)
1194 1202 $ hg -R ./client-racy pull
1195 1203 pulling from ssh://user@dummy/server
1196 1204 searching for changes
1197 1205 adding changesets
1198 1206 adding manifests
1199 1207 adding file changes
1200 1208 added 2 changesets with 1 changes to 1 files (+1 heads)
1201 1209 new changesets 6fd3090135df:55a6f1c01b48 (2 drafts)
1202 1210 (run 'hg heads .' to see heads, 'hg merge' to merge)
1203 1211
1204 1212 $ hg -R server graph
1205 1213 o 55a6f1c01b48 C-Z (other)
1206 1214 |
1207 1215 o 866a66e18630 C-N (default)
1208 1216 |\
1209 1217 +---o 6fd3090135df C-M (default)
1210 1218 | |
1211 1219 | o cac2cead0ff0 C-L (default)
1212 1220 | |
1213 1221 o | be705100c623 C-K (default)
1214 1222 |\|
1215 1223 o | d603e2c0cdd7 C-E (default)
1216 1224 | |
1217 1225 | o 59e76faf78bd C-D (default)
1218 1226 | |
1219 1227 | | o 89420bf00fae C-J (default)
1220 1228 | | |
1221 1229 | | | o b35ed749f288 C-I (my-second-test-branch)
1222 1230 | | |/
1223 1231 | | o 75d69cba5402 C-G (default)
1224 1232 | | |
1225 1233 | | | o 833be552cfe6 C-H (my-first-test-branch)
1226 1234 | | |/
1227 1235 | | o d9e379a8c432 C-F (default)
1228 1236 | | |
1229 1237 +---o 51c544a58128 C-C (default)
1230 1238 | |
1231 1239 | o a9149a1428e2 C-B (default)
1232 1240 | |
1233 1241 o | 98217d5a1659 C-A (default)
1234 1242 |/
1235 1243 o 842e2fac6304 C-ROOT (default)
1236 1244
1237 1245
1238 1246 Creating changesets
1239 1247
1240 1248 (update default head through another named branch one)
1241 1249
1242 1250 $ hg -R client-other/ up 'desc("C-Z")'
1243 1251 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 1252 $ echo aaa >> client-other/a
1245 1253 $ hg -R client-other/ commit -m "C-O"
1246 1254 $ echo aaa >> client-other/a
1247 1255 $ hg -R client-other/ branch --force default
1248 1256 marked working directory as branch default
1249 1257 $ hg -R client-other/ commit -m "C-P"
1250 1258 created new head
1251 1259
1252 1260 (update default head)
1253 1261
1254 1262 $ hg -R client-racy/ up 'desc("C-Z")'
1255 1263 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1256 1264 $ echo bbb >> client-other/a
1257 1265 $ hg -R client-racy/ branch --force default
1258 1266 marked working directory as branch default
1259 1267 $ hg -R client-racy/ commit -m "C-Q"
1260 1268 created new head
1261 1269
1262 1270 Pushing
1263 1271
1264 1272 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
1265 1273
1266 1274 $ waiton $TESTTMP/readyfile
1267 1275
1268 1276 $ hg -R client-other push -fr 'tip' --new-branch
1269 1277 pushing to ssh://user@dummy/server
1270 1278 searching for changes
1271 1279 remote: adding changesets
1272 1280 remote: adding manifests
1273 1281 remote: adding file changes
1274 1282 remote: added 2 changesets with 1 changes to 1 files
1275 1283
1276 1284 $ release $TESTTMP/watchfile
1277 1285
1278 1286 Check the result of the push
1279 1287
1280 1288 $ cat ./push-log
1281 1289 pushing to ssh://user@dummy/server
1282 1290 searching for changes
1283 1291 wrote ready: $TESTTMP/readyfile
1284 1292 waiting on: $TESTTMP/watchfile
1285 1293 abort: push failed:
1286 1294 'remote repository changed while pushing - please try again'
1287 1295
1288 1296 $ hg -R server graph
1289 1297 o 1b58ee3f79e5 C-P (default)
1290 1298 |
1291 1299 o d0a85b2252a9 C-O (other)
1292 1300 |
1293 1301 o 55a6f1c01b48 C-Z (other)
1294 1302 |
1295 1303 o 866a66e18630 C-N (default)
1296 1304 |\
1297 1305 +---o 6fd3090135df C-M (default)
1298 1306 | |
1299 1307 | o cac2cead0ff0 C-L (default)
1300 1308 | |
1301 1309 o | be705100c623 C-K (default)
1302 1310 |\|
1303 1311 o | d603e2c0cdd7 C-E (default)
1304 1312 | |
1305 1313 | o 59e76faf78bd C-D (default)
1306 1314 | |
1307 1315 | | o 89420bf00fae C-J (default)
1308 1316 | | |
1309 1317 | | | o b35ed749f288 C-I (my-second-test-branch)
1310 1318 | | |/
1311 1319 | | o 75d69cba5402 C-G (default)
1312 1320 | | |
1313 1321 | | | o 833be552cfe6 C-H (my-first-test-branch)
1314 1322 | | |/
1315 1323 | | o d9e379a8c432 C-F (default)
1316 1324 | | |
1317 1325 +---o 51c544a58128 C-C (default)
1318 1326 | |
1319 1327 | o a9149a1428e2 C-B (default)
1320 1328 | |
1321 1329 o | 98217d5a1659 C-A (default)
1322 1330 |/
1323 1331 o 842e2fac6304 C-ROOT (default)
1324 1332
1325 1333
1326 1334 raced commit push a new head behind another named branch
1327 1335 ---------------------------------------------------------
1328 1336
1329 1337 non-continuous branch are valid case, we tests for them.
1330 1338
1331 1339 # b (raced branch default)
1332 1340 # |
1333 1341 # o (branch foo)
1334 1342 # |
1335 1343 # | a (branch default)
1336 1344 # |/
1337 1345 # * (branch foo)
1338 1346 # |
1339 1347 # * (branch default)
1340 1348
1341 1349 (resync-all)
1342 1350
1343 1351 $ hg -R ./server pull ./client-racy
1344 1352 pulling from ./client-racy
1345 1353 searching for changes
1346 1354 adding changesets
1347 1355 adding manifests
1348 1356 adding file changes
1349 1357 added 1 changesets with 0 changes to 0 files (+1 heads)
1350 1358 new changesets b0ee3d6f51bc (1 drafts)
1351 1359 (run 'hg heads .' to see heads, 'hg merge' to merge)
1352 1360 $ hg -R ./client-other pull
1353 1361 pulling from ssh://user@dummy/server
1354 1362 searching for changes
1355 1363 adding changesets
1356 1364 adding manifests
1357 1365 adding file changes
1358 1366 added 1 changesets with 0 changes to 0 files (+1 heads)
1359 1367 new changesets b0ee3d6f51bc (1 drafts)
1360 1368 (run 'hg heads .' to see heads, 'hg merge' to merge)
1361 1369 $ hg -R ./client-racy pull
1362 1370 pulling from ssh://user@dummy/server
1363 1371 searching for changes
1364 1372 adding changesets
1365 1373 adding manifests
1366 1374 adding file changes
1367 1375 added 2 changesets with 1 changes to 1 files (+1 heads)
1368 1376 new changesets d0a85b2252a9:1b58ee3f79e5 (2 drafts)
1369 1377 (run 'hg heads .' to see heads, 'hg merge' to merge)
1370 1378
1371 1379 $ hg -R server graph
1372 1380 o b0ee3d6f51bc C-Q (default)
1373 1381 |
1374 1382 | o 1b58ee3f79e5 C-P (default)
1375 1383 | |
1376 1384 | o d0a85b2252a9 C-O (other)
1377 1385 |/
1378 1386 o 55a6f1c01b48 C-Z (other)
1379 1387 |
1380 1388 o 866a66e18630 C-N (default)
1381 1389 |\
1382 1390 +---o 6fd3090135df C-M (default)
1383 1391 | |
1384 1392 | o cac2cead0ff0 C-L (default)
1385 1393 | |
1386 1394 o | be705100c623 C-K (default)
1387 1395 |\|
1388 1396 o | d603e2c0cdd7 C-E (default)
1389 1397 | |
1390 1398 | o 59e76faf78bd C-D (default)
1391 1399 | |
1392 1400 | | o 89420bf00fae C-J (default)
1393 1401 | | |
1394 1402 | | | o b35ed749f288 C-I (my-second-test-branch)
1395 1403 | | |/
1396 1404 | | o 75d69cba5402 C-G (default)
1397 1405 | | |
1398 1406 | | | o 833be552cfe6 C-H (my-first-test-branch)
1399 1407 | | |/
1400 1408 | | o d9e379a8c432 C-F (default)
1401 1409 | | |
1402 1410 +---o 51c544a58128 C-C (default)
1403 1411 | |
1404 1412 | o a9149a1428e2 C-B (default)
1405 1413 | |
1406 1414 o | 98217d5a1659 C-A (default)
1407 1415 |/
1408 1416 o 842e2fac6304 C-ROOT (default)
1409 1417
1410 1418
1411 1419 Creating changesets
1412 1420
1413 1421 (update 'other' named branch head)
1414 1422
1415 1423 $ hg -R client-other/ up 'desc("C-P")'
1416 1424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1417 1425 $ echo aaa >> client-other/a
1418 1426 $ hg -R client-other/ branch --force other
1419 1427 marked working directory as branch other
1420 1428 $ hg -R client-other/ commit -m "C-R"
1421 1429 created new head
1422 1430
1423 1431 (update 'other named brnach through a 'default' changeset')
1424 1432
1425 1433 $ hg -R client-racy/ up 'desc("C-P")'
1426 1434 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1427 1435 $ echo bbb >> client-racy/a
1428 1436 $ hg -R client-racy/ commit -m "C-S"
1429 1437 $ echo bbb >> client-racy/a
1430 1438 $ hg -R client-racy/ branch --force other
1431 1439 marked working directory as branch other
1432 1440 $ hg -R client-racy/ commit -m "C-T"
1433 1441 created new head
1434 1442
1435 1443 Pushing
1436 1444
1437 1445 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
1438 1446
1439 1447 $ waiton $TESTTMP/readyfile
1440 1448
1441 1449 $ hg -R client-other push -fr 'tip' --new-branch
1442 1450 pushing to ssh://user@dummy/server
1443 1451 searching for changes
1444 1452 remote: adding changesets
1445 1453 remote: adding manifests
1446 1454 remote: adding file changes
1447 1455 remote: added 1 changesets with 1 changes to 1 files
1448 1456
1449 1457 $ release $TESTTMP/watchfile
1450 1458
1451 1459 Check the result of the push
1452 1460
1453 1461 $ cat ./push-log
1454 1462 pushing to ssh://user@dummy/server
1455 1463 searching for changes
1456 1464 wrote ready: $TESTTMP/readyfile
1457 1465 waiting on: $TESTTMP/watchfile
1458 1466 abort: push failed:
1459 1467 'remote repository changed while pushing - please try again'
1460 1468
1461 1469 $ hg -R server graph
1462 1470 o de7b9e2ba3f6 C-R (other)
1463 1471 |
1464 1472 o 1b58ee3f79e5 C-P (default)
1465 1473 |
1466 1474 o d0a85b2252a9 C-O (other)
1467 1475 |
1468 1476 | o b0ee3d6f51bc C-Q (default)
1469 1477 |/
1470 1478 o 55a6f1c01b48 C-Z (other)
1471 1479 |
1472 1480 o 866a66e18630 C-N (default)
1473 1481 |\
1474 1482 +---o 6fd3090135df C-M (default)
1475 1483 | |
1476 1484 | o cac2cead0ff0 C-L (default)
1477 1485 | |
1478 1486 o | be705100c623 C-K (default)
1479 1487 |\|
1480 1488 o | d603e2c0cdd7 C-E (default)
1481 1489 | |
1482 1490 | o 59e76faf78bd C-D (default)
1483 1491 | |
1484 1492 | | o 89420bf00fae C-J (default)
1485 1493 | | |
1486 1494 | | | o b35ed749f288 C-I (my-second-test-branch)
1487 1495 | | |/
1488 1496 | | o 75d69cba5402 C-G (default)
1489 1497 | | |
1490 1498 | | | o 833be552cfe6 C-H (my-first-test-branch)
1491 1499 | | |/
1492 1500 | | o d9e379a8c432 C-F (default)
1493 1501 | | |
1494 1502 +---o 51c544a58128 C-C (default)
1495 1503 | |
1496 1504 | o a9149a1428e2 C-B (default)
1497 1505 | |
1498 1506 o | 98217d5a1659 C-A (default)
1499 1507 |/
1500 1508 o 842e2fac6304 C-ROOT (default)
1501 1509
1502 1510
1503 1511 raced commit push a new head obsoleting the one touched by the racing push
1504 1512 --------------------------------------------------------------------------
1505 1513
1506 1514 # b (racing)
1507 1515 # |
1508 1516 # ΓΈβ‡ β—” a (raced)
1509 1517 # |/
1510 1518 # *
1511 1519
1512 1520 (resync-all)
1513 1521
1514 1522 $ hg -R ./server pull ./client-racy
1515 1523 pulling from ./client-racy
1516 1524 searching for changes
1517 1525 adding changesets
1518 1526 adding manifests
1519 1527 adding file changes
1520 1528 added 2 changesets with 2 changes to 1 files (+1 heads)
1521 1529 new changesets 2efd43f7b5ba:3d57ed3c1091 (2 drafts)
1522 1530 (run 'hg heads .' to see heads, 'hg merge' to merge)
1523 1531 $ hg -R ./client-other pull
1524 1532 pulling from ssh://user@dummy/server
1525 1533 searching for changes
1526 1534 adding changesets
1527 1535 adding manifests
1528 1536 adding file changes
1529 1537 added 2 changesets with 2 changes to 1 files (+1 heads)
1530 1538 new changesets 2efd43f7b5ba:3d57ed3c1091 (2 drafts)
1531 1539 (run 'hg heads' to see heads, 'hg merge' to merge)
1532 1540 $ hg -R ./client-racy pull
1533 1541 pulling from ssh://user@dummy/server
1534 1542 searching for changes
1535 1543 adding changesets
1536 1544 adding manifests
1537 1545 adding file changes
1538 1546 added 1 changesets with 1 changes to 1 files (+1 heads)
1539 1547 new changesets de7b9e2ba3f6 (1 drafts)
1540 1548 (run 'hg heads' to see heads, 'hg merge' to merge)
1541 1549
1542 1550 $ hg -R server graph
1543 1551 o 3d57ed3c1091 C-T (other)
1544 1552 |
1545 1553 o 2efd43f7b5ba C-S (default)
1546 1554 |
1547 1555 | o de7b9e2ba3f6 C-R (other)
1548 1556 |/
1549 1557 o 1b58ee3f79e5 C-P (default)
1550 1558 |
1551 1559 o d0a85b2252a9 C-O (other)
1552 1560 |
1553 1561 | o b0ee3d6f51bc C-Q (default)
1554 1562 |/
1555 1563 o 55a6f1c01b48 C-Z (other)
1556 1564 |
1557 1565 o 866a66e18630 C-N (default)
1558 1566 |\
1559 1567 +---o 6fd3090135df C-M (default)
1560 1568 | |
1561 1569 | o cac2cead0ff0 C-L (default)
1562 1570 | |
1563 1571 o | be705100c623 C-K (default)
1564 1572 |\|
1565 1573 o | d603e2c0cdd7 C-E (default)
1566 1574 | |
1567 1575 | o 59e76faf78bd C-D (default)
1568 1576 | |
1569 1577 | | o 89420bf00fae C-J (default)
1570 1578 | | |
1571 1579 | | | o b35ed749f288 C-I (my-second-test-branch)
1572 1580 | | |/
1573 1581 | | o 75d69cba5402 C-G (default)
1574 1582 | | |
1575 1583 | | | o 833be552cfe6 C-H (my-first-test-branch)
1576 1584 | | |/
1577 1585 | | o d9e379a8c432 C-F (default)
1578 1586 | | |
1579 1587 +---o 51c544a58128 C-C (default)
1580 1588 | |
1581 1589 | o a9149a1428e2 C-B (default)
1582 1590 | |
1583 1591 o | 98217d5a1659 C-A (default)
1584 1592 |/
1585 1593 o 842e2fac6304 C-ROOT (default)
1586 1594
1587 1595
1588 1596 Creating changesets and markers
1589 1597
1590 1598 (continue existing head)
1591 1599
1592 1600 $ hg -R client-other/ up 'desc("C-Q")'
1593 1601 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1594 1602 $ echo aaa >> client-other/a
1595 1603 $ hg -R client-other/ commit -m "C-U"
1596 1604
1597 1605 (new topo branch obsoleting that same head)
1598 1606
1599 1607 $ hg -R client-racy/ up 'desc("C-Z")'
1600 1608 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1601 1609 $ echo bbb >> client-racy/a
1602 1610 $ hg -R client-racy/ branch --force default
1603 1611 marked working directory as branch default
1604 1612 $ hg -R client-racy/ commit -m "C-V"
1605 1613 created new head
1606 1614 $ ID_Q=`hg -R client-racy log -T '{node}\n' -r 'desc("C-Q")'`
1607 1615 $ ID_V=`hg -R client-racy log -T '{node}\n' -r 'desc("C-V")'`
1608 1616 $ hg -R client-racy debugobsolete $ID_Q $ID_V
1609 1617 1 new obsolescence markers
1610 1618 obsoleted 1 changesets
1611 1619
1612 1620 Pushing
1613 1621
1614 1622 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
1615 1623
1616 1624 $ waiton $TESTTMP/readyfile
1617 1625
1618 1626 $ hg -R client-other push -fr 'tip' --new-branch
1619 1627 pushing to ssh://user@dummy/server
1620 1628 searching for changes
1621 1629 remote: adding changesets
1622 1630 remote: adding manifests
1623 1631 remote: adding file changes
1624 1632 remote: added 1 changesets with 0 changes to 0 files
1625 1633
1626 1634 $ release $TESTTMP/watchfile
1627 1635
1628 1636 Check the result of the push
1629 1637
1630 1638 $ cat ./push-log
1631 1639 pushing to ssh://user@dummy/server
1632 1640 searching for changes
1633 1641 wrote ready: $TESTTMP/readyfile
1634 1642 waiting on: $TESTTMP/watchfile
1635 1643 abort: push failed:
1636 1644 'remote repository changed while pushing - please try again'
1637 1645
1638 1646 $ hg -R server debugobsolete
1639 1647 $ hg -R server graph
1640 1648 o a98a47d8b85b C-U (default)
1641 1649 |
1642 1650 o b0ee3d6f51bc C-Q (default)
1643 1651 |
1644 1652 | o 3d57ed3c1091 C-T (other)
1645 1653 | |
1646 1654 | o 2efd43f7b5ba C-S (default)
1647 1655 | |
1648 1656 | | o de7b9e2ba3f6 C-R (other)
1649 1657 | |/
1650 1658 | o 1b58ee3f79e5 C-P (default)
1651 1659 | |
1652 1660 | o d0a85b2252a9 C-O (other)
1653 1661 |/
1654 1662 o 55a6f1c01b48 C-Z (other)
1655 1663 |
1656 1664 o 866a66e18630 C-N (default)
1657 1665 |\
1658 1666 +---o 6fd3090135df C-M (default)
1659 1667 | |
1660 1668 | o cac2cead0ff0 C-L (default)
1661 1669 | |
1662 1670 o | be705100c623 C-K (default)
1663 1671 |\|
1664 1672 o | d603e2c0cdd7 C-E (default)
1665 1673 | |
1666 1674 | o 59e76faf78bd C-D (default)
1667 1675 | |
1668 1676 | | o 89420bf00fae C-J (default)
1669 1677 | | |
1670 1678 | | | o b35ed749f288 C-I (my-second-test-branch)
1671 1679 | | |/
1672 1680 | | o 75d69cba5402 C-G (default)
1673 1681 | | |
1674 1682 | | | o 833be552cfe6 C-H (my-first-test-branch)
1675 1683 | | |/
1676 1684 | | o d9e379a8c432 C-F (default)
1677 1685 | | |
1678 1686 +---o 51c544a58128 C-C (default)
1679 1687 | |
1680 1688 | o a9149a1428e2 C-B (default)
1681 1689 | |
1682 1690 o | 98217d5a1659 C-A (default)
1683 1691 |/
1684 1692 o 842e2fac6304 C-ROOT (default)
1685 1693
1686 1694
1687 1695 racing commit push a new head obsoleting the one touched by the raced push
1688 1696 --------------------------------------------------------------------------
1689 1697
1690 1698 (mirror test case of the previous one
1691 1699
1692 1700 # a (raced branch default)
1693 1701 # |
1694 1702 # ΓΈβ‡ β—” b (racing)
1695 1703 # |/
1696 1704 # *
1697 1705
1698 1706 (resync-all)
1699 1707
1700 1708 $ hg -R ./server pull ./client-racy
1701 1709 pulling from ./client-racy
1702 1710 searching for changes
1703 1711 adding changesets
1704 1712 adding manifests
1705 1713 adding file changes
1706 1714 added 1 changesets with 1 changes to 1 files (+1 heads)
1707 1715 1 new obsolescence markers
1708 1716 obsoleted 1 changesets
1709 1717 1 new orphan changesets
1710 1718 new changesets 720c5163ecf6 (1 drafts)
1711 1719 (run 'hg heads .' to see heads, 'hg merge' to merge)
1712 1720 $ hg -R ./client-other pull
1713 1721 pulling from ssh://user@dummy/server
1714 1722 searching for changes
1715 1723 adding changesets
1716 1724 adding manifests
1717 1725 adding file changes
1718 1726 added 1 changesets with 1 changes to 1 files (+1 heads)
1719 1727 1 new obsolescence markers
1720 1728 obsoleted 1 changesets
1721 1729 1 new orphan changesets
1722 1730 new changesets 720c5163ecf6 (1 drafts)
1723 1731 (run 'hg heads .' to see heads, 'hg merge' to merge)
1724 1732 $ hg -R ./client-racy pull
1725 1733 pulling from ssh://user@dummy/server
1726 1734 searching for changes
1727 1735 adding changesets
1728 1736 adding manifests
1729 1737 adding file changes
1730 1738 added 1 changesets with 0 changes to 0 files
1731 1739 1 new orphan changesets
1732 1740 new changesets a98a47d8b85b (1 drafts)
1733 1741 (run 'hg update' to get a working copy)
1734 1742
1735 1743 $ hg -R server debugobsolete
1736 1744 b0ee3d6f51bc4c0ca6d4f2907708027a6c376233 720c5163ecf64dcc6216bee2d62bf3edb1882499 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1737 1745 $ hg -R server graph
1738 1746 o 720c5163ecf6 C-V (default)
1739 1747 |
1740 1748 | * a98a47d8b85b C-U (default)
1741 1749 | |
1742 1750 | x b0ee3d6f51bc C-Q (default)
1743 1751 |/
1744 1752 | o 3d57ed3c1091 C-T (other)
1745 1753 | |
1746 1754 | o 2efd43f7b5ba C-S (default)
1747 1755 | |
1748 1756 | | o de7b9e2ba3f6 C-R (other)
1749 1757 | |/
1750 1758 | o 1b58ee3f79e5 C-P (default)
1751 1759 | |
1752 1760 | o d0a85b2252a9 C-O (other)
1753 1761 |/
1754 1762 o 55a6f1c01b48 C-Z (other)
1755 1763 |
1756 1764 o 866a66e18630 C-N (default)
1757 1765 |\
1758 1766 +---o 6fd3090135df C-M (default)
1759 1767 | |
1760 1768 | o cac2cead0ff0 C-L (default)
1761 1769 | |
1762 1770 o | be705100c623 C-K (default)
1763 1771 |\|
1764 1772 o | d603e2c0cdd7 C-E (default)
1765 1773 | |
1766 1774 | o 59e76faf78bd C-D (default)
1767 1775 | |
1768 1776 | | o 89420bf00fae C-J (default)
1769 1777 | | |
1770 1778 | | | o b35ed749f288 C-I (my-second-test-branch)
1771 1779 | | |/
1772 1780 | | o 75d69cba5402 C-G (default)
1773 1781 | | |
1774 1782 | | | o 833be552cfe6 C-H (my-first-test-branch)
1775 1783 | | |/
1776 1784 | | o d9e379a8c432 C-F (default)
1777 1785 | | |
1778 1786 +---o 51c544a58128 C-C (default)
1779 1787 | |
1780 1788 | o a9149a1428e2 C-B (default)
1781 1789 | |
1782 1790 o | 98217d5a1659 C-A (default)
1783 1791 |/
1784 1792 o 842e2fac6304 C-ROOT (default)
1785 1793
1786 1794
1787 1795 Creating changesets and markers
1788 1796
1789 1797 (new topo branch obsoleting that same head)
1790 1798
1791 1799 $ hg -R client-other/ up 'desc("C-Q")'
1792 1800 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1793 1801 $ echo bbb >> client-other/a
1794 1802 $ hg -R client-other/ branch --force default
1795 1803 marked working directory as branch default
1796 1804 $ hg -R client-other/ commit -m "C-W"
1797 1805 1 new orphan changesets
1798 1806 created new head
1799 1807 $ ID_V=`hg -R client-other log -T '{node}\n' -r 'desc("C-V")'`
1800 1808 $ ID_W=`hg -R client-other log -T '{node}\n' -r 'desc("C-W")'`
1801 1809 $ hg -R client-other debugobsolete $ID_V $ID_W
1802 1810 1 new obsolescence markers
1803 1811 obsoleted 1 changesets
1804 1812
1805 1813 (continue the same head)
1806 1814
1807 1815 $ echo aaa >> client-racy/a
1808 1816 $ hg -R client-racy/ commit -m "C-X"
1809 1817
1810 1818 Pushing
1811 1819
1812 1820 $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 &
1813 1821
1814 1822 $ waiton $TESTTMP/readyfile
1815 1823
1816 1824 $ hg -R client-other push -fr 'tip' --new-branch
1817 1825 pushing to ssh://user@dummy/server
1818 1826 searching for changes
1819 1827 remote: adding changesets
1820 1828 remote: adding manifests
1821 1829 remote: adding file changes
1822 1830 remote: added 1 changesets with 0 changes to 1 files (+1 heads)
1823 1831 remote: 1 new obsolescence markers
1824 1832 remote: obsoleted 1 changesets
1825 1833 remote: 1 new orphan changesets
1826 1834
1827 1835 $ release $TESTTMP/watchfile
1828 1836
1829 1837 Check the result of the push
1830 1838
1831 1839 $ cat ./push-log
1832 1840 pushing to ssh://user@dummy/server
1833 1841 searching for changes
1834 1842 wrote ready: $TESTTMP/readyfile
1835 1843 waiting on: $TESTTMP/watchfile
1836 1844 abort: push failed:
1837 1845 'remote repository changed while pushing - please try again'
1838 1846
1839 1847 $ hg -R server debugobsolete
1840 1848 b0ee3d6f51bc4c0ca6d4f2907708027a6c376233 720c5163ecf64dcc6216bee2d62bf3edb1882499 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1841 1849 720c5163ecf64dcc6216bee2d62bf3edb1882499 39bc0598afe90ab18da460bafecc0fa953b77596 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1842 1850 $ hg -R server graph --hidden
1843 1851 * 39bc0598afe9 C-W (default)
1844 1852 |
1845 1853 | * a98a47d8b85b C-U (default)
1846 1854 |/
1847 1855 x b0ee3d6f51bc C-Q (default)
1848 1856 |
1849 1857 | o 3d57ed3c1091 C-T (other)
1850 1858 | |
1851 1859 | o 2efd43f7b5ba C-S (default)
1852 1860 | |
1853 1861 | | o de7b9e2ba3f6 C-R (other)
1854 1862 | |/
1855 1863 | o 1b58ee3f79e5 C-P (default)
1856 1864 | |
1857 1865 | o d0a85b2252a9 C-O (other)
1858 1866 |/
1859 1867 | x 720c5163ecf6 C-V (default)
1860 1868 |/
1861 1869 o 55a6f1c01b48 C-Z (other)
1862 1870 |
1863 1871 o 866a66e18630 C-N (default)
1864 1872 |\
1865 1873 +---o 6fd3090135df C-M (default)
1866 1874 | |
1867 1875 | o cac2cead0ff0 C-L (default)
1868 1876 | |
1869 1877 o | be705100c623 C-K (default)
1870 1878 |\|
1871 1879 o | d603e2c0cdd7 C-E (default)
1872 1880 | |
1873 1881 | o 59e76faf78bd C-D (default)
1874 1882 | |
1875 1883 | | o 89420bf00fae C-J (default)
1876 1884 | | |
1877 1885 | | | o b35ed749f288 C-I (my-second-test-branch)
1878 1886 | | |/
1879 1887 | | o 75d69cba5402 C-G (default)
1880 1888 | | |
1881 1889 | | | o 833be552cfe6 C-H (my-first-test-branch)
1882 1890 | | |/
1883 1891 | | o d9e379a8c432 C-F (default)
1884 1892 | | |
1885 1893 +---o 51c544a58128 C-C (default)
1886 1894 | |
1887 1895 | o a9149a1428e2 C-B (default)
1888 1896 | |
1889 1897 o | 98217d5a1659 C-A (default)
1890 1898 |/
1891 1899 o 842e2fac6304 C-ROOT (default)
1892 1900
General Comments 0
You need to be logged in to leave comments. Login now