distributed migration for pull and sync --content

pull, sync: When operating on content, automatically hard link objects
that have been migrated.

Added annex.syncmigrations config that can be set to false to prevent
pull and sync from migrating object content.

I think that true is a good default for this config, because it avoids
users having to re-download migrated content or learning about migration.
But, some users will surely not like it, whether because it does take some
time (especially for the first git-annex branch scan when there is a long
history), or because they want to deal with it manually, or because their
filesystem doesn't support hard links and they don't want it to copy
objects.

Sponsored-by: k0ld on Patreon
This commit is contained in:
Joey Hess 2023-12-08 14:18:18 -04:00
parent 4ed71b34de
commit 257f01729c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 43 additions and 8 deletions

View file

@ -58,6 +58,7 @@ import Command.Get (getKey')
import qualified Command.Move
import qualified Command.Export
import qualified Command.Import
import qualified Command.Migrate
import Annex.Drop
import Annex.UUID
import Logs.UUID
@ -294,6 +295,10 @@ seek' o = startConcurrency transferStages $ do
content <- shouldSyncContent o
when content $
whenM (annexSyncMigrations <$> Annex.getGitConfig) $
Command.Migrate.seekDistributedMigrations True
forM_ (filter isImport contentremotes) $
withbranch . importRemote content o
forM_ (filter isThirdPartyPopulated contentremotes) $