Show More
This diff has been collapsed as it changes many lines, (779 lines changed) Show them Hide them | |||||
@@ -398,26 +398,23 b' revert file added by p2() to p1() state' | |||||
398 | Systematic behavior validation of most possible cases |
|
398 | Systematic behavior validation of most possible cases | |
399 | ===================================================== |
|
399 | ===================================================== | |
400 |
|
400 | |||
401 |
This section tests most of the possible combinations of |
|
401 | This section tests most of the possible combinations of revision states and | |
402 |
|
|
402 | working directory states. The number of possible cases is significant but they | |
403 | but they all have a slightly different handling. So this section commits to |
|
403 | but they all have a slightly different handling. So this section commits to | |
404 |
|
|
404 | and testing all of them to allow safe refactoring of the revert code. | |
405 |
|
405 | |||
406 | A python script is used to generate a file history for each combination of |
|
406 | A python script is used to generate a file history for each combination of | |
407 | changes between, on one side the working directory and its parent and on |
|
407 | states, on one side the content (or lack thereof) in two revisions, and | |
408 | the other side, changes between a revert target (--rev) and working directory |
|
408 | on the other side, the content and "tracked-ness" of the working directory. The | |
409 |
|
|
409 | three states generated are: | |
410 |
|
410 | |||
411 | - a "base" revision |
|
411 | - a "base" revision | |
412 | - a "parent" revision |
|
412 | - a "parent" revision | |
413 | - the working directory (based on "parent") |
|
413 | - the working directory (based on "parent") | |
414 |
|
414 | |||
415 | The file generated have names of the form: |
|
415 | The files generated have names of the form: | |
416 |
|
416 | |||
417 | <changeset-state>_<working-copy-state> |
|
417 | <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness> | |
418 |
|
||||
419 | Here, "changeset-state" conveys the state in "base" and "parent" (or the change |
|
|||
420 | that happen between them), "working-copy-state" is self explanatory. |
|
|||
421 |
|
418 | |||
422 | All known states are not tested yet. See inline documentation for details. |
|
419 | All known states are not tested yet. See inline documentation for details. | |
423 | Special cases from merge and rename are not tested by this section. |
|
420 | Special cases from merge and rename are not tested by this section. | |
@@ -434,13 +431,13 b' Write the python script to disk' | |||||
434 | > # None means no file at all |
|
431 | > # None means no file at all | |
435 | > ctxcontent = { |
|
432 | > ctxcontent = { | |
436 | > # clean: no change from base to parent |
|
433 | > # clean: no change from base to parent | |
437 |
> 'clean': [' |
|
434 | > 'clean': ['content1', 'content1'], | |
438 | > # modified: file content change from base to parent |
|
435 | > # modified: file content change from base to parent | |
439 |
> 'modified': [' |
|
436 | > 'modified': ['content1', 'content2'], | |
440 | > # added: file is missing from base and added in parent |
|
437 | > # added: file is missing from base and added in parent | |
441 |
> 'added': [None, ' |
|
438 | > 'added': [None, 'content2'], | |
442 | > # removed: file exist in base but is removed from parent |
|
439 | > # removed: file exist in base but is removed from parent | |
443 |
> 'removed': [' |
|
440 | > 'removed': ['content1', None], | |
444 | > # file exist neither in base not in parent |
|
441 | > # file exist neither in base not in parent | |
445 | > 'missing': [None, None], |
|
442 | > 'missing': [None, None], | |
446 | > } |
|
443 | > } | |
@@ -448,25 +445,25 b' Write the python script to disk' | |||||
448 | > # content of file in working copy |
|
445 | > # content of file in working copy | |
449 | > wccontent = { |
|
446 | > wccontent = { | |
450 | > # clean: wc content is the same as parent |
|
447 | > # clean: wc content is the same as parent | |
451 | > 'clean': lambda cc: cc[1], |
|
448 | > 'clean': (True, lambda cc: cc[1]), | |
452 | > # revert: wc content is the same as base |
|
449 | > # revert: wc content is the same as base | |
453 | > 'revert': lambda cc: cc[0], |
|
450 | > 'revert': (True, lambda cc: cc[0]), | |
454 | > # wc: file exist with a content different from base and parent |
|
451 | > # wc: file exist with a content different from base and parent | |
455 |
> 'wc': lambda cc: ' |
|
452 | > 'wc': (True, lambda cc: 'content3'), | |
456 | > # deleted: file is recorded as tracked but missing |
|
453 | > # deleted: file is recorded as tracked but missing | |
457 | > # rely on file deletion outside of this script |
|
454 | > # rely on file deletion outside of this script | |
458 | > 'deleted': lambda cc:'TOBEDELETED', |
|
455 | > 'deleted': (True, lambda cc:'TOBEDELETED'), | |
459 | > } |
|
456 | > } | |
460 | > # untracked-X is a version of X where the file is not tracked (? unknown) |
|
457 | > # untracked-X is a version of X where the file is not tracked (? unknown) | |
461 | > wccontent['untracked-clean'] = wccontent['clean'] |
|
458 | > wccontent['untracked-clean'] = (False, wccontent['clean'][1]) | |
462 | > wccontent['untracked-deleted'] = wccontent['deleted'] |
|
459 | > wccontent['untracked-deleted'] = (False, wccontent['deleted'][1]) | |
463 | > wccontent['untracked-revert'] = wccontent['revert'] |
|
460 | > wccontent['untracked-revert'] = (False, wccontent['revert'][1]) | |
464 | > wccontent['untracked-wc'] = wccontent['wc'] |
|
461 | > wccontent['untracked-wc'] = (False, wccontent['wc'][1]) | |
465 | > |
|
462 | > | |
466 | > # build the combination of possible states |
|
463 | > # build the combination of possible states | |
467 | > combination = [] |
|
464 | > combination = [] | |
468 | > for ctxkey, ctxvalue in sorted(ctxcontent.iteritems()): |
|
465 | > for ctxkey, ctxvalue in sorted(ctxcontent.iteritems()): | |
469 | > for wckey in sorted(wccontent): |
|
466 | > for wckey, (tracked, wcfunc) in sorted(wccontent.iteritems()): | |
470 | > base, parent = ctxvalue |
|
467 | > base, parent = ctxvalue | |
471 | > if (base == parent and 'revert' in wckey): |
|
468 | > if (base == parent and 'revert' in wckey): | |
472 | > continue |
|
469 | > continue | |
@@ -474,9 +471,15 b' Write the python script to disk' | |||||
474 | > continue |
|
471 | > continue | |
475 | > if not parent and 'deleted' in wckey: |
|
472 | > if not parent and 'deleted' in wckey: | |
476 | > continue |
|
473 | > continue | |
477 | > filename = "%s_%s" % (ctxkey, wckey) |
|
474 | > def statestring(content): | |
478 | > combination.append((filename, base, parent, |
|
475 | > return content in (None, 'TOBEDELETED') and 'missing' or content | |
479 | > wccontent[wckey](ctxvalue))) |
|
476 | > wcc = wcfunc(ctxvalue) | |
|
477 | > trackedstring = tracked and 'tracked' or 'untracked' | |||
|
478 | > filename = "%s_%s_%s-%s" % (statestring(base), | |||
|
479 | > statestring(parent), | |||
|
480 | > statestring(wcc), | |||
|
481 | > trackedstring) | |||
|
482 | > combination.append((filename, base, parent, wcc)) | |||
480 | > |
|
483 | > | |
481 | > # retrieve the state we must generate |
|
484 | > # retrieve the state we must generate | |
482 | > target = sys.argv[1] |
|
485 | > target = sys.argv[1] | |
@@ -509,36 +512,36 b' Write the python script to disk' | |||||
509 | check list of planned files |
|
512 | check list of planned files | |
510 |
|
513 | |||
511 | $ python gen-revert-cases.py filelist |
|
514 | $ python gen-revert-cases.py filelist | |
512 | added_clean |
|
515 | missing_content2_content2-tracked | |
513 | added_deleted |
|
516 | missing_content2_missing-tracked | |
514 | added_untracked-clean |
|
517 | missing_content2_content2-untracked | |
515 | added_untracked-deleted |
|
518 | missing_content2_missing-untracked | |
516 | added_untracked-wc |
|
519 | missing_content2_content3-untracked | |
517 | added_wc |
|
520 | missing_content2_content3-tracked | |
518 | clean_clean |
|
521 | content1_content1_content1-tracked | |
519 | clean_deleted |
|
522 | content1_content1_missing-tracked | |
520 | clean_untracked-clean |
|
523 | content1_content1_content1-untracked | |
521 | clean_untracked-deleted |
|
524 | content1_content1_missing-untracked | |
522 | clean_untracked-wc |
|
525 | content1_content1_content3-untracked | |
523 | clean_wc |
|
526 | content1_content1_content3-tracked | |
524 | missing_clean |
|
527 | missing_missing_missing-tracked | |
525 |
missing_untracked |
|
528 | missing_missing_missing-untracked | |
526 |
missing_untracked |
|
529 | missing_missing_content3-untracked | |
527 | missing_wc |
|
530 | missing_missing_content3-tracked | |
528 | modified_clean |
|
531 | content1_content2_content2-tracked | |
529 | modified_deleted |
|
532 | content1_content2_missing-tracked | |
530 | modified_revert |
|
533 | content1_content2_content1-tracked | |
531 | modified_untracked-clean |
|
534 | content1_content2_content2-untracked | |
532 | modified_untracked-deleted |
|
535 | content1_content2_missing-untracked | |
533 | modified_untracked-revert |
|
536 | content1_content2_content1-untracked | |
534 | modified_untracked-wc |
|
537 | content1_content2_content3-untracked | |
535 | modified_wc |
|
538 | content1_content2_content3-tracked | |
536 | removed_clean |
|
539 | content1_missing_missing-tracked | |
537 | removed_revert |
|
540 | content1_missing_content1-tracked | |
538 | removed_untracked-clean |
|
541 | content1_missing_missing-untracked | |
539 | removed_untracked-revert |
|
542 | content1_missing_content1-untracked | |
540 | removed_untracked-wc |
|
543 | content1_missing_content3-untracked | |
541 | removed_wc |
|
544 | content1_missing_content3-tracked | |
542 |
|
545 | |||
543 | Script to make a simple text version of the content |
|
546 | Script to make a simple text version of the content | |
544 | --------------------------------------------------- |
|
547 | --------------------------------------------------- | |
@@ -565,223 +568,223 b' Generate base changeset' | |||||
565 |
|
568 | |||
566 | $ python ../gen-revert-cases.py base |
|
569 | $ python ../gen-revert-cases.py base | |
567 | $ hg addremove --similarity 0 |
|
570 | $ hg addremove --similarity 0 | |
568 | adding clean_clean |
|
571 | adding content1_content1_content1-tracked | |
569 | adding clean_deleted |
|
572 | adding content1_content1_content1-untracked | |
570 | adding clean_untracked-clean |
|
573 | adding content1_content1_content3-tracked | |
571 | adding clean_untracked-deleted |
|
574 | adding content1_content1_content3-untracked | |
572 |
adding c |
|
575 | adding content1_content1_missing-tracked | |
573 | adding clean_wc |
|
576 | adding content1_content1_missing-untracked | |
574 | adding modified_clean |
|
577 | adding content1_content2_content1-tracked | |
575 | adding modified_deleted |
|
578 | adding content1_content2_content1-untracked | |
576 | adding modified_revert |
|
579 | adding content1_content2_content2-tracked | |
577 | adding modified_untracked-clean |
|
580 | adding content1_content2_content2-untracked | |
578 | adding modified_untracked-deleted |
|
581 | adding content1_content2_content3-tracked | |
579 | adding modified_untracked-revert |
|
582 | adding content1_content2_content3-untracked | |
580 | adding modified_untracked-wc |
|
583 | adding content1_content2_missing-tracked | |
581 | adding modified_wc |
|
584 | adding content1_content2_missing-untracked | |
582 | adding removed_clean |
|
585 | adding content1_missing_content1-tracked | |
583 | adding removed_revert |
|
586 | adding content1_missing_content1-untracked | |
584 | adding removed_untracked-clean |
|
587 | adding content1_missing_content3-tracked | |
585 | adding removed_untracked-revert |
|
588 | adding content1_missing_content3-untracked | |
586 | adding removed_untracked-wc |
|
589 | adding content1_missing_missing-tracked | |
587 | adding removed_wc |
|
590 | adding content1_missing_missing-untracked | |
588 | $ hg status |
|
591 | $ hg status | |
589 | A clean_clean |
|
592 | A content1_content1_content1-tracked | |
590 | A clean_deleted |
|
593 | A content1_content1_content1-untracked | |
591 | A clean_untracked-clean |
|
594 | A content1_content1_content3-tracked | |
592 | A clean_untracked-deleted |
|
595 | A content1_content1_content3-untracked | |
593 | A clean_untracked-wc |
|
596 | A content1_content1_missing-tracked | |
594 | A clean_wc |
|
597 | A content1_content1_missing-untracked | |
595 | A modified_clean |
|
598 | A content1_content2_content1-tracked | |
596 | A modified_deleted |
|
599 | A content1_content2_content1-untracked | |
597 | A modified_revert |
|
600 | A content1_content2_content2-tracked | |
598 | A modified_untracked-clean |
|
601 | A content1_content2_content2-untracked | |
599 | A modified_untracked-deleted |
|
602 | A content1_content2_content3-tracked | |
600 | A modified_untracked-revert |
|
603 | A content1_content2_content3-untracked | |
601 | A modified_untracked-wc |
|
604 | A content1_content2_missing-tracked | |
602 | A modified_wc |
|
605 | A content1_content2_missing-untracked | |
603 | A removed_clean |
|
606 | A content1_missing_content1-tracked | |
604 | A removed_revert |
|
607 | A content1_missing_content1-untracked | |
605 | A removed_untracked-clean |
|
608 | A content1_missing_content3-tracked | |
606 | A removed_untracked-revert |
|
609 | A content1_missing_content3-untracked | |
607 | A removed_untracked-wc |
|
610 | A content1_missing_missing-tracked | |
608 | A removed_wc |
|
611 | A content1_missing_missing-untracked | |
609 | $ hg commit -m 'base' |
|
612 | $ hg commit -m 'base' | |
610 |
|
613 | |||
611 | (create a simple text version of the content) |
|
614 | (create a simple text version of the content) | |
612 |
|
615 | |||
613 | $ python ../dircontent.py > ../content-base.txt |
|
616 | $ python ../dircontent.py > ../content-base.txt | |
614 | $ cat ../content-base.txt |
|
617 | $ cat ../content-base.txt | |
615 | base clean_clean |
|
618 | content1 content1_content1_content1-tracked | |
616 | base clean_deleted |
|
619 | content1 content1_content1_content1-untracked | |
617 | base clean_untracked-clean |
|
620 | content1 content1_content1_content3-tracked | |
618 | base clean_untracked-deleted |
|
621 | content1 content1_content1_content3-untracked | |
619 | base clean_untracked-wc |
|
622 | content1 content1_content1_missing-tracked | |
620 | base clean_wc |
|
623 | content1 content1_content1_missing-untracked | |
621 | base modified_clean |
|
624 | content1 content1_content2_content1-tracked | |
622 | base modified_deleted |
|
625 | content1 content1_content2_content1-untracked | |
623 | base modified_revert |
|
626 | content1 content1_content2_content2-tracked | |
624 | base modified_untracked-clean |
|
627 | content1 content1_content2_content2-untracked | |
625 | base modified_untracked-deleted |
|
628 | content1 content1_content2_content3-tracked | |
626 | base modified_untracked-revert |
|
629 | content1 content1_content2_content3-untracked | |
627 | base modified_untracked-wc |
|
630 | content1 content1_content2_missing-tracked | |
628 | base modified_wc |
|
631 | content1 content1_content2_missing-untracked | |
629 | base removed_clean |
|
632 | content1 content1_missing_content1-tracked | |
630 | base removed_revert |
|
633 | content1 content1_missing_content1-untracked | |
631 | base removed_untracked-clean |
|
634 | content1 content1_missing_content3-tracked | |
632 | base removed_untracked-revert |
|
635 | content1 content1_missing_content3-untracked | |
633 | base removed_untracked-wc |
|
636 | content1 content1_missing_missing-tracked | |
634 | base removed_wc |
|
637 | content1 content1_missing_missing-untracked | |
635 |
|
638 | |||
636 | Create parent changeset |
|
639 | Create parent changeset | |
637 |
|
640 | |||
638 | $ python ../gen-revert-cases.py parent |
|
641 | $ python ../gen-revert-cases.py parent | |
639 | $ hg addremove --similarity 0 |
|
642 | $ hg addremove --similarity 0 | |
640 | adding added_clean |
|
643 | removing content1_missing_content1-tracked | |
641 | adding added_deleted |
|
644 | removing content1_missing_content1-untracked | |
642 | adding added_untracked-clean |
|
645 | removing content1_missing_content3-tracked | |
643 | adding added_untracked-deleted |
|
646 | removing content1_missing_content3-untracked | |
644 | adding added_untracked-wc |
|
647 | removing content1_missing_missing-tracked | |
645 | adding added_wc |
|
648 | removing content1_missing_missing-untracked | |
646 | removing removed_clean |
|
649 | adding missing_content2_content2-tracked | |
647 | removing removed_revert |
|
650 | adding missing_content2_content2-untracked | |
648 | removing removed_untracked-clean |
|
651 | adding missing_content2_content3-tracked | |
649 | removing removed_untracked-revert |
|
652 | adding missing_content2_content3-untracked | |
650 | removing removed_untracked-wc |
|
653 | adding missing_content2_missing-tracked | |
651 | removing removed_wc |
|
654 | adding missing_content2_missing-untracked | |
652 | $ hg status |
|
655 | $ hg status | |
653 | M modified_clean |
|
656 | M content1_content2_content1-tracked | |
654 | M modified_deleted |
|
657 | M content1_content2_content1-untracked | |
655 | M modified_revert |
|
658 | M content1_content2_content2-tracked | |
656 | M modified_untracked-clean |
|
659 | M content1_content2_content2-untracked | |
657 | M modified_untracked-deleted |
|
660 | M content1_content2_content3-tracked | |
658 | M modified_untracked-revert |
|
661 | M content1_content2_content3-untracked | |
659 | M modified_untracked-wc |
|
662 | M content1_content2_missing-tracked | |
660 | M modified_wc |
|
663 | M content1_content2_missing-untracked | |
661 | A added_clean |
|
664 | A missing_content2_content2-tracked | |
662 | A added_deleted |
|
665 | A missing_content2_content2-untracked | |
663 | A added_untracked-clean |
|
666 | A missing_content2_content3-tracked | |
664 | A added_untracked-deleted |
|
667 | A missing_content2_content3-untracked | |
665 | A added_untracked-wc |
|
668 | A missing_content2_missing-tracked | |
666 | A added_wc |
|
669 | A missing_content2_missing-untracked | |
667 | R removed_clean |
|
670 | R content1_missing_content1-tracked | |
668 | R removed_revert |
|
671 | R content1_missing_content1-untracked | |
669 | R removed_untracked-clean |
|
672 | R content1_missing_content3-tracked | |
670 | R removed_untracked-revert |
|
673 | R content1_missing_content3-untracked | |
671 | R removed_untracked-wc |
|
674 | R content1_missing_missing-tracked | |
672 | R removed_wc |
|
675 | R content1_missing_missing-untracked | |
673 | $ hg commit -m 'parent' |
|
676 | $ hg commit -m 'parent' | |
674 |
|
677 | |||
675 | (create a simple text version of the content) |
|
678 | (create a simple text version of the content) | |
676 |
|
679 | |||
677 | $ python ../dircontent.py > ../content-parent.txt |
|
680 | $ python ../dircontent.py > ../content-parent.txt | |
678 | $ cat ../content-parent.txt |
|
681 | $ cat ../content-parent.txt | |
679 | parent added_clean |
|
682 | content1 content1_content1_content1-tracked | |
680 | parent added_deleted |
|
683 | content1 content1_content1_content1-untracked | |
681 | parent added_untracked-clean |
|
684 | content1 content1_content1_content3-tracked | |
682 | parent added_untracked-deleted |
|
685 | content1 content1_content1_content3-untracked | |
683 | parent added_untracked-wc |
|
686 | content1 content1_content1_missing-tracked | |
684 | parent added_wc |
|
687 | content1 content1_content1_missing-untracked | |
685 | base clean_clean |
|
688 | content2 content1_content2_content1-tracked | |
686 | base clean_deleted |
|
689 | content2 content1_content2_content1-untracked | |
687 | base clean_untracked-clean |
|
690 | content2 content1_content2_content2-tracked | |
688 | base clean_untracked-deleted |
|
691 | content2 content1_content2_content2-untracked | |
689 | base clean_untracked-wc |
|
692 | content2 content1_content2_content3-tracked | |
690 | base clean_wc |
|
693 | content2 content1_content2_content3-untracked | |
691 | parent modified_clean |
|
694 | content2 content1_content2_missing-tracked | |
692 | parent modified_deleted |
|
695 | content2 content1_content2_missing-untracked | |
693 | parent modified_revert |
|
696 | content2 missing_content2_content2-tracked | |
694 | parent modified_untracked-clean |
|
697 | content2 missing_content2_content2-untracked | |
695 | parent modified_untracked-deleted |
|
698 | content2 missing_content2_content3-tracked | |
696 | parent modified_untracked-revert |
|
699 | content2 missing_content2_content3-untracked | |
697 | parent modified_untracked-wc |
|
700 | content2 missing_content2_missing-tracked | |
698 | parent modified_wc |
|
701 | content2 missing_content2_missing-untracked | |
699 |
|
702 | |||
700 | Setup working directory |
|
703 | Setup working directory | |
701 |
|
704 | |||
702 | $ python ../gen-revert-cases.py wc |
|
705 | $ python ../gen-revert-cases.py wc | |
703 | $ hg addremove --similarity 0 |
|
706 | $ hg addremove --similarity 0 | |
704 |
adding missing_ |
|
707 | adding content1_missing_content1-tracked | |
705 | adding missing_wc |
|
708 | adding content1_missing_content1-untracked | |
706 | adding removed_revert |
|
709 | adding content1_missing_content3-tracked | |
707 | adding removed_untracked-revert |
|
710 | adding content1_missing_content3-untracked | |
708 | adding removed_untracked-wc |
|
711 | adding missing_missing_content3-tracked | |
709 | adding removed_wc |
|
712 | adding missing_missing_content3-untracked | |
710 |
$ hg forget *untracked |
|
713 | $ hg forget *_*_*-untracked | |
711 | $ rm *deleted* |
|
714 | $ rm *_*_missing-* | |
712 | $ hg status |
|
715 | $ hg status | |
713 | M added_wc |
|
716 | M content1_content1_content3-tracked | |
714 | M clean_wc |
|
717 | M content1_content2_content1-tracked | |
715 | M modified_revert |
|
718 | M content1_content2_content3-tracked | |
716 | M modified_wc |
|
719 | M missing_content2_content3-tracked | |
717 | A missing_wc |
|
720 | A content1_missing_content1-tracked | |
718 | A removed_revert |
|
721 | A content1_missing_content3-tracked | |
719 | A removed_wc |
|
722 | A missing_missing_content3-tracked | |
720 | R added_untracked-clean |
|
723 | R content1_content1_content1-untracked | |
721 | R added_untracked-deleted |
|
724 | R content1_content1_content3-untracked | |
722 | R added_untracked-wc |
|
725 | R content1_content1_missing-untracked | |
723 | R clean_untracked-clean |
|
726 | R content1_content2_content1-untracked | |
724 | R clean_untracked-deleted |
|
727 | R content1_content2_content2-untracked | |
725 | R clean_untracked-wc |
|
728 | R content1_content2_content3-untracked | |
726 | R modified_untracked-clean |
|
729 | R content1_content2_missing-untracked | |
727 | R modified_untracked-deleted |
|
730 | R missing_content2_content2-untracked | |
728 | R modified_untracked-revert |
|
731 | R missing_content2_content3-untracked | |
729 | R modified_untracked-wc |
|
732 | R missing_content2_missing-untracked | |
730 | ! added_deleted |
|
733 | ! content1_content1_missing-tracked | |
731 | ! clean_deleted |
|
734 | ! content1_content2_missing-tracked | |
732 | ! modified_deleted |
|
735 | ! missing_content2_missing-tracked | |
733 |
? missing_untracked |
|
736 | ? content1_missing_content1-untracked | |
734 | ? removed_untracked-revert |
|
737 | ? content1_missing_content3-untracked | |
735 | ? removed_untracked-wc |
|
738 | ? missing_missing_content3-untracked | |
736 |
|
739 | |||
737 | $ hg status --rev 'desc("base")' |
|
740 | $ hg status --rev 'desc("base")' | |
738 | M clean_wc |
|
741 | M content1_content1_content3-tracked | |
739 | M modified_clean |
|
742 | M content1_content2_content2-tracked | |
740 | M modified_wc |
|
743 | M content1_content2_content3-tracked | |
741 | M removed_wc |
|
744 | M content1_missing_content3-tracked | |
742 | A added_clean |
|
745 | A missing_content2_content2-tracked | |
743 | A added_wc |
|
746 | A missing_content2_content3-tracked | |
744 | A missing_wc |
|
747 | A missing_missing_content3-tracked | |
745 | R clean_untracked-clean |
|
748 | R content1_content1_content1-untracked | |
746 | R clean_untracked-deleted |
|
749 | R content1_content1_content3-untracked | |
747 | R clean_untracked-wc |
|
750 | R content1_content1_missing-untracked | |
748 | R modified_untracked-clean |
|
751 | R content1_content2_content1-untracked | |
749 | R modified_untracked-deleted |
|
752 | R content1_content2_content2-untracked | |
750 | R modified_untracked-revert |
|
753 | R content1_content2_content3-untracked | |
751 | R modified_untracked-wc |
|
754 | R content1_content2_missing-untracked | |
752 | R removed_clean |
|
755 | R content1_missing_content1-untracked | |
753 | R removed_untracked-clean |
|
756 | R content1_missing_content3-untracked | |
754 | R removed_untracked-revert |
|
757 | R content1_missing_missing-tracked | |
755 | R removed_untracked-wc |
|
758 | R content1_missing_missing-untracked | |
756 | ! added_deleted |
|
759 | ! content1_content1_missing-tracked | |
757 | ! clean_deleted |
|
760 | ! content1_content2_missing-tracked | |
758 | ! modified_deleted |
|
761 | ! missing_content2_missing-tracked | |
759 |
? missing_untracked |
|
762 | ? missing_missing_content3-untracked | |
760 |
|
763 | |||
761 | (create a simple text version of the content) |
|
764 | (create a simple text version of the content) | |
762 |
|
765 | |||
763 | $ python ../dircontent.py > ../content-wc.txt |
|
766 | $ python ../dircontent.py > ../content-wc.txt | |
764 | $ cat ../content-wc.txt |
|
767 | $ cat ../content-wc.txt | |
765 | parent added_clean |
|
768 | content1 content1_content1_content1-tracked | |
766 | parent added_untracked-clean |
|
769 | content1 content1_content1_content1-untracked | |
767 | wc added_untracked-wc |
|
770 | content3 content1_content1_content3-tracked | |
768 | wc added_wc |
|
771 | content3 content1_content1_content3-untracked | |
769 | base clean_clean |
|
772 | content1 content1_content2_content1-tracked | |
770 | base clean_untracked-clean |
|
773 | content1 content1_content2_content1-untracked | |
771 | wc clean_untracked-wc |
|
774 | content2 content1_content2_content2-tracked | |
772 | wc clean_wc |
|
775 | content2 content1_content2_content2-untracked | |
773 | wc missing_untracked-wc |
|
776 | content3 content1_content2_content3-tracked | |
774 | wc missing_wc |
|
777 | content3 content1_content2_content3-untracked | |
775 | parent modified_clean |
|
778 | content1 content1_missing_content1-tracked | |
776 | base modified_revert |
|
779 | content1 content1_missing_content1-untracked | |
777 | parent modified_untracked-clean |
|
780 | content3 content1_missing_content3-tracked | |
778 | base modified_untracked-revert |
|
781 | content3 content1_missing_content3-untracked | |
779 | wc modified_untracked-wc |
|
782 | content2 missing_content2_content2-tracked | |
780 | wc modified_wc |
|
783 | content2 missing_content2_content2-untracked | |
781 | base removed_revert |
|
784 | content3 missing_content2_content3-tracked | |
782 | base removed_untracked-revert |
|
785 | content3 missing_content2_content3-untracked | |
783 | wc removed_untracked-wc |
|
786 | content3 missing_missing_content3-tracked | |
784 | wc removed_wc |
|
787 | content3 missing_missing_content3-untracked | |
785 |
|
788 | |||
786 | $ cd .. |
|
789 | $ cd .. | |
787 |
|
790 | |||
@@ -796,26 +799,26 b' Test revert --all to parent content' | |||||
796 | check revert output |
|
799 | check revert output | |
797 |
|
800 | |||
798 | $ hg revert --all |
|
801 | $ hg revert --all | |
799 | reverting added_deleted |
|
802 | undeleting content1_content1_content1-untracked | |
800 | undeleting added_untracked-clean |
|
803 | reverting content1_content1_content3-tracked | |
801 | undeleting added_untracked-deleted |
|
804 | undeleting content1_content1_content3-untracked | |
802 | undeleting added_untracked-wc |
|
805 | reverting content1_content1_missing-tracked | |
803 | reverting added_wc |
|
806 | undeleting content1_content1_missing-untracked | |
804 | reverting clean_deleted |
|
807 | reverting content1_content2_content1-tracked | |
805 |
undeleting c |
|
808 | undeleting content1_content2_content1-untracked | |
806 |
undeleting c |
|
809 | undeleting content1_content2_content2-untracked | |
807 | undeleting clean_untracked-wc |
|
810 | reverting content1_content2_content3-tracked | |
808 | reverting clean_wc |
|
811 | undeleting content1_content2_content3-untracked | |
809 | forgetting missing_wc |
|
812 | reverting content1_content2_missing-tracked | |
810 | reverting modified_deleted |
|
813 | undeleting content1_content2_missing-untracked | |
811 | reverting modified_revert |
|
814 | forgetting content1_missing_content1-tracked | |
812 | undeleting modified_untracked-clean |
|
815 | forgetting content1_missing_content3-tracked | |
813 | undeleting modified_untracked-deleted |
|
816 | undeleting missing_content2_content2-untracked | |
814 | undeleting modified_untracked-revert |
|
817 | reverting missing_content2_content3-tracked | |
815 |
undeleting m |
|
818 | undeleting missing_content2_content3-untracked | |
816 | reverting modified_wc |
|
819 | reverting missing_content2_missing-tracked | |
817 | forgetting removed_revert |
|
820 | undeleting missing_content2_missing-untracked | |
818 | forgetting removed_wc |
|
821 | forgetting missing_missing_content3-tracked | |
819 |
|
822 | |||
820 | Compare resulting directory with revert target. |
|
823 | Compare resulting directory with revert target. | |
821 |
|
824 | |||
@@ -825,20 +828,20 b' additional `.orig` backup file when appl' | |||||
825 | $ python ../dircontent.py > ../content-parent-all.txt |
|
828 | $ python ../dircontent.py > ../content-parent-all.txt | |
826 | $ cd .. |
|
829 | $ cd .. | |
827 | $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ |
|
830 | $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ | |
828 | +wc added_untracked-wc.orig |
|
831 | +content3 content1_content1_content3-tracked.orig | |
829 | +wc added_wc.orig |
|
832 | +content3 content1_content1_content3-untracked.orig | |
830 | +wc clean_untracked-wc.orig |
|
833 | +content1 content1_content2_content1-tracked.orig | |
831 | +wc clean_wc.orig |
|
834 | +content1 content1_content2_content1-untracked.orig | |
832 | +wc missing_untracked-wc |
|
835 | +content3 content1_content2_content3-tracked.orig | |
833 | +wc missing_wc |
|
836 | +content3 content1_content2_content3-untracked.orig | |
834 | +base modified_revert.orig |
|
837 | +content1 content1_missing_content1-tracked | |
835 | +base modified_untracked-revert.orig |
|
838 | +content1 content1_missing_content1-untracked | |
836 | +wc modified_untracked-wc.orig |
|
839 | +content3 content1_missing_content3-tracked | |
837 | +wc modified_wc.orig |
|
840 | +content3 content1_missing_content3-untracked | |
838 | +base removed_revert |
|
841 | +content3 missing_content2_content3-tracked.orig | |
839 | +base removed_untracked-revert |
|
842 | +content3 missing_content2_content3-untracked.orig | |
840 | +wc removed_untracked-wc |
|
843 | +content3 missing_missing_content3-tracked | |
841 | +wc removed_wc |
|
844 | +content3 missing_missing_content3-untracked | |
842 |
|
845 | |||
843 | Test revert --all to "base" content |
|
846 | Test revert --all to "base" content | |
844 | ----------------------------------- |
|
847 | ----------------------------------- | |
@@ -851,27 +854,27 b' Test revert --all to "base" content' | |||||
851 | check revert output |
|
854 | check revert output | |
852 |
|
855 | |||
853 | $ hg revert --all --rev 'desc(base)' |
|
856 | $ hg revert --all --rev 'desc(base)' | |
854 | removing added_clean |
|
857 | undeleting content1_content1_content1-untracked | |
855 | removing added_deleted |
|
858 | reverting content1_content1_content3-tracked | |
856 | removing added_wc |
|
859 | undeleting content1_content1_content3-untracked | |
857 | reverting clean_deleted |
|
860 | reverting content1_content1_missing-tracked | |
858 |
undeleting c |
|
861 | undeleting content1_content1_missing-untracked | |
859 |
undeleting c |
|
862 | undeleting content1_content2_content1-untracked | |
860 | undeleting clean_untracked-wc |
|
863 | reverting content1_content2_content2-tracked | |
861 | reverting clean_wc |
|
864 | undeleting content1_content2_content2-untracked | |
862 | forgetting missing_wc |
|
865 | reverting content1_content2_content3-tracked | |
863 | reverting modified_clean |
|
866 | undeleting content1_content2_content3-untracked | |
864 | reverting modified_deleted |
|
867 | reverting content1_content2_missing-tracked | |
865 | undeleting modified_untracked-clean |
|
868 | undeleting content1_content2_missing-untracked | |
866 | undeleting modified_untracked-deleted |
|
869 | adding content1_missing_content1-untracked | |
867 | undeleting modified_untracked-revert |
|
870 | reverting content1_missing_content3-tracked | |
868 | undeleting modified_untracked-wc |
|
871 | adding content1_missing_content3-untracked | |
869 | reverting modified_wc |
|
872 | adding content1_missing_missing-tracked | |
870 | adding removed_clean |
|
873 | adding content1_missing_missing-untracked | |
871 | adding removed_untracked-clean |
|
874 | removing missing_content2_content2-tracked | |
872 | adding removed_untracked-revert |
|
875 | removing missing_content2_content3-tracked | |
873 | adding removed_untracked-wc |
|
876 | removing missing_content2_missing-tracked | |
874 | reverting removed_wc |
|
877 | forgetting missing_missing_content3-tracked | |
875 |
|
878 | |||
876 | Compare resulting directory with revert target. |
|
879 | Compare resulting directory with revert target. | |
877 |
|
880 | |||
@@ -881,18 +884,18 b' additional `.orig` backup file when appl' | |||||
881 | $ python ../dircontent.py > ../content-base-all.txt |
|
884 | $ python ../dircontent.py > ../content-base-all.txt | |
882 | $ cd .. |
|
885 | $ cd .. | |
883 | $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ |
|
886 | $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ | |
884 | +parent added_untracked-clean |
|
887 | +content3 content1_content1_content3-tracked.orig | |
885 | +wc added_untracked-wc |
|
888 | +content3 content1_content1_content3-untracked.orig | |
886 | +wc added_wc.orig |
|
889 | +content2 content1_content2_content2-untracked.orig | |
887 | +wc clean_untracked-wc.orig |
|
890 | +content3 content1_content2_content3-tracked.orig | |
888 | +wc clean_wc.orig |
|
891 | +content3 content1_content2_content3-untracked.orig | |
889 | +wc missing_untracked-wc |
|
892 | +content3 content1_missing_content3-tracked.orig | |
890 | +wc missing_wc |
|
893 | +content3 content1_missing_content3-untracked.orig | |
891 | +parent modified_untracked-clean.orig |
|
894 | +content2 missing_content2_content2-untracked | |
892 | +wc modified_untracked-wc.orig |
|
895 | +content3 missing_content2_content3-tracked.orig | |
893 | +wc modified_wc.orig |
|
896 | +content3 missing_content2_content3-untracked | |
894 | +wc removed_untracked-wc.orig |
|
897 | +content3 missing_missing_content3-tracked | |
895 | +wc removed_wc.orig |
|
898 | +content3 missing_missing_content3-untracked | |
896 |
|
899 | |||
897 | Test revert to parent content with explicit file name |
|
900 | Test revert to parent content with explicit file name | |
898 | ----------------------------------------------------- |
|
901 | ----------------------------------------------------- | |
@@ -910,75 +913,75 b' revert all files individually and check ' | |||||
910 | > hg revert $file; |
|
913 | > hg revert $file; | |
911 | > echo |
|
914 | > echo | |
912 | > done |
|
915 | > done | |
913 | ### revert for: added_clean |
|
916 | ### revert for: missing_content2_content2-tracked | |
914 | no changes needed to added_clean |
|
917 | no changes needed to missing_content2_content2-tracked | |
915 |
|
918 | |||
916 | ### revert for: added_deleted |
|
919 | ### revert for: missing_content2_missing-tracked | |
917 |
|
920 | |||
918 |
### revert for: |
|
921 | ### revert for: missing_content2_content2-untracked | |
919 |
|
922 | |||
920 |
### revert for: |
|
923 | ### revert for: missing_content2_missing-untracked | |
921 |
|
924 | |||
922 |
### revert for: |
|
925 | ### revert for: missing_content2_content3-untracked | |
923 |
|
926 | |||
924 | ### revert for: added_wc |
|
927 | ### revert for: missing_content2_content3-tracked | |
925 |
|
928 | |||
926 |
### revert for: c |
|
929 | ### revert for: content1_content1_content1-tracked | |
927 |
no changes needed to c |
|
930 | no changes needed to content1_content1_content1-tracked | |
928 |
|
931 | |||
929 | ### revert for: clean_deleted |
|
932 | ### revert for: content1_content1_missing-tracked | |
930 |
|
933 | |||
931 |
### revert for: c |
|
934 | ### revert for: content1_content1_content1-untracked | |
932 |
|
935 | |||
933 |
### revert for: c |
|
936 | ### revert for: content1_content1_missing-untracked | |
934 |
|
937 | |||
935 |
### revert for: c |
|
938 | ### revert for: content1_content1_content3-untracked | |
936 |
|
939 | |||
937 | ### revert for: clean_wc |
|
940 | ### revert for: content1_content1_content3-tracked | |
938 |
|
941 | |||
939 |
### revert for: missing_ |
|
942 | ### revert for: missing_missing_missing-tracked | |
940 |
missing_ |
|
943 | missing_missing_missing-tracked: no such file in rev * (glob) | |
941 |
|
944 | |||
942 |
### revert for: missing_untracked |
|
945 | ### revert for: missing_missing_missing-untracked | |
943 |
missing_untracked |
|
946 | missing_missing_missing-untracked: no such file in rev * (glob) | |
944 |
|
947 | |||
945 |
### revert for: missing_untracked |
|
948 | ### revert for: missing_missing_content3-untracked | |
946 |
file not managed: missing_untracked |
|
949 | file not managed: missing_missing_content3-untracked | |
947 |
|
950 | |||
948 |
### revert for: missing_ |
|
951 | ### revert for: missing_missing_content3-tracked | |
949 |
|
952 | |||
950 | ### revert for: modified_clean |
|
953 | ### revert for: content1_content2_content2-tracked | |
951 | no changes needed to modified_clean |
|
954 | no changes needed to content1_content2_content2-tracked | |
952 |
|
955 | |||
953 | ### revert for: modified_deleted |
|
956 | ### revert for: content1_content2_missing-tracked | |
954 |
|
957 | |||
955 | ### revert for: modified_revert |
|
958 | ### revert for: content1_content2_content1-tracked | |
956 |
|
959 | |||
957 |
### revert for: |
|
960 | ### revert for: content1_content2_content2-untracked | |
958 |
|
961 | |||
959 |
### revert for: |
|
962 | ### revert for: content1_content2_missing-untracked | |
960 |
|
963 | |||
961 |
### revert for: |
|
964 | ### revert for: content1_content2_content1-untracked | |
962 |
|
965 | |||
963 |
### revert for: |
|
966 | ### revert for: content1_content2_content3-untracked | |
964 |
|
967 | |||
965 | ### revert for: modified_wc |
|
968 | ### revert for: content1_content2_content3-tracked | |
966 |
|
969 | |||
967 | ### revert for: removed_clean |
|
970 | ### revert for: content1_missing_missing-tracked | |
968 |
|
|
971 | content1_missing_missing-tracked: no such file in rev * (glob) | |
969 |
|
972 | |||
970 | ### revert for: removed_revert |
|
973 | ### revert for: content1_missing_content1-tracked | |
971 |
|
974 | |||
972 |
### revert for: |
|
975 | ### revert for: content1_missing_missing-untracked | |
973 |
|
|
976 | content1_missing_missing-untracked: no such file in rev * (glob) | |
974 |
|
977 | |||
975 |
### revert for: |
|
978 | ### revert for: content1_missing_content1-untracked | |
976 |
file not managed: |
|
979 | file not managed: content1_missing_content1-untracked | |
977 |
|
980 | |||
978 |
### revert for: |
|
981 | ### revert for: content1_missing_content3-untracked | |
979 |
file not managed: |
|
982 | file not managed: content1_missing_content3-untracked | |
980 |
|
983 | |||
981 | ### revert for: removed_wc |
|
984 | ### revert for: content1_missing_content3-tracked | |
982 |
|
985 | |||
983 |
|
986 | |||
984 | check resulting directory against the --all run |
|
987 | check resulting directory against the --all run | |
@@ -1005,74 +1008,74 b' revert all files individually and check ' | |||||
1005 | > hg revert $file --rev 'desc(base)'; |
|
1008 | > hg revert $file --rev 'desc(base)'; | |
1006 | > echo |
|
1009 | > echo | |
1007 | > done |
|
1010 | > done | |
1008 | ### revert for: added_clean |
|
1011 | ### revert for: missing_content2_content2-tracked | |
1009 |
|
1012 | |||
1010 | ### revert for: added_deleted |
|
1013 | ### revert for: missing_content2_missing-tracked | |
1011 |
|
1014 | |||
1012 |
### revert for: |
|
1015 | ### revert for: missing_content2_content2-untracked | |
1013 |
no changes needed to |
|
1016 | no changes needed to missing_content2_content2-untracked | |
1014 |
|
1017 | |||
1015 |
### revert for: |
|
1018 | ### revert for: missing_content2_missing-untracked | |
1016 |
no changes needed to |
|
1019 | no changes needed to missing_content2_missing-untracked | |
1017 |
|
1020 | |||
1018 |
### revert for: |
|
1021 | ### revert for: missing_content2_content3-untracked | |
1019 |
no changes needed to |
|
1022 | no changes needed to missing_content2_content3-untracked | |
1020 |
|
1023 | |||
1021 | ### revert for: added_wc |
|
1024 | ### revert for: missing_content2_content3-tracked | |
1022 |
|
1025 | |||
1023 |
### revert for: c |
|
1026 | ### revert for: content1_content1_content1-tracked | |
1024 |
no changes needed to c |
|
1027 | no changes needed to content1_content1_content1-tracked | |
1025 |
|
1028 | |||
1026 | ### revert for: clean_deleted |
|
1029 | ### revert for: content1_content1_missing-tracked | |
1027 |
|
1030 | |||
1028 |
### revert for: c |
|
1031 | ### revert for: content1_content1_content1-untracked | |
1029 |
|
1032 | |||
1030 |
### revert for: c |
|
1033 | ### revert for: content1_content1_missing-untracked | |
1031 |
|
1034 | |||
1032 |
### revert for: c |
|
1035 | ### revert for: content1_content1_content3-untracked | |
1033 |
|
1036 | |||
1034 | ### revert for: clean_wc |
|
1037 | ### revert for: content1_content1_content3-tracked | |
1035 |
|
1038 | |||
1036 |
### revert for: missing_ |
|
1039 | ### revert for: missing_missing_missing-tracked | |
1037 |
missing_ |
|
1040 | missing_missing_missing-tracked: no such file in rev * (glob) | |
1038 |
|
1041 | |||
1039 |
### revert for: missing_untracked |
|
1042 | ### revert for: missing_missing_missing-untracked | |
1040 |
missing_untracked |
|
1043 | missing_missing_missing-untracked: no such file in rev * (glob) | |
1041 |
|
1044 | |||
1042 |
### revert for: missing_untracked |
|
1045 | ### revert for: missing_missing_content3-untracked | |
1043 |
file not managed: missing_untracked |
|
1046 | file not managed: missing_missing_content3-untracked | |
1044 |
|
1047 | |||
1045 |
### revert for: missing_ |
|
1048 | ### revert for: missing_missing_content3-tracked | |
1046 |
|
1049 | |||
1047 | ### revert for: modified_clean |
|
1050 | ### revert for: content1_content2_content2-tracked | |
1048 |
|
1051 | |||
1049 | ### revert for: modified_deleted |
|
1052 | ### revert for: content1_content2_missing-tracked | |
1050 |
|
1053 | |||
1051 | ### revert for: modified_revert |
|
1054 | ### revert for: content1_content2_content1-tracked | |
1052 | no changes needed to modified_revert |
|
1055 | no changes needed to content1_content2_content1-tracked | |
1053 |
|
1056 | |||
1054 |
### revert for: |
|
1057 | ### revert for: content1_content2_content2-untracked | |
1055 |
|
1058 | |||
1056 |
### revert for: |
|
1059 | ### revert for: content1_content2_missing-untracked | |
1057 |
|
1060 | |||
1058 |
### revert for: |
|
1061 | ### revert for: content1_content2_content1-untracked | |
1059 |
|
1062 | |||
1060 |
### revert for: |
|
1063 | ### revert for: content1_content2_content3-untracked | |
1061 |
|
1064 | |||
1062 | ### revert for: modified_wc |
|
1065 | ### revert for: content1_content2_content3-tracked | |
1063 |
|
1066 | |||
1064 | ### revert for: removed_clean |
|
1067 | ### revert for: content1_missing_missing-tracked | |
1065 |
|
1068 | |||
1066 | ### revert for: removed_revert |
|
1069 | ### revert for: content1_missing_content1-tracked | |
1067 | no changes needed to removed_revert |
|
1070 | no changes needed to content1_missing_content1-tracked | |
1068 |
|
1071 | |||
1069 |
### revert for: |
|
1072 | ### revert for: content1_missing_missing-untracked | |
1070 |
|
1073 | |||
1071 |
### revert for: |
|
1074 | ### revert for: content1_missing_content1-untracked | |
1072 |
|
1075 | |||
1073 |
### revert for: |
|
1076 | ### revert for: content1_missing_content3-untracked | |
1074 |
|
1077 | |||
1075 | ### revert for: removed_wc |
|
1078 | ### revert for: content1_missing_content3-tracked | |
1076 |
|
1079 | |||
1077 |
|
1080 | |||
1078 | check resulting directory against the --all run |
|
1081 | check resulting directory against the --all run |
General Comments 0
You need to be logged in to leave comments.
Login now