handle upgrading repositories initialized with --version=9

There is nothing in upgrade.log because it was never upgraded to version
9. Before, it would have never autoupgraded to 10, but it's entirely
safe to upgrade to 10 immediately.

Of course, annex.autoupgraderepository = false will prevent that
upgrade. So if someone for some reason really wants v9, they can set
that. I can't think of a reason someone would actually want v9 rather
than v10 though.

Sponsored-by: k0ld on Patreon
This commit is contained in:
Joey Hess 2022-07-25 16:13:46 -04:00
parent 63cef2ae0b
commit 0d2e3058ee
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -40,12 +40,13 @@ upgrade automatic
- and it is not safe for such to still be running after
- this upgrade. -}
oldprocessesdanger = timeOfUpgrade (RepoVersion 9) >>= \case
Nothing -> pure True
Just t -> do
now <- liftIO getPOSIXTime
if now < t + 365*24*60*60
then return True
else assistantrunning
-- Initialized at v9, so no old process danger exists.
Nothing -> return False
{- Skip upgrade when git-annex assistant (or watch) is running,
- because these are long-running daemons that could conceivably