add v6; keep v5 working for now and manual upgrade
Since all places where a repo is used in direct mode need to have git-annex upgraded before the repo can safely be converted to v6, the upgrade needs to be manual for now. I suppose that at some point I'll want to drop all the direct mode support code. At that point, will stop supporting v5, and will need to auto-upgrade any remaining v5 repos. If possible, I'd like to carry the direct mode support for say, a year or so, to give people plenty of time to upgrade and avoid disruption.
This commit is contained in:
parent
34ead644d9
commit
ccc49861ca
9 changed files with 74 additions and 14 deletions
|
@ -18,13 +18,14 @@ import qualified Upgrade.V1
|
|||
import qualified Upgrade.V2
|
||||
import qualified Upgrade.V3
|
||||
import qualified Upgrade.V4
|
||||
import qualified Upgrade.V5
|
||||
|
||||
checkUpgrade :: Version -> Annex ()
|
||||
checkUpgrade = maybe noop error <=< needsUpgrade
|
||||
|
||||
needsUpgrade :: Version -> Annex (Maybe String)
|
||||
needsUpgrade v
|
||||
| v == supportedVersion = ok
|
||||
| v `elem` supportedVersions = ok
|
||||
| v `elem` autoUpgradeableVersions = ifM (upgrade True)
|
||||
( ok
|
||||
, err "Automatic upgrade failed!"
|
||||
|
@ -40,7 +41,7 @@ upgrade :: Bool -> Annex Bool
|
|||
upgrade automatic = do
|
||||
upgraded <- go =<< getVersion
|
||||
when upgraded $
|
||||
setVersion supportedVersion
|
||||
setVersion currentVersion
|
||||
return upgraded
|
||||
where
|
||||
#ifndef mingw32_HOST_OS
|
||||
|
@ -53,4 +54,5 @@ upgrade automatic = do
|
|||
go (Just "2") = Upgrade.V2.upgrade
|
||||
go (Just "3") = Upgrade.V3.upgrade automatic
|
||||
go (Just "4") = Upgrade.V4.upgrade automatic
|
||||
go (Just "5") = Upgrade.V5.upgrade automatic
|
||||
go _ = return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue