From b1f10fbb4d765a1fdb5464c909b7b0fe21397e8c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 Feb 2019 13:58:03 -0400 Subject: [PATCH] update location log during import --- Annex/Import.hs | 3 +++ doc/todo/import_tree.mdwn | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Annex/Import.hs b/Annex/Import.hs index 46852c6373..690aad56e0 100644 --- a/Annex/Import.hs +++ b/Annex/Import.hs @@ -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 diff --git a/doc/todo/import_tree.mdwn b/doc/todo/import_tree.mdwn index a8cdd3967a..f64a5bf9b1 100644 --- a/doc/todo/import_tree.mdwn +++ b/doc/todo/import_tree.mdwn @@ -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