[PATCH 1 of 6] largefiles: extract test-lfconvert.t from test-largefiles.t

Greg Ward greg-hg at gerg.ca
Sat Oct 22 19:43:16 UTC 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1319305736 14400
# Branch stable
# Node ID 086c40edac07bd37659ad563e9e9cccf71479618
# Parent  83debcd7064b771036c997c48523050edb1b820e
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.

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -763,61 +763,6 @@
 
   $ cd ..
 
-"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
 Clone a local repository owned by another user
 We have to simulate that here by setting $HOME and removing write permissions
   $ ORIGHOME="$HOME"
diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t
new file mode 100644
--- /dev/null
+++ b/tests/test-lfconvert.t
@@ -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


More information about the Mercurial-devel mailing list