387 adding changesets |
389 adding changesets |
388 adding manifests |
390 adding manifests |
389 adding file changes |
391 adding file changes |
390 added 3 changesets with 3 changes to 1 files |
392 added 3 changesets with 3 changes to 1 files |
391 |
393 |
|
394 for simplicity shake we relocate the bathroom changeset |
|
395 |
|
396 $ hg relocate -r 8d39a843582d 02e33960e937 |
|
397 merging shopping |
|
398 |
|
399 |
|
400 Splitting change |
|
401 ------------------ |
|
402 |
|
403 To be done (currently achieve with "two commit + debugobsolete") |
|
404 |
|
405 Collapsing change |
|
406 ------------------ |
|
407 |
|
408 To be done (currently achieve with "revert + debugobsolete" or "rebase --collapse") |
|
409 |
392 collaboration |
410 collaboration |
393 ==================== |
411 ==================== |
394 |
412 |
395 |
413 |
396 |
414 sharing mutable changeset |
397 We create a central repo (because most workflow include this central repo |
415 ---------------------------- |
398 |
416 |
399 $ cd .. |
417 To share mutable changeset with other just check that both have the "ready" |
400 $ hg init central |
418 state activated. Otherwise you will get the previously observe behavior where |
|
419 exchanged changeset are automatically published. |
|
420 |
|
421 $ cd ../remote |
|
422 $ hg states |
|
423 published |
|
424 |
|
425 The remote repository have only the immutable "published" state activated. Any |
|
426 changeset echanged from "local" to "remote" will be set in the publised state: |
|
427 |
|
428 $ hg -R ../local push -f remote # XXX we should pull but the support is awful |
|
429 pushing to $TESTTMP/remote |
|
430 searching for changes |
|
431 adding changesets |
|
432 adding manifests |
|
433 adding file changes |
|
434 added 1 changesets with 1 changes to 1 files |
|
435 $ hg ttlog |
|
436 a3515e5d0332: 'bathroom stuff' published |
|
437 02e33960e937: 'SPAM SPAM' published |
|
438 387187ad9bd9: 'adding fruit' published |
|
439 dfd3a2d7691e: 'adding condiment' published |
|
440 9ca060c80d74: 'SPAM' published |
|
441 7e82d3f3c2cb: 'Monthy Python Shopping list' published |
|
442 |
|
443 |
|
444 |
|
445 We do not want to publish the "bathroom changeset". Let's rollback the last transaction |
|
446 |
|
447 $ hg rollback |
|
448 repository tip rolled back to revision 4 (undo push) |
|
449 working directory now based on revision 1 |
|
450 $ hg ttlog |
|
451 02e33960e937: 'SPAM SPAM' published |
|
452 387187ad9bd9: 'adding fruit' published |
|
453 dfd3a2d7691e: 'adding condiment' published |
|
454 9ca060c80d74: 'SPAM' published |
|
455 7e82d3f3c2cb: 'Monthy Python Shopping list' published |
|
456 $ rm ../local/.hg/states/published-heads # XXX USE --exact |
|
457 $ hg -R ../local publish 02e33960e937 # XXX FIX THE BUG |
|
458 |
|
459 To enable the mutable "ready" state in a repository, use the states command. |
|
460 |
|
461 $ hg states ready |
|
462 $ hg states |
|
463 published |
|
464 ready |
|
465 |
|
466 I can nom exchange mutable changeset between "remote" and "local" repository. |
|
467 |
|
468 $ hg pull local # XXX We pull too much stuff |
|
469 pulling from $TESTTMP/local |
|
470 searching for changes |
|
471 adding changesets |
|
472 adding manifests |
|
473 adding file changes |
|
474 added 10 changesets with 10 changes to 1 files (+5 heads) |
|
475 (run 'hg heads' to see heads, 'hg merge' to merge) |
|
476 $ hg ttlog |
|
477 a3515e5d0332: 'bathroom stuff' ready |
|
478 02e33960e937: 'SPAM SPAM' published |
|
479 387187ad9bd9: 'adding fruit' published |
|
480 dfd3a2d7691e: 'adding condiment' published |
|
481 9ca060c80d74: 'SPAM' published |
|
482 7e82d3f3c2cb: 'Monthy Python Shopping list' published |
|
483 |
|
484 Rebasing out-of-sync change after update |
|
485 ---------------------------------------------- |
|
486 |
|
487 Remotely someone add a new changeset on top of our mutable "bathroom" on. |
|
488 |
|
489 $ hg up a3515e5d0332 -q |
|
490 $ cat >> shopping << EOF |
|
491 > Giraffe |
|
492 > Rhino |
|
493 > Lion |
|
494 > Bear |
|
495 > EOF |
|
496 $ hg ci -m 'animals' -q # XXX remove the -q |
|
497 |
|
498 While this time locally, we rebase the updated the "bathroom changeset" |
|
499 |
|
500 $ cd ../local |
|
501 $ hg up a3515e5d0332 -q |
|
502 $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping |
|
503 $ hg amend |
|
504 $ hg tlog |
|
505 962d3a7d27ad: 'bathroom stuff' |
|
506 02e33960e937: 'SPAM SPAM' |
|
507 387187ad9bd9: 'adding fruit' |
|
508 dfd3a2d7691e: 'adding condiment' |
|
509 9ca060c80d74: 'SPAM' |
|
510 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
511 |
|
512 |
|
513 When we pull from remote again we get an unstable state! |
|
514 |
|
515 $ hg pull remote |
|
516 pulling from $TESTTMP/remote |
|
517 searching for changes |
|
518 adding changesets |
|
519 adding manifests |
|
520 adding file changes |
|
521 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
522 (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
523 $ hg tlog |
|
524 0b061760b677: 'animals' |
|
525 962d3a7d27ad: 'bathroom stuff' |
|
526 a3515e5d0332: 'bathroom stuff' |
|
527 02e33960e937: 'SPAM SPAM' |
|
528 387187ad9bd9: 'adding fruit' |
|
529 dfd3a2d7691e: 'adding condiment' |
|
530 9ca060c80d74: 'SPAM' |
|
531 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
532 |
|
533 The new changeset "animal" is based one an old changeset of "bathroom". You can |
|
534 see both version showing up the log. |
|
535 |
|
536 $ hg tglog -r '::(962d3a7d27ad + 0b061760b677)' |
|
537 o 0b061760b677: 'animals' |
|
538 | |
|
539 | @ 962d3a7d27ad: 'bathroom stuff' |
|
540 | | |
|
541 o | a3515e5d0332: 'bathroom stuff' |
|
542 |/ |
|
543 o 02e33960e937: 'SPAM SPAM' |
|
544 | |
|
545 o 387187ad9bd9: 'adding fruit' |
|
546 | |
|
547 o dfd3a2d7691e: 'adding condiment' |
|
548 | |
|
549 o 9ca060c80d74: 'SPAM' |
|
550 | |
|
551 o 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
552 |
|
553 |
|
554 In hgviewn there is a nice doted relation highlighting 962d3a7d27ad is a new |
|
555 version of a3515e5d0332. this is not yet ported to graphlog. |
|
556 |
|
557 To resolve this unstable state, you need to relocate 0b061760b677 onto |
|
558 962d3a7d27ad the "hg evolve" will make the thinking for you and suggest it to |
|
559 you. |
|
560 |
|
561 $ hg evolve |
|
562 hg relocate --rev 0b061760b677 962d3a7d27ad |
|
563 |
|
564 Let's do it |
|
565 |
|
566 $ hg relocate --rev 0b061760b677 962d3a7d27ad |
|
567 merging shopping |
|
568 |
|
569 The old vesion of bathroom is hidden again now. |
|
570 |
|
571 $ hg tlog |
|
572 39a85a192689: 'animals' |
|
573 962d3a7d27ad: 'bathroom stuff' |
|
574 02e33960e937: 'SPAM SPAM' |
|
575 387187ad9bd9: 'adding fruit' |
|
576 dfd3a2d7691e: 'adding condiment' |
|
577 9ca060c80d74: 'SPAM' |
|
578 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
579 |
|
580 We can push this evolution to remote |
|
581 |
|
582 $ hg push -f remote # XXX should not require -f |
|
583 pushing to $TESTTMP/remote |
|
584 searching for changes |
|
585 adding changesets |
|
586 adding manifests |
|
587 adding file changes |
|
588 added 2 changesets with 2 changes to 1 files (+1 heads) |
|
589 |
|
590 remote get a warning that current working directory is based on an obsolete changeset |
|
591 |
|
592 $ cd ../remote |
|
593 $ hg up . # XXX "loulz" |
|
594 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
595 Working directory parent is obsolete |
|
596 |
|
597 $ hg up 39a85a192689 |
|
598 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
599 |
|
600 Relocating out-of-sync change after kill |
|
601 ---------------------------------------------- |
|
602 |
|
603 The remote guy keep working |
|
604 |
|
605 $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping |
|
606 $ hg commit -m "SPAM SPAM SPAM" |
|
607 |
|
608 Work I can keep getting localy |
|
609 |
|
610 $ cd ../local |
|
611 $ hg pull remote |
|
612 pulling from $TESTTMP/remote |
|
613 searching for changes |
|
614 adding changesets |
|
615 adding manifests |
|
616 adding file changes |
|
617 added 1 changesets with 1 changes to 1 files |
|
618 (run 'hg update' to get a working copy) |
|
619 $ hg tlog |
|
620 e768beeb835c: 'SPAM SPAM SPAM' |
|
621 39a85a192689: 'animals' |
|
622 962d3a7d27ad: 'bathroom stuff' |
|
623 02e33960e937: 'SPAM SPAM' |
|
624 387187ad9bd9: 'adding fruit' |
|
625 dfd3a2d7691e: 'adding condiment' |
|
626 9ca060c80d74: 'SPAM' |
|
627 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
628 |
|
629 In the mean time I noticed you can't buy animals in a super market and I kill the animal changeset: |
|
630 |
|
631 $ hg kill 39a85a192689 # issue warning here |
|
632 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
633 working directory now at 962d3a7d27ad |
|
634 |
|
635 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset |
|
636 is neither dead or obsolete. My repository is in an unstable state again. |
|
637 |
|
638 $ hg tlog |
|
639 e768beeb835c: 'SPAM SPAM SPAM' |
|
640 39a85a192689: 'animals' |
|
641 962d3a7d27ad: 'bathroom stuff' |
|
642 02e33960e937: 'SPAM SPAM' |
|
643 387187ad9bd9: 'adding fruit' |
|
644 dfd3a2d7691e: 'adding condiment' |
|
645 9ca060c80d74: 'SPAM' |
|
646 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
647 $ hg tglog -r '::e768beeb835c' |
|
648 o e768beeb835c: 'SPAM SPAM SPAM' |
|
649 | |
|
650 o 39a85a192689: 'animals' |
|
651 | |
|
652 @ 962d3a7d27ad: 'bathroom stuff' |
|
653 | |
|
654 o 02e33960e937: 'SPAM SPAM' |
|
655 | |
|
656 o 387187ad9bd9: 'adding fruit' |
|
657 | |
|
658 o dfd3a2d7691e: 'adding condiment' |
|
659 | |
|
660 o 9ca060c80d74: 'SPAM' |
|
661 | |
|
662 o 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
663 |
|
664 |
|
665 # $ hg evolve # XXX not ready yet |
|
666 # hg relocate --rev e768beeb835c 962d3a7d27ad |
|
667 |
|
668 $ hg relocate -r e768beeb835c 'p1(39a85a192689)' |
|
669 merging shopping |
|
670 |
|
671 $ hg tlog |
|
672 19098f8178f3: 'SPAM SPAM SPAM' |
|
673 962d3a7d27ad: 'bathroom stuff' |
|
674 02e33960e937: 'SPAM SPAM' |
|
675 387187ad9bd9: 'adding fruit' |
|
676 dfd3a2d7691e: 'adding condiment' |
|
677 9ca060c80d74: 'SPAM' |
|
678 7e82d3f3c2cb: 'Monthy Python Shopping list' |
|
679 |
|
680 Handling Conflicting amend |
|
681 ---------------------------------------------- |
|
682 |
|
683 We can detect that multiple diverging//conflicting amend have been made. There |
|
684 will be a "evol-merge" command to merge conflicting amend |
|
685 |
|
686 collaboration |
|
687 ==================== |
|
688 |
|
689 Turning changeset immutable |
|
690 ---------------------------------------------- |
|
691 |
|
692 * push on published//only repo |
|
693 |
|
694 * tag |
|
695 |
|
696 * explicite published command |
|
697 |
|
698 Handling Invalid amend on published changeset |
|
699 ---------------------------------------------- |
|
700 |
|
701 you can't amend published changeset. changeset that do this will have an "invalid amend" obsolete-status |
|
702 |