use new name for new format content identifier db
It will be populated automatically by the next command that needs data from it, the same way it gets populated in a fresh clone. That may be a little expensive, but it's a one time cost, and no slower than in a fresh clone.
This commit is contained in:
parent
1b5f4b67b5
commit
3b820f08f7
3 changed files with 20 additions and 2 deletions
|
@ -13,6 +13,7 @@ import Annex.Common
|
|||
import Annex.CatFile
|
||||
import qualified Database.Keys
|
||||
import qualified Database.Keys.SQL
|
||||
import qualified Database.ContentIdentifier
|
||||
import qualified Git.LsFiles as LsFiles
|
||||
import qualified Git
|
||||
import Git.FilePath
|
||||
|
@ -23,10 +24,17 @@ upgrade automatic = do
|
|||
showAction "v7 to v8"
|
||||
|
||||
populateKeysDb
|
||||
|
||||
-- The fsck databases are not transitioned here; any running
|
||||
-- incremental fsck can continue to write to the old database.
|
||||
-- The next time an incremental fsck is started, it will delete the
|
||||
-- old database, and just re-fsck the files.
|
||||
|
||||
-- The old content identifier database is deleted here, but the
|
||||
-- new database is not populated. It will be automatically
|
||||
-- populated from the git-annex branch the next time it is used.
|
||||
removeOldDb gitAnnexContentIdentifierDbDirOld
|
||||
liftIO . nukeFile =<< fromRepo gitAnnexContentIdentifierLockOld
|
||||
|
||||
removeOldDb gitAnnexKeysDbOld
|
||||
liftIO . nukeFile =<< fromRepo gitAnnexKeysDbIndexCacheOld
|
||||
|
@ -43,6 +51,12 @@ gitAnnexKeysDbLockOld r = gitAnnexKeysDbOld r ++ ".lck"
|
|||
gitAnnexKeysDbIndexCacheOld :: Git.Repo -> FilePath
|
||||
gitAnnexKeysDbIndexCacheOld r = gitAnnexKeysDbOld r ++ ".cache"
|
||||
|
||||
gitAnnexContentIdentifierDbDirOld :: Git.Repo -> FilePath
|
||||
gitAnnexContentIdentifierDbDirOld r = gitAnnexDir r </> "cids"
|
||||
|
||||
gitAnnexContentIdentifierLockOld :: Git.Repo -> FilePath
|
||||
gitAnnexContentIdentifierLockOld r = gitAnnexContentIdentifierDbDirOld r ++ ".lck"
|
||||
|
||||
removeOldDb :: (Git.Repo -> FilePath) -> Annex ()
|
||||
removeOldDb getdb = do
|
||||
db <- fromRepo getdb
|
||||
|
@ -91,3 +105,4 @@ populateKeysDb = do
|
|||
Database.Keys.SQL.addInodeCaches k [ic] h
|
||||
liftIO $ void cleanup
|
||||
Database.Keys.closeDb
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue