all keys are still present on versioned remote after import of a tree

When importing from versioned remotes, fix tracking of the content of
deleted files.

Only S3 supports versioning so far, so only it was affected.

But, the draft import/export interface for external remotes also seemed to
need a change, so that versionedExport could be set.
This commit is contained in:
Joey Hess 2022-10-11 13:04:33 -04:00
parent e22c3b3d7c
commit c2ad84b423
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 35 additions and 9 deletions

View file

@ -184,10 +184,13 @@ recordImportTree remote importtreeconfig importable = do
unlessM (stillpresent db oldkey) $
logChange oldkey (Remote.uuid remote) InfoMissing
_ -> noop
db <- Export.openDb (Remote.uuid remote)
forM_ (exportedTreeishes oldexport) $ \oldtree ->
Export.runExportDiffUpdater updater db oldtree finaltree
Export.closeDb db
-- When the remote is versioned, it still contains keys
-- that are not present in the new tree.
unless (Remote.versionedExport (Remote.exportActions remote)) $ do
db <- Export.openDb (Remote.uuid remote)
forM_ (exportedTreeishes oldexport) $ \oldtree ->
Export.runExportDiffUpdater updater db oldtree finaltree
Export.closeDb db
buildImportCommit' :: Remote -> ImportCommitConfig -> Maybe Sha -> History Sha -> Annex (Maybe Sha)
buildImportCommit' remote importcommitconfig mtrackingcommit imported@(History ti _) =