Show More
@@ -747,6 +747,63 b' The persistent nodemap should exist afte' | |||||
747 | data-unused: 0 |
|
747 | data-unused: 0 | |
748 | data-unused: 0.000% |
|
748 | data-unused: 0.000% | |
749 |
|
749 | |||
|
750 | Test various corruption case | |||
|
751 | ============================ | |||
|
752 | ||||
|
753 | Missing datafile | |||
|
754 | ---------------- | |||
|
755 | ||||
|
756 | Test behavior with a missing datafile | |||
|
757 | ||||
|
758 | $ hg clone --quiet --pull test-repo corruption-test-repo | |||
|
759 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
760 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |||
|
761 | corruption-test-repo/.hg/store/00changelog.d | |||
|
762 | corruption-test-repo/.hg/store/00changelog.i | |||
|
763 | corruption-test-repo/.hg/store/00changelog.n | |||
|
764 | $ rm corruption-test-repo/.hg/store/00changelog*.nd | |||
|
765 | $ hg log -R corruption-test-repo -r . | |||
|
766 | changeset: 5005:90d5d3ba2fc4 | |||
|
767 | tag: tip | |||
|
768 | user: test | |||
|
769 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
770 | summary: a2 | |||
|
771 | ||||
|
772 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
773 | corruption-test-repo/.hg/store/00changelog.d | |||
|
774 | corruption-test-repo/.hg/store/00changelog.i | |||
|
775 | corruption-test-repo/.hg/store/00changelog.n | |||
|
776 | ||||
|
777 | Truncated data file | |||
|
778 | ------------------- | |||
|
779 | ||||
|
780 | Test behavior with a too short datafile | |||
|
781 | ||||
|
782 | rebuild the missing data | |||
|
783 | $ hg -R corruption-test-repo debugupdatecache | |||
|
784 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |||
|
785 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |||
|
786 | corruption-test-repo/.hg/store/00changelog.d | |||
|
787 | corruption-test-repo/.hg/store/00changelog.i | |||
|
788 | corruption-test-repo/.hg/store/00changelog.n | |||
|
789 | ||||
|
790 | truncate the file | |||
|
791 | ||||
|
792 | $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd` | |||
|
793 | $ f -s $datafilepath | |||
|
794 | corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) | |||
|
795 | $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=none | |||
|
796 | $ mv $datafilepath-tmp $datafilepath | |||
|
797 | $ f -s $datafilepath | |||
|
798 | corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob) | |||
|
799 | ||||
|
800 | Check that Mercurial reaction to this event | |||
|
801 | ||||
|
802 | $ hg -R corruption-test-repo log -r . | |||
|
803 | abort: index 00changelog.i is corrupted | |||
|
804 | [50] | |||
|
805 | ||||
|
806 | ||||
750 | stream clone |
|
807 | stream clone | |
751 | ------------ |
|
808 | ------------ | |
752 |
|
809 |
General Comments 0
You need to be logged in to leave comments.
Login now