##// END OF EJS Templates
test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David -
r22133:d732ff67 default
parent child Browse files
Show More
@@ -430,11 +430,15 b' Write the python script to disk'
430 $ cat << EOF > gen-revert-cases.py
430 $ cat << EOF > gen-revert-cases.py
431 > # generate proper file state to test revert behavior
431 > # generate proper file state to test revert behavior
432 > import sys
432 > import sys
433 > import os
433 >
434 >
434 > # content of the file in "base" and "parent"
435 > # content of the file in "base" and "parent"
436 > # None means no file at all
435 > ctxcontent = {
437 > ctxcontent = {
436 > # modified: file content change from base to parent
438 > # modified: file content change from base to parent
437 > 'modified': ['base', 'parent'],
439 > 'modified': ['base', 'parent'],
440 > # added: file is missing from base and added in parent
441 > 'added': [None, 'parent'],
438 > }
442 > }
439 >
443 >
440 > # content of file in working copy
444 > # content of file in working copy
@@ -474,14 +478,18 b' Write the python script to disk'
474 >
478 >
475 > # write actual content
479 > # write actual content
476 > for filename, data in content:
480 > for filename, data in content:
481 > if data is not None:
477 > f = open(filename, 'w')
482 > f = open(filename, 'w')
478 > f.write(data + '\n')
483 > f.write(data + '\n')
479 > f.close()
484 > f.close()
485 > elif os.path.exists(filename):
486 > os.remove(filename)
480 > EOF
487 > EOF
481
488
482 check list of planned files
489 check list of planned files
483
490
484 $ python gen-revert-cases.py filelist
491 $ python gen-revert-cases.py filelist
492 added_clean
485 modified_clean
493 modified_clean
486
494
487 Script to make a simple text version of the content
495 Script to make a simple text version of the content
@@ -524,14 +532,17 b' Create parent changeset'
524
532
525 $ python ../gen-revert-cases.py parent
533 $ python ../gen-revert-cases.py parent
526 $ hg addremove --similarity 0
534 $ hg addremove --similarity 0
535 adding added_clean
527 $ hg status
536 $ hg status
528 M modified_clean
537 M modified_clean
538 A added_clean
529 $ hg commit -m 'parent'
539 $ hg commit -m 'parent'
530
540
531 (create a simple text version of the content)
541 (create a simple text version of the content)
532
542
533 $ python ../dircontent.py > ../content-parent.txt
543 $ python ../dircontent.py > ../content-parent.txt
534 $ cat ../content-parent.txt
544 $ cat ../content-parent.txt
545 parent added_clean
535 parent modified_clean
546 parent modified_clean
536
547
537 Setup working directory
548 Setup working directory
@@ -542,11 +553,13 b' Setup working directory'
542
553
543 $ hg status --rev 'desc("base")'
554 $ hg status --rev 'desc("base")'
544 M modified_clean
555 M modified_clean
556 A added_clean
545
557
546 (create a simple text version of the content)
558 (create a simple text version of the content)
547
559
548 $ python ../dircontent.py > ../content-wc.txt
560 $ python ../dircontent.py > ../content-wc.txt
549 $ cat ../content-wc.txt
561 $ cat ../content-wc.txt
562 parent added_clean
550 parent modified_clean
563 parent modified_clean
551
564
552 $ cd ..
565 $ cd ..
@@ -584,6 +597,7 b' Test revert --all to "base" content'
584 check revert output
597 check revert output
585
598
586 $ hg revert --all --rev 'desc(base)'
599 $ hg revert --all --rev 'desc(base)'
600 removing added_clean
587 reverting modified_clean
601 reverting modified_clean
588
602
589 Compare resulting directory with revert target.
603 Compare resulting directory with revert target.
@@ -612,6 +626,9 b' revert all files individually and check '
612 > hg revert $file;
626 > hg revert $file;
613 > echo
627 > echo
614 > done
628 > done
629 ### revert for: added_clean
630 no changes needed to added_clean
631
615 ### revert for: modified_clean
632 ### revert for: modified_clean
616 no changes needed to modified_clean
633 no changes needed to modified_clean
617
634
@@ -640,6 +657,8 b' revert all files individually and check '
640 > hg revert $file --rev 'desc(base)';
657 > hg revert $file --rev 'desc(base)';
641 > echo
658 > echo
642 > done
659 > done
660 ### revert for: added_clean
661
643 ### revert for: modified_clean
662 ### revert for: modified_clean
644
663
645
664
General Comments 0
You need to be logged in to leave comments. Login now