log migration trees to git-annex branch
This will allow distributed migration: Start a migration in one clone of a repo, and then update other clones. commitMigration is a bit of a bear.. There is some inversion of control that needs some TMVars. Also streamLogFile's finalizer does not handle recording the trees, so an interrupt at just the wrong time can cause migration.log to be emptied but the git-annex branch not updated. Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
parent
b55efc179a
commit
0bd8b17b59
12 changed files with 219 additions and 43 deletions
|
@ -19,6 +19,7 @@ module Annex.Ingest (
|
|||
finishIngestUnlocked,
|
||||
cleanOldKeys,
|
||||
addSymlink,
|
||||
genSymlink,
|
||||
makeLink,
|
||||
addUnlocked,
|
||||
CheckGitIgnore(..),
|
||||
|
@ -38,6 +39,7 @@ import Annex.MetaData
|
|||
import Annex.CurrentBranch
|
||||
import Annex.CheckIgnore
|
||||
import Logs.Location
|
||||
import qualified Git
|
||||
import qualified Annex
|
||||
import qualified Database.Keys
|
||||
import Config
|
||||
|
@ -320,9 +322,12 @@ makeLink file key mcache = flip catchNonAsync (restoreFile file key) $ do
|
|||
|
||||
{- Creates the symlink to the annexed content, and stages it in git. -}
|
||||
addSymlink :: RawFilePath -> Key -> Maybe InodeCache -> Annex ()
|
||||
addSymlink file key mcache = do
|
||||
addSymlink file key mcache = stageSymlink file =<< genSymlink file key mcache
|
||||
|
||||
genSymlink :: RawFilePath -> Key -> Maybe InodeCache -> Annex Git.Sha
|
||||
genSymlink file key mcache = do
|
||||
linktarget <- makeLink file key mcache
|
||||
stageSymlink file =<< hashSymlink linktarget
|
||||
hashSymlink linktarget
|
||||
|
||||
{- Parameters to pass to git add, forcing addition of ignored files.
|
||||
-
|
||||
|
|
|
@ -54,6 +54,8 @@ module Annex.Locations (
|
|||
gitAnnexRestageLock,
|
||||
gitAnnexAdjustedBranchUpdateLog,
|
||||
gitAnnexAdjustedBranchUpdateLock,
|
||||
gitAnnexMigrateLog,
|
||||
gitAnnexMigrateLock,
|
||||
gitAnnexMoveLog,
|
||||
gitAnnexMoveLock,
|
||||
gitAnnexExportDir,
|
||||
|
@ -407,6 +409,13 @@ gitAnnexAdjustedBranchUpdateLog r = gitAnnexDir r P.</> "adjust.log"
|
|||
gitAnnexAdjustedBranchUpdateLock :: Git.Repo -> RawFilePath
|
||||
gitAnnexAdjustedBranchUpdateLock r = gitAnnexDir r P.</> "adjust.lck"
|
||||
|
||||
{- .git/annex/migrate.log is used to log migrations before committing them. -}
|
||||
gitAnnexMigrateLog :: Git.Repo -> RawFilePath
|
||||
gitAnnexMigrateLog r = gitAnnexDir r P.</> "migrate.log"
|
||||
|
||||
gitAnnexMigrateLock :: Git.Repo -> RawFilePath
|
||||
gitAnnexMigrateLock r = gitAnnexDir r P.</> "migrate.lck"
|
||||
|
||||
{- .git/annex/move.log is used to log moves that are in progress,
|
||||
- to better support resuming an interrupted move. -}
|
||||
gitAnnexMoveLog :: Git.Repo -> RawFilePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue