New migrate subcommand can be used to switch files to using a different backend, safely and with no duplication of content.

This commit is contained in:
Joey Hess 2011-01-08 15:54:14 -04:00
parent 32b0e10390
commit a78b0555e1
8 changed files with 112 additions and 17 deletions

View file

@ -42,11 +42,12 @@ perform (file, backend) = do
stored <- Backend.storeFileKey file backend
case stored of
Nothing -> return Nothing
Just (key, _) -> return $ Just $ cleanup file key
Just (key, _) -> do
moveAnnex key file
return $ Just $ cleanup file key
cleanup :: FilePath -> Key -> CommandCleanup
cleanup file key = do
moveAnnex key file
logStatus key ValuePresent
link <- calcGitLink file key