migrate: Support migrating v1 SHA keys to v2 SHA keys with size information that can be used for free space checking.

This commit is contained in:
Joey Hess 2011-03-23 17:57:10 -04:00
parent ad08273ac5
commit 6246b807f7
9 changed files with 54 additions and 10 deletions

View file

@ -31,8 +31,8 @@ start :: CommandStartBackendFile
start (file, b) = isAnnexed file $ \(key, oldbackend) -> do
exists <- inAnnex key
newbackend <- choosebackend b
force <- Annex.getState Annex.force
if (newbackend /= oldbackend || force) && exists
upgradable <- Backend.upgradableKey oldbackend key
if (newbackend /= oldbackend || upgradable) && exists
then do
showStart "migrate" file
return $ Just $ perform file key newbackend