change info from export=yes to exporttree=yes and same for import
for consistency
This commit is contained in:
parent
933c86f186
commit
f930176d6e
1 changed files with 23 additions and 23 deletions
|
@ -102,35 +102,35 @@ adjustExportImportRemoteType rt = rt { setup = setup' }
|
||||||
-- | Adjust a remote to support exporttree=yes and/or importree=yes.
|
-- | Adjust a remote to support exporttree=yes and/or importree=yes.
|
||||||
adjustExportImport :: Remote -> RemoteStateHandle -> Annex Remote
|
adjustExportImport :: Remote -> RemoteStateHandle -> Annex Remote
|
||||||
adjustExportImport r rs = do
|
adjustExportImport r rs = do
|
||||||
isexport <- pure (exportTree (config r)) <&&> isExportSupported r
|
isexporttree <- pure (exportTree (config r)) <&&> isexporttreeSupported r
|
||||||
isimport <- pure (importTree (config r)) <&&> isImportSupported r
|
isimporttree <- pure (importTree (config r)) <&&> isimporttreeSupported r
|
||||||
let r' = r
|
let r' = r
|
||||||
{ remotetype = (remotetype r)
|
{ remotetype = (remotetype r)
|
||||||
{ exportSupported = if isexport
|
{ exportSupported = if isexporttree
|
||||||
then exportSupported (remotetype r)
|
then exportSupported (remotetype r)
|
||||||
else exportUnsupported
|
else exportUnsupported
|
||||||
, importSupported = if isimport
|
, importSupported = if isimporttree
|
||||||
then importSupported (remotetype r)
|
then importSupported (remotetype r)
|
||||||
else importUnsupported
|
else importUnsupported
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if not isexport && not isimport
|
if not isexporttree && not isimporttree
|
||||||
then return r'
|
then return r'
|
||||||
else adjustExportImport' isexport isimport r' rs
|
else adjustExportImport' isexporttree isimporttree r' rs
|
||||||
|
|
||||||
adjustExportImport' :: Bool -> Bool -> Remote -> RemoteStateHandle -> Annex Remote
|
adjustExportImport' :: Bool -> Bool -> Remote -> RemoteStateHandle -> Annex Remote
|
||||||
adjustExportImport' isexport isimport r rs = do
|
adjustExportImport' isexporttree isimporttree r rs = do
|
||||||
dbv <- prepdbv
|
dbv <- prepdbv
|
||||||
ciddbv <- prepciddb
|
ciddbv <- prepciddb
|
||||||
let normal = not isexport && not isimport
|
let normal = not isexporttree && not isimporttree
|
||||||
let iskeyvaluestore = normal || appendonly r
|
let iskeyvaluestore = normal || appendonly r
|
||||||
return $ r
|
return $ r
|
||||||
{ exportActions = if isexport
|
{ exportActions = if isexporttree
|
||||||
then if isimport
|
then if isimporttree
|
||||||
then exportActionsForImport dbv ciddbv (exportActions r)
|
then exportActionsForImport dbv ciddbv (exportActions r)
|
||||||
else exportActions r
|
else exportActions r
|
||||||
else exportUnsupported
|
else exportUnsupported
|
||||||
, importActions = if isimport
|
, importActions = if isimporttree
|
||||||
then importActions r
|
then importActions r
|
||||||
else importUnsupported
|
else importUnsupported
|
||||||
, storeKey = \k af p ->
|
, storeKey = \k af p ->
|
||||||
|
@ -139,9 +139,9 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
-- when another repository has already stored the
|
-- when another repository has already stored the
|
||||||
-- key, and the local repository does not know
|
-- key, and the local repository does not know
|
||||||
-- about it. To avoid unnecessary costs, don't do it.
|
-- about it. To avoid unnecessary costs, don't do it.
|
||||||
if isexport
|
if isexporttree
|
||||||
then giveup "remote is configured with exporttree=yes; use `git-annex export` to store content on it"
|
then giveup "remote is configured with exporttree=yes; use `git-annex export` to store content on it"
|
||||||
else if isimport
|
else if isimporttree
|
||||||
then giveup "remote is configured with importtree=yes and without exporttree=yes; cannot modify content stored on it"
|
then giveup "remote is configured with importtree=yes and without exporttree=yes; cannot modify content stored on it"
|
||||||
else storeKey r k af p
|
else storeKey r k af p
|
||||||
, removeKey = \k ->
|
, removeKey = \k ->
|
||||||
|
@ -151,19 +151,19 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
-- files would not be dealt with correctly.
|
-- files would not be dealt with correctly.
|
||||||
-- There does not seem to be a good use case for
|
-- There does not seem to be a good use case for
|
||||||
-- removing a key from an export in any case.
|
-- removing a key from an export in any case.
|
||||||
if isexport
|
if isexporttree
|
||||||
then giveup "dropping content from an export is not supported; use `git annex export` to export a tree that lacks the files you want to remove"
|
then giveup "dropping content from an export is not supported; use `git annex export` to export a tree that lacks the files you want to remove"
|
||||||
else if isimport
|
else if isimporttree
|
||||||
then giveup "dropping content from this remote is not supported because it is configured with importtree=yes"
|
then giveup "dropping content from this remote is not supported because it is configured with importtree=yes"
|
||||||
else removeKey r k
|
else removeKey r k
|
||||||
, lockContent = if iskeyvaluestore
|
, lockContent = if iskeyvaluestore
|
||||||
then lockContent r
|
then lockContent r
|
||||||
else Nothing
|
else Nothing
|
||||||
, retrieveKeyFile = \k af dest p ->
|
, retrieveKeyFile = \k af dest p ->
|
||||||
if isimport
|
if isimporttree
|
||||||
then supportappendonlyretrieve k af dest p $
|
then supportappendonlyretrieve k af dest p $
|
||||||
retrieveKeyFileFromImport dbv ciddbv k af dest p
|
retrieveKeyFileFromImport dbv ciddbv k af dest p
|
||||||
else if isexport
|
else if isexporttree
|
||||||
then supportappendonlyretrieve k af dest p $
|
then supportappendonlyretrieve k af dest p $
|
||||||
retrieveKeyFileFromExport dbv k af dest p
|
retrieveKeyFileFromExport dbv k af dest p
|
||||||
else retrieveKeyFile r k af dest p
|
else retrieveKeyFile r k af dest p
|
||||||
|
@ -172,10 +172,10 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
else Nothing
|
else Nothing
|
||||||
, checkPresent = \k -> if appendonly r
|
, checkPresent = \k -> if appendonly r
|
||||||
then checkPresent r k
|
then checkPresent r k
|
||||||
else if isimport
|
else if isimporttree
|
||||||
then anyM (checkPresentImport ciddbv k)
|
then anyM (checkPresentImport ciddbv k)
|
||||||
=<< getexportlocs dbv k
|
=<< getexportlocs dbv k
|
||||||
else if isexport
|
else if isexporttree
|
||||||
-- Check if any of the files a key
|
-- Check if any of the files a key
|
||||||
-- was exported to are present. This
|
-- was exported to are present. This
|
||||||
-- doesn't guarantee the export
|
-- doesn't guarantee the export
|
||||||
|
@ -201,14 +201,14 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
else return Nothing
|
else return Nothing
|
||||||
, getInfo = do
|
, getInfo = do
|
||||||
is <- getInfo r
|
is <- getInfo r
|
||||||
is' <- if isexport
|
is' <- if isexporttree
|
||||||
then do
|
then do
|
||||||
ts <- map fromRef . exportedTreeishes
|
ts <- map fromRef . exportedTreeishes
|
||||||
<$> getExport (uuid r)
|
<$> getExport (uuid r)
|
||||||
return (is++[("export", "yes"), ("exportedtree", unwords ts)])
|
return (is++[("exporttree", "yes"), ("exportedtree", unwords ts)])
|
||||||
else return is
|
else return is
|
||||||
return $ if isimport
|
return $ if isimporttree
|
||||||
then (is'++[("import", "yes")])
|
then (is'++[("importtree", "yes")])
|
||||||
else is'
|
else is'
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue