Show More
@@ -469,3 +469,225 b' Verify that the old context ancestor wor' | |||||
469 | getting d2/b |
|
469 | getting d2/b | |
470 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
470 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
471 | (branch merge, don't forget to commit) |
|
471 | (branch merge, don't forget to commit) | |
|
472 | ||||
|
473 | ||||
|
474 | Check that removal reversion does not go unotified | |||
|
475 | ================================================== | |||
|
476 | ||||
|
477 | On a merge, a file can be removed and user can revert that removal. This means | |||
|
478 | user has made an explicit choice of keeping the file or reverting the removal | |||
|
479 | even though the merge algo wanted to remove it. | |||
|
480 | Based on this, when we do criss cross merges, merge algorithm should not again | |||
|
481 | choose to remove the file as in one of the merges, user made an explicit choice | |||
|
482 | to revert the removal. | |||
|
483 | Following test cases demonstrate how merge algo does not take in account | |||
|
484 | explicit choices made by users to revert the removal and on criss-cross merging | |||
|
485 | removes the file again. | |||
|
486 | ||||
|
487 | "Simple" case where the filenode changes | |||
|
488 | ---------------------------------------- | |||
|
489 | ||||
|
490 | $ cd .. | |||
|
491 | $ hg init criss-cross-merge-reversal-with-update | |||
|
492 | $ cd criss-cross-merge-reversal-with-update | |||
|
493 | $ echo the-file > the-file | |||
|
494 | $ echo other-file > other-file | |||
|
495 | $ hg add the-file other-file | |||
|
496 | $ hg ci -m 'root-commit' | |||
|
497 | $ echo foo >> the-file | |||
|
498 | $ echo bar >> other-file | |||
|
499 | $ hg ci -m 'updating-both-file' | |||
|
500 | $ hg up 'desc("root-commit")' | |||
|
501 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
502 | $ hg rm the-file | |||
|
503 | $ hg ci -m 'delete-the-file' | |||
|
504 | created new head | |||
|
505 | $ hg log -G -T '{node|short} {desc}\n' | |||
|
506 | @ 7801bc9b9899 delete-the-file | |||
|
507 | | | |||
|
508 | | o 9b610631ab29 updating-both-file | |||
|
509 | |/ | |||
|
510 | o 955800955977 root-commit | |||
|
511 | ||||
|
512 | ||||
|
513 | Do all the merge combination (from the deleted or the update side Γ keeping and deleting the file | |||
|
514 | ||||
|
515 | $ hg update 'desc("delete-the-file")' | |||
|
516 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
517 | $ hg merge 'desc("updating-both-file")' -t :local | |||
|
518 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
519 | (branch merge, don't forget to commit) | |||
|
520 | $ hg ci -m "merge-deleting-the-file-from-deleted" | |||
|
521 | $ hg manifest | |||
|
522 | other-file | |||
|
523 | ||||
|
524 | $ hg update 'desc("updating-both-file")' | |||
|
525 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
526 | $ hg merge 'desc("delete-the-file")' -t :other | |||
|
527 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
528 | (branch merge, don't forget to commit) | |||
|
529 | $ hg ci -m "merge-deleting-the-file-from-updated" | |||
|
530 | created new head | |||
|
531 | $ hg manifest | |||
|
532 | other-file | |||
|
533 | ||||
|
534 | $ hg update 'desc("delete-the-file")' | |||
|
535 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
536 | $ hg merge 'desc("updating-both-file")' -t :other | |||
|
537 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
538 | (branch merge, don't forget to commit) | |||
|
539 | $ hg ci -m "merge-keeping-the-file-from-deleted" | |||
|
540 | created new head | |||
|
541 | $ hg manifest | |||
|
542 | other-file | |||
|
543 | the-file | |||
|
544 | ||||
|
545 | $ hg update 'desc("updating-both-file")' | |||
|
546 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
547 | $ hg merge 'desc("delete-the-file")' -t :local | |||
|
548 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
549 | (branch merge, don't forget to commit) | |||
|
550 | $ hg ci -m "merge-keeping-the-file-from-updated" | |||
|
551 | created new head | |||
|
552 | $ hg manifest | |||
|
553 | other-file | |||
|
554 | the-file | |||
|
555 | ||||
|
556 | There the resulting merge together (leading to criss cross situation). Check | |||
|
557 | the conflict is properly detected. | |||
|
558 | ||||
|
559 | (merging two deletion together β no conflict) | |||
|
560 | ||||
|
561 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |||
|
562 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
563 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |||
|
564 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
565 | (branch merge, don't forget to commit) | |||
|
566 | $ ls -1 | |||
|
567 | other-file | |||
|
568 | ||||
|
569 | (merging a deletion with keeping β conflict) | |||
|
570 | BROKEN: this should result in conflict | |||
|
571 | ||||
|
572 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |||
|
573 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
574 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |||
|
575 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
576 | (branch merge, don't forget to commit) | |||
|
577 | $ ls -1 | |||
|
578 | other-file | |||
|
579 | the-file | |||
|
580 | ||||
|
581 | (merging a deletion with keeping β conflict) | |||
|
582 | BROKEN: this should result in conflict | |||
|
583 | ||||
|
584 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |||
|
585 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
586 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |||
|
587 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
588 | (branch merge, don't forget to commit) | |||
|
589 | $ ls -1 | |||
|
590 | other-file | |||
|
591 | the-file | |||
|
592 | ||||
|
593 | (merging two deletion together β no conflict) | |||
|
594 | ||||
|
595 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |||
|
596 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
597 | $ hg merge 'desc("merge-deleting-the-file-from-deleted")' | |||
|
598 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
599 | (branch merge, don't forget to commit) | |||
|
600 | $ ls -1 | |||
|
601 | other-file | |||
|
602 | ||||
|
603 | (merging a deletion with keeping β conflict) | |||
|
604 | BROKEN: this should result in conflict | |||
|
605 | ||||
|
606 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |||
|
607 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
608 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |||
|
609 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
610 | (branch merge, don't forget to commit) | |||
|
611 | $ ls -1 | |||
|
612 | other-file | |||
|
613 | the-file | |||
|
614 | ||||
|
615 | (merging a deletion with keeping β conflict) | |||
|
616 | BROKEN: this should result in conflict | |||
|
617 | ||||
|
618 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |||
|
619 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
620 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |||
|
621 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
622 | (branch merge, don't forget to commit) | |||
|
623 | $ ls -1 | |||
|
624 | other-file | |||
|
625 | the-file | |||
|
626 | ||||
|
627 | (merging two "keeping" together β no conflict) | |||
|
628 | ||||
|
629 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |||
|
630 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
631 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |||
|
632 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
633 | (branch merge, don't forget to commit) | |||
|
634 | $ ls -1 | |||
|
635 | other-file | |||
|
636 | the-file | |||
|
637 | ||||
|
638 | (merging a deletion with keeping β conflict) | |||
|
639 | BROKEN: this should result in conflict | |||
|
640 | ||||
|
641 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |||
|
642 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
643 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |||
|
644 | abort: empty revision set | |||
|
645 | [255] | |||
|
646 | $ ls -1 | |||
|
647 | other-file | |||
|
648 | the-file | |||
|
649 | ||||
|
650 | (merging a deletion with keeping β conflict) | |||
|
651 | BROKEN: this should result in conflict | |||
|
652 | ||||
|
653 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |||
|
654 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
655 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |||
|
656 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
657 | (branch merge, don't forget to commit) | |||
|
658 | $ ls -1 | |||
|
659 | other-file | |||
|
660 | ||||
|
661 | (merging two "keeping" together β no conflict) | |||
|
662 | ||||
|
663 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |||
|
664 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
665 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |||
|
666 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
667 | (branch merge, don't forget to commit) | |||
|
668 | $ ls -1 | |||
|
669 | other-file | |||
|
670 | the-file | |||
|
671 | ||||
|
672 | (merging a deletion with keeping β conflict) | |||
|
673 | BROKEN: this should result in conflict | |||
|
674 | ||||
|
675 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |||
|
676 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
677 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |||
|
678 | abort: empty revision set | |||
|
679 | [255] | |||
|
680 | $ ls -1 | |||
|
681 | other-file | |||
|
682 | the-file | |||
|
683 | ||||
|
684 | (merging a deletion with keeping β conflict) | |||
|
685 | BROKEN: this should result in conflict | |||
|
686 | ||||
|
687 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |||
|
688 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
689 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |||
|
690 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
691 | (branch merge, don't forget to commit) | |||
|
692 | $ ls -1 | |||
|
693 | other-file |
General Comments 0
You need to be logged in to leave comments.
Login now