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