update location log during import

This commit is contained in:
Joey Hess 2019-02-27 13:58:03 -04:00
parent 775e6ed86f
commit b1f10fbb4d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 10 additions and 0 deletions

View file

@ -37,6 +37,7 @@ import Utility.Metered
import Utility.DataUnits
import Logs.Export
import Logs.ContentIdentifier
import Logs.Location
import qualified Database.Export as Export
import qualified Database.ContentIdentifier as CID
@ -223,6 +224,8 @@ downloadImport remote importtreeconfig importablecontents = do
Remote.retrieveExportWithContentIdentifier ia loc cid tmpfile (ingestkey loc tmpfile) p >>= \case
Just k -> do
recordcidkey cidmap db cid k
logStatus k InfoPresent
logChange k (Remote.uuid remote) InfoPresent
return $ Just (loc, k)
Nothing -> return Nothing
where

View file

@ -12,6 +12,13 @@ this.
* need to check if a remote has importtree=yes before trying to import from it
* Importing from a remote updates the location log for downloaded keys to
indicate they're present in the remote. So it should also update the
location log for keys that were present in the remote, but no longer are.
This will need a fast way to list the keys that are thought to be present
in the remote; one way would be to remember the previous list of contents
in the remote, and diff between it and the current one.
* "git annex import master --from rmt" followed by "git annex import master:sub --from rmt"
first makes the tracking branch contain only what's in the remote,
and then grafts what's in the remote into a subdir. Is that the behavior