diff options
author | 2010-11-08 14:39:12 -0400 | |
---|---|---|
committer | 2010-11-08 14:39:12 -0400 | |
commit | ab4de454914954676aa1e05ef26dc8a85bd8f6f1 (patch) | |
tree | 17cd1334f17bb15df3d1a1d889e4f99887de9843 /Core.hs | |
parent | f03adec793d378cc4807392400d09e70e293a991 (diff) |
Add annex.version, which will be used to automate upgrades.
Diffstat (limited to 'Core.hs')
-rw-r--r-- | Core.hs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -46,6 +46,7 @@ tryRun' _ errnum [] = startup :: Annex Bool startup = do prepUUID + autoUpgrade return True {- When git-annex is done, it runs this. -} @@ -151,6 +152,21 @@ getViaTmp key action = do -- to resume its transfer return False +{- Uses the annex.version git config setting to automate upgrades. -} +autoUpgrade :: Annex () +autoUpgrade = do + g <- Annex.gitRepo + + case Git.configGet g field "0" of + "0" -> do -- before there was repo versioning + setVersion + v | v == currentVersion -> return () + _ -> error "this version of git-annex is too old for this git repository!" + where + currentVersion = "1" + setVersion = Annex.setConfig field currentVersion + field = "annex.version" + {- Output logging -} verbose :: Annex () -> Annex () verbose a = do |