add upgrade.log
The upgrade from V9 uses this to avoid an automatic upgrade until 1 year after the V9 update. It can also be used in future such situations. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
856ce5cf5f
commit
9d5db6a09a
6 changed files with 106 additions and 19 deletions
|
@ -17,6 +17,7 @@ import Config
|
|||
import Annex.Path
|
||||
import Annex.Version
|
||||
import Types.RepoVersion
|
||||
import Logs.Upgrade
|
||||
#ifndef mingw32_HOST_OS
|
||||
import qualified Upgrade.V0
|
||||
import qualified Upgrade.V1
|
||||
|
@ -31,6 +32,7 @@ import qualified Upgrade.V8
|
|||
import qualified Upgrade.V9
|
||||
|
||||
import qualified Data.Map as M
|
||||
import Data.Time.Clock.POSIX
|
||||
|
||||
checkUpgrade :: RepoVersion -> Annex ()
|
||||
checkUpgrade = maybe noop giveup <=< needsUpgrade
|
||||
|
@ -85,7 +87,7 @@ upgrade automatic destversion = do
|
|||
|
||||
postupgrade newversion = ifM upgradingRemote
|
||||
( reloadConfig
|
||||
, maybe noop setVersion newversion
|
||||
, maybe noop upgradedto newversion
|
||||
)
|
||||
|
||||
#ifndef mingw32_HOST_OS
|
||||
|
@ -120,5 +122,9 @@ upgrade automatic destversion = do
|
|||
_ -> (False, Nothing)
|
||||
)
|
||||
|
||||
upgradedto v = do
|
||||
setVersion v
|
||||
writeUpgradeLog v =<< liftIO getPOSIXTime
|
||||
|
||||
upgradingRemote :: Annex Bool
|
||||
upgradingRemote = isJust <$> fromRepo Git.remoteName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue