diff options
author | Joey Hess <joeyh@joeyh.name> | 2023-05-31 15:45:23 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2023-05-31 16:01:34 -0400 |
commit | c6acf574c715dc3abf2c8fa0fbd65f40e13e4665 (patch) | |
tree | 4d863afd4913331f9cf4eed00be139a628d879e6 /Types/Import.hs | |
parent | 72981235204b5065676880be42cf64079efae881 (diff) |
implement importChanges optimisaton (not used yet)
For simplicity, I've not tried to make it handle History yet, so when
there is a history, a full import will still be done. Probably the right
way to handle history is to first diff from the current tree to the last
imported tree. Then, diff from the current tree to each of the
historical trees, and recurse through the history diffing from child tree
to parent tree.
I don't think that will need a record of the previously imported
historical trees, and so Logs.Import doesn't store them. Although I did
leave room for future expansion in that log just in case.
Next step will be to change importTree to importChanges and modify
recordImportTree et all to handle it, by using adjustTree.
Sponsored-by: Brett Eisenberg on Patreon
Diffstat (limited to 'Types/Import.hs')
-rw-r--r-- | Types/Import.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Types/Import.hs b/Types/Import.hs index db5b25d39f..9b0fa226d6 100644 --- a/Types/Import.hs +++ b/Types/Import.hs @@ -1,11 +1,11 @@ {- git-annex import types - - - Copyright 2019-2021 Joey Hess <id@joeyh.name> + - Copyright 2019-2023 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -} -{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveGeneric, DeriveFunctor #-} module Types.Import where @@ -67,7 +67,7 @@ data ImportableContents info = ImportableContents -- locations. So, if a remote does not support Key/Value access, -- it should not populate the importableHistory. } - deriving (Show, Generic) + deriving (Show, Generic, Functor) instance NFData info => NFData (ImportableContents info) @@ -81,6 +81,7 @@ data ImportableContentsChunkable m info , importableHistoryComplete :: [ImportableContents info] -- ^ Chunking the history is not supported } + deriving (Functor) {- A chunk of ImportableContents, which is the entire content of a subtree - of the main tree. Nested subtrees are not allowed. -} @@ -92,6 +93,7 @@ data ImportableContentsChunk m info = ImportableContentsChunk -- ^ Continuation to get the next chunk. -- Returns Nothing when there are no more chunks. } + deriving (Functor) newtype ImportChunkSubDir = ImportChunkSubDir { importChunkSubDir :: RawFilePath } |