detect v10 upgrade while running

Capstone of the v10 upgrade process.

Tested with a git-annex drop in a v8 repo that had a local v8 remote.
Upgrading the repo to v10 (with --force) immedaitely caused it to notice
and switch over to v10 locking. Upgrading the remote also caused it to
switch over when operating on the remote.

The InodeCache makes this fairly efficient, just an added stat call per
lock of an object file. After the v10 upgrade, there is no more
overhead.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-01-21 12:56:07 -04:00
parent 2002d16dc3
commit dc14221bc3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 29 additions and 3 deletions

View file

@ -154,6 +154,7 @@ data AnnexState = AnnexState
, gitconfigadjustment :: (GitConfig -> GitConfig)
, gitconfigoverride :: [String]
, gitremotes :: Maybe [Git.Repo]
, gitconfiginodecache :: Maybe InodeCache
, backend :: Maybe (BackendA Annex)
, remotes :: [Types.Remote.RemoteA Annex]
, output :: MessageState
@ -214,6 +215,7 @@ newAnnexState c r = do
, gitconfigadjustment = id
, gitconfigoverride = []
, gitremotes = Nothing
, gitconfiginodecache = Nothing
, backend = Nothing
, remotes = []
, output = o