improve thirdpartypopulated support
May actually work now. Note that, importKey now has to add the size to the key if it's supposed to have size. Remote.Directory relied on the importer adding the size, which is no longer done, so it was changed; it was the only one. This way, importKey does not need to behave differently between regular and thirdpartypopulated imports.
This commit is contained in:
parent
57b03630b3
commit
15000dee07
5 changed files with 56 additions and 50 deletions
|
@ -371,9 +371,11 @@ guardSameContentIdentifiers cont old new
|
|||
| otherwise = giveup "file content has changed"
|
||||
|
||||
importKeyM :: RawFilePath -> ExportLocation -> ContentIdentifier -> ByteSize -> MeterUpdate -> Annex (Maybe Key)
|
||||
importKeyM dir loc cid _sz p = do
|
||||
importKeyM dir loc cid sz p = do
|
||||
backend <- chooseBackend f
|
||||
k <- fst <$> genKey ks p backend
|
||||
unsizedk <- fst <$> genKey ks p backend
|
||||
let k = alterKey unsizedk $ \kd -> kd
|
||||
{ keySize = keySize kd <|> Just sz }
|
||||
currcid <- liftIO $ mkContentIdentifier absf
|
||||
=<< R.getFileStatus absf
|
||||
guardSameContentIdentifiers (return (Just k)) cid currcid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue