##// END OF EJS Templates
tests: add tests for corrupt .hg/shelved/ directory...
Martin von Zweigbergk -
r46986:832a6a2e default
parent child Browse files
Show More
@@ -745,6 +745,58 b' progress'
745 #endif
745 #endif
746 $ cd ..
746 $ cd ..
747
747
748 Test corrupt shelves (in .hg/shelved/, not .hg/shelvestate)
749 $ hg init corrupt-shelves
750 $ cd corrupt-shelves
751 $ mkdir .hg/shelved
752
753 # A (corrupt) .patch file without a .hg file
754 $ touch .hg/shelved/junk1.patch
755 $ hg shelve -l
756 junk1 (* ago) (glob)
757 $ hg unshelve
758 unshelving change 'junk1'
759 abort: shelved change 'junk1' not found
760 [255]
761 $ hg shelve -d junk1
762 $ find .hg/shelve* | sort
763 .hg/shelve-backup
764 .hg/shelve-backup/junk1.patch
765 .hg/shelved
766
767 # A .hg file without a .patch file
768 $ touch .hg/shelved/junk2.hg
769 $ hg shelve -l
770 $ hg unshelve
771 abort: no shelved changes to apply!
772 [255]
773 $ hg shelve -d junk2
774 abort: shelved change 'junk2' not found
775 [255]
776 $ find .hg/shelve* | sort
777 .hg/shelve-backup
778 .hg/shelve-backup/junk1.patch
779 .hg/shelve-backup/junk2.hg
780 .hg/shelved
781
782 # A file with an unexpected extension
783 $ touch .hg/shelved/junk3
784 $ hg shelve -l 2>&1 | grep ValueError
785 ValueError: * (glob)
786 $ hg unshelve 2>&1 | grep ValueError
787 ValueError: * (glob)
788 $ hg shelve -d junk3
789 abort: shelved change 'junk3' not found
790 [255]
791 $ find .hg/shelve* | sort
792 .hg/shelve-backup
793 .hg/shelve-backup/junk1.patch
794 .hg/shelve-backup/junk2.hg
795 .hg/shelved
796 .hg/shelved/junk3
797
798 $ cd ..
799
748 Unshelve respects --keep even if user intervention is needed
800 Unshelve respects --keep even if user intervention is needed
749 $ hg init unshelvekeep && cd unshelvekeep
801 $ hg init unshelvekeep && cd unshelvekeep
750 $ echo 1 > file && hg ci -Am 1
802 $ echo 1 > file && hg ci -Am 1
General Comments 0
You need to be logged in to leave comments. Login now