Added annex.autoupgraderepository configuration

Can be set to false to prevent any automatic repository upgrades.

Also, removed direct mode specific upgrade code in Annex.Init, and made
needsUpgrade always include the name/path of the repo, so if
there's a problem it's clear what repo has the problem.

And, made needsUpgrade catch any exceptions that might occur during the
upgrade, so it can display a more useful error message than just the
exception.
This commit is contained in:
Joey Hess 2019-09-01 13:29:55 -04:00
parent b421004d75
commit f845195354
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 53 additions and 23 deletions

View file

@ -13,9 +13,13 @@ import Annex.Version
import Annex.Init
cmd :: Command
cmd = dontCheck repoExists $ -- because an old version may not seem to exist
noDaemonRunning $ -- avoid upgrading repo out from under daemon
command "upgrade" SectionMaintenance "upgrade repository layout"
cmd = dontCheck repoExists $
-- ^ because an old version may not seem to exist
-- and also, this avoids automatic silent upgrades before
-- this command can start up.
noDaemonRunning $
-- ^ avoid upgrading repo out from under daemon
command "upgrade" SectionMaintenance "upgrade repository"
paramNothing (withParams seek)
seek :: CmdParams -> CommandSeek