Mercurial > hg-stable
comparison tests/test-largefiles.t @ 15338:f4b29792fcda stable
largefiles: extract test-lfconvert.t from test-largefiles.t
test-largefiles.t is getting pretty big, and there's lots more to test
in lfconvert. And lfconvert is a fairly orthogonal feature to the
rest of largefiles.
author | Greg Ward <greg@gerg.ca> |
---|---|
date | Sat, 22 Oct 2011 13:48:56 -0400 |
parents | 83debcd7064b |
children | ca1412c15efe |
comparison
equal
deleted
inserted
replaced
15337:cf5f9df6406b | 15338:f4b29792fcda |
---|---|
761 $ cd .. | 761 $ cd .. |
762 $ kill $(cat serve.pid) | 762 $ kill $(cat serve.pid) |
763 | 763 |
764 $ cd .. | 764 $ cd .. |
765 | 765 |
766 "lfconvert" works | |
767 $ hg init bigfile-repo | |
768 $ cd bigfile-repo | |
769 $ dd if=/dev/zero bs=1k count=256 > a-large-file 2> /dev/null | |
770 $ hg addremove | |
771 adding a-large-file | |
772 $ hg commit -m "add a-large-file (as a normal file)" | |
773 $ find .hg/largefiles | |
774 .hg/largefiles | |
775 $ cd .. | |
776 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo | |
777 initializing destination largefiles-repo | |
778 | |
779 "lfconvert" adds 'largefiles' to .hg/requires. | |
780 $ cat largefiles-repo/.hg/requires | |
781 largefiles | |
782 revlogv1 | |
783 fncache | |
784 store | |
785 dotencode | |
786 | |
787 "lfconvert" includes a newline at the end of the standin files. | |
788 $ cd largefiles-repo | |
789 $ hg up | |
790 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
791 getting changed largefiles | |
792 1 largefiles updated, 0 removed | |
793 $ cat .hglf/a-large-file | |
794 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 | |
795 $ dd if=/dev/zero bs=1k count=1k > another-large-file 2> /dev/null | |
796 $ hg add --lfsize=1 another-large-file | |
797 $ hg commit -m "add another-large-file (should be a largefile)" | |
798 $ cat .hglf/a-large-file .hglf/another-large-file | |
799 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 | |
800 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 | |
801 | |
802 Convert back to a normal (non-largefiles) repo | |
803 $ hg lfconvert --to-normal . ../normal-repo | |
804 initializing destination ../normal-repo | |
805 $ cd ../normal-repo | |
806 $ cat >> .hg/hgrc <<EOF | |
807 > [extensions] | |
808 > largefiles = ! | |
809 > EOF | |
810 $ hg update | |
811 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
812 $ hg locate | |
813 a-large-file | |
814 another-large-file | |
815 $ [ -d .hg/largefiles ] && echo fail || echo pass | |
816 pass | |
817 | |
818 Cleanup | |
819 $ cd .. | |
820 $ rm -rf bigfile-repo largefiles-repo normal-repo | |
821 Clone a local repository owned by another user | 766 Clone a local repository owned by another user |
822 We have to simulate that here by setting $HOME and removing write permissions | 767 We have to simulate that here by setting $HOME and removing write permissions |
823 $ ORIGHOME="$HOME" | 768 $ ORIGHOME="$HOME" |
824 $ mkdir alice | 769 $ mkdir alice |
825 $ HOME="`pwd`/alice" | 770 $ HOME="`pwd`/alice" |