Debian Codegraph @

tests/test-push-race.t

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