From 40ade7a515776ea781ad53205d24c5071a5f7f71 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 May 2021 14:57:38 -0400 Subject: [PATCH] add some functions listing log files Not used yet, will be used by copy-branch to generate the list of files to copy. --- Logs.hs | 20 +++++++++++++++++++ ..._3565680846a8d547d0912d1ef31430b2._comment | 7 +++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Logs.hs b/Logs.hs index 03d72caa82..2948106692 100644 --- a/Logs.hs +++ b/Logs.hs @@ -60,6 +60,26 @@ getLogVariety config f logFilesToCache :: Int logFilesToCache = 2 +{- All the log files that might contain information about a key. -} +keyLogFiles :: GitConfig -> Key -> [RawFilePath] +keyLogFiles config k = + [ locationLogFile config k + , urlLogFile config k + , remoteStateLogFile config k + , metaDataLogFile config k + , remoteMetaDataLogFile config k + , remoteContentIdentifierLogFile config k + , chunkLogFile config k + ] ++ oldurlLogs config k + +{- All the log files that do not contain information specific to a key. -} +nonKeyLogFiles :: [RawFilePath] +nonKeyLogFiles = concat + [ topLevelNewUUIDBasedLogs + , topLevelOldUUIDBasedLogs + , otherTopLevelLogs + ] + {- All the old-format uuid-based logs stored in the top of the git-annex branch. -} topLevelOldUUIDBasedLogs :: [RawFilePath] topLevelOldUUIDBasedLogs = diff --git a/doc/todo/copy-key___40__--batch__41___to_copy__47__merge_availability_info/comment_5_3565680846a8d547d0912d1ef31430b2._comment b/doc/todo/copy-key___40__--batch__41___to_copy__47__merge_availability_info/comment_5_3565680846a8d547d0912d1ef31430b2._comment index 444918d789..7a816fa126 100644 --- a/doc/todo/copy-key___40__--batch__41___to_copy__47__merge_availability_info/comment_5_3565680846a8d547d0912d1ef31430b2._comment +++ b/doc/todo/copy-key___40__--batch__41___to_copy__47__merge_availability_info/comment_5_3565680846a8d547d0912d1ef31430b2._comment @@ -26,15 +26,14 @@ uuid, including a special case involving remoteLog. Implementation plan: * Address above problems with dropDead, somehow, so it can be reused. + (done; refactored to filterBranch) * Add a function (in Logs) from a key to all possible git-annex branch log - files for that key. + files for that key. (done; keyLogFiles) * For each key seeked, run that function, query the branch to see which log files exist, and pass through dropDead to filter and populate the temporary index. This way, the command does not need to buffer the whole set of keys in memory. -* Get a list of all non-key logs - `(topLevelNewUUIDBasedLogs++topLevelOldUUIDBasedLogs++otherLogs)`, - and pass them all through dropDead as well. +* Pass nonKeyLogFiles through dropDead as well. * Refactor regraftexports from Annex.Branch, and call it after constructing the filtered index. """]]