optimize: A new subcommand that either gets or drops file content as needed to work toward meeting the configured numcopies setting.

This is currently rather simplistic, though still useful.
In the future, it could become smarter about what content is stored where,
etc.
This commit is contained in:
Joey Hess 2011-09-14 13:47:22 -04:00
parent 1ac6217c74
commit 949b3f69d0
9 changed files with 73 additions and 1 deletions

12
test.hs
View file

@ -93,6 +93,7 @@ blackbox = TestLabel "blackbox" $ TestList
, test_unannex
, test_drop
, test_get
, test_optimize
, test_move
, test_copy
, test_lock
@ -216,6 +217,17 @@ test_get = "git-annex get" ~: TestCase $ intmpclonerepo $ do
inmainrepo $ unannexed ingitfile
unannexed ingitfile
test_optimize :: Test
test_optimize = "git-annex optimize" ~: TestCase $ intmpclonerepo $ do
inmainrepo $ annexed_present annexedfile
annexed_notpresent annexedfile
git_annex "optimize" ["-q", annexedfile, "--numcopies=2"] @? "optimize of file failed"
inmainrepo $ annexed_present annexedfile
annexed_present annexedfile
git_annex "optimize" ["-q", annexedfile] @? "optimize of file failed"
inmainrepo $ annexed_present annexedfile
annexed_notpresent annexedfile
test_move :: Test
test_move = "git-annex move" ~: TestCase $ intmpclonerepo $ do
annexed_notpresent annexedfile