Added graftTree but it's buggy.

Should use graftTree in Annex.Branch.graftTreeish; it will be faster
than the current implementation there.

Started Annex.Import, but untested and it doesn't yet handle tree
grafting.
This commit is contained in:
Joey Hess 2019-02-21 17:32:59 -04:00
parent 56137ce0d2
commit 8fdea8f444
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
15 changed files with 172 additions and 30 deletions

View file

@ -21,7 +21,7 @@ import Utility.Split
import qualified System.FilePath.Posix as Posix
-- A location on a remote that a key can be exported to.
-- The FilePath will be relative to the top of the export,
-- The FilePath will be relative to the top of the remote,
-- and uses unix-style path separators.
newtype ExportLocation = ExportLocation FilePath
deriving (Show, Eq)

View file

@ -19,6 +19,9 @@ import Utility.FileSystemEncoding
- location on the remote. -}
type ImportLocation = ExportLocation
fromImportLocation :: ImportLocation -> FilePath
fromImportLocation = fromExportLocation
{- An identifier for content stored on a remote that has been imported into
- the repository. It should be reasonably short since it is stored in the
- git-annex branch. -}
@ -32,10 +35,11 @@ instance Arbitrary ContentIdentifier where
arbitrary = ContentIdentifier . encodeBS
<$> arbitrary `suchThat` all isAscii
{- List of files that can be imported from a remote. -}
data ImportableContents = ImportableContents
{ importableContents :: [(ImportLocation, ContentIdentifier)]
, importableHistory :: [ImportableContents]
{- List of files that can be imported from a remote, each with some added
- information. -}
data ImportableContents info = ImportableContents
{ importableContents :: [(ImportLocation, info)]
, importableHistory :: [ImportableContents info]
-- ^ Used by remotes that support importing historical versions of
-- files that are stored in them. This is equivilant to a git
-- commit history.

View file

@ -247,7 +247,7 @@ data ImportActions a = ImportActions
--
-- May also find old versions of files that are still stored in the
-- remote.
{ listImportableContents :: a (Maybe ImportableContents)
{ listImportableContents :: a (Maybe (ImportableContents ContentIdentifier))
-- Retrieves a file from the remote. Ensures that the file
-- it retrieves has the requested ContentIdentifier.
--