diff tests/test-lfconvert.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
children be1377d19018
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lfconvert.t	Sat Oct 22 13:48:56 2011 -0400
@@ -0,0 +1,63 @@
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > largefiles =
+  > [largefiles]
+  > minsize = 0.5
+  > patterns = **.dat
+  > EOF
+
+"lfconvert" works
+  $ hg init bigfile-repo
+  $ cd bigfile-repo
+  $ dd if=/dev/zero bs=1k count=256 > a-large-file 2> /dev/null
+  $ hg addremove
+  adding a-large-file
+  $ hg commit -m "add a-large-file (as a normal file)"
+  $ find .hg/largefiles
+  .hg/largefiles
+  $ cd ..
+  $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
+  initializing destination largefiles-repo
+
+"lfconvert" adds 'largefiles' to .hg/requires.
+  $ cat largefiles-repo/.hg/requires
+  largefiles
+  revlogv1
+  fncache
+  store
+  dotencode
+
+"lfconvert" includes a newline at the end of the standin files.
+  $ cd largefiles-repo
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat .hglf/a-large-file
+  2e000fa7e85759c7f4c254d4d9c33ef481e459a7
+  $ dd if=/dev/zero bs=1k count=1k > another-large-file 2> /dev/null
+  $ hg add --lfsize=1 another-large-file
+  $ hg commit -m "add another-large-file (should be a largefile)"
+  $ cat .hglf/a-large-file .hglf/another-large-file
+  2e000fa7e85759c7f4c254d4d9c33ef481e459a7
+  3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
+
+Convert back to a normal (non-largefiles) repo
+  $ hg lfconvert --to-normal . ../normal-repo
+  initializing destination ../normal-repo
+  $ cd ../normal-repo
+  $ cat >> .hg/hgrc <<EOF
+  > [extensions]
+  > largefiles = !
+  > EOF
+  $ hg update
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg locate
+  a-large-file
+  another-large-file
+  $ [ -d .hg/largefiles ] && echo fail || echo pass
+  pass
+
+Cleanup
+  $ cd ..
+  $ rm -rf bigfile-repo largefiles-repo normal-repo