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