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

View file

@ -131,6 +131,8 @@ withAttrFilesInGit attr a params = do
repo <- Annex.gitRepo
files <- liftIO $ runPreserveOrder (LsFiles.inRepo repo) params
liftM (map a) $ liftIO $ Git.checkAttr repo attr files
withNumCopies :: CommandSeekAttrFiles
withNumCopies = withAttrFilesInGit "annex.numcopies"
withBackendFilesInGit :: CommandSeekBackendFiles
withBackendFilesInGit a params = do
repo <- Annex.gitRepo