export appendonly support
Make `git annex export` check appendonly when removing a file from an export, and not update the location log, since the remote still contains the content. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
02630b39ee
commit
8b39db20b5
4 changed files with 15 additions and 11 deletions
|
@ -285,11 +285,15 @@ cleanupUnexport r ea db eks loc = do
|
||||||
removeExportedLocation db (asKey ek) loc
|
removeExportedLocation db (asKey ek) loc
|
||||||
flushDbQueue db
|
flushDbQueue db
|
||||||
|
|
||||||
remaininglocs <- liftIO $
|
-- A readonly remote can support removeExportLocation to remove
|
||||||
concat <$> forM eks (\ek -> getExportedLocation db (asKey ek))
|
-- the file from the exported tree, but still retain the content
|
||||||
when (null remaininglocs) $
|
-- and allow retrieving it.
|
||||||
forM_ eks $ \ek ->
|
unless (Remote.readonly) $ do
|
||||||
logChange (asKey ek) (uuid r) InfoMissing
|
remaininglocs <- liftIO $
|
||||||
|
concat <$> forM eks (\ek -> getExportedLocation db (asKey ek))
|
||||||
|
when (null remaininglocs) $
|
||||||
|
forM_ eks $ \ek ->
|
||||||
|
logChange (asKey ek) (uuid r) InfoMissing
|
||||||
|
|
||||||
removeEmptyDirectories ea db loc (map asKey eks)
|
removeEmptyDirectories ea db loc (map asKey eks)
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ gen r u c gc = do
|
||||||
, remotetype = remote
|
, remotetype = remote
|
||||||
, availability = if bupLocal buprepo then LocallyAvailable else GloballyAvailable
|
, availability = if bupLocal buprepo then LocallyAvailable else GloballyAvailable
|
||||||
, readonly = False
|
, readonly = False
|
||||||
, appendonly = True
|
, appendonly = False
|
||||||
, mkUnavailable = return Nothing
|
, mkUnavailable = return Nothing
|
||||||
, getInfo = return [("repo", buprepo)]
|
, getInfo = return [("repo", buprepo)]
|
||||||
, claimUrl = Nothing
|
, claimUrl = Nothing
|
||||||
|
|
|
@ -123,7 +123,9 @@ data RemoteA a = Remote
|
||||||
-- a Remote can be known to be readonly
|
-- a Remote can be known to be readonly
|
||||||
, readonly :: Bool
|
, readonly :: Bool
|
||||||
-- a Remote can allow writes but not have a way to delete content
|
-- a Remote can allow writes but not have a way to delete content
|
||||||
-- from it
|
-- from it. Note that an export remote that supports removeExport
|
||||||
|
-- to remove a file from the exported tree, but still retains the
|
||||||
|
-- content in accessible form should set this to True.
|
||||||
, appendonly :: Bool
|
, appendonly :: Bool
|
||||||
-- a Remote can be globally available. (Ie, "in the cloud".)
|
-- a Remote can be globally available. (Ie, "in the cloud".)
|
||||||
, availability :: Availability
|
, availability :: Availability
|
||||||
|
|
|
@ -31,7 +31,7 @@ won't be updated, as discussed above.
|
||||||
## final plan
|
## final plan
|
||||||
|
|
||||||
Add an "appendOnly" field to Remote, indicating it retains all content stored
|
Add an "appendOnly" field to Remote, indicating it retains all content stored
|
||||||
in it.
|
in it. done
|
||||||
|
|
||||||
Let S3 remotes be configured with versioned=yes or something like that
|
Let S3 remotes be configured with versioned=yes or something like that
|
||||||
(what does S3 call the feature?) which enables appendOnly.
|
(what does S3 call the feature?) which enables appendOnly.
|
||||||
|
@ -43,7 +43,7 @@ Make S3 refuse to removeKey when configured appendOnly, failing with an error.
|
||||||
|
|
||||||
Make `git annex export` check appendOnly when removing a file from an
|
Make `git annex export` check appendOnly when removing a file from an
|
||||||
export, and not update the location log, since the remote still contains
|
export, and not update the location log, since the remote still contains
|
||||||
the content.
|
the content. done
|
||||||
|
|
||||||
Make git-annex sync and the assistant skip trying to drop from appendOnly
|
Make git-annex sync and the assistant skip trying to drop from appendOnly
|
||||||
remotes since it's just going to fail.
|
remotes since it's just going to fail.
|
||||||
|
@ -52,8 +52,6 @@ Make exporttree=yes remotes that are appendOnly be trusted, and not force
|
||||||
verification of content, since the usual concerns about losing data when an
|
verification of content, since the usual concerns about losing data when an
|
||||||
export is updated by someone else don't apply.
|
export is updated by someone else don't apply.
|
||||||
|
|
||||||
Make bup an appendOnly remote.
|
|
||||||
|
|
||||||
When a file was deleted from an exported tree, and then put back
|
When a file was deleted from an exported tree, and then put back
|
||||||
in a later exported tree, it might get re-uploaded even though the content
|
in a later exported tree, it might get re-uploaded even though the content
|
||||||
is still retained in the versioned remote. S3 might have a way to avoid
|
is still retained in the versioned remote. S3 might have a way to avoid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue