simplify
adjustExportImport' is never called with both isexport and isimport False.
This commit is contained in:
parent
46059ab0e5
commit
5ce7fce74a
1 changed files with 4 additions and 10 deletions
|
@ -128,9 +128,7 @@ adjustExportImport' :: Bool -> Bool -> Remote -> RemoteStateHandle -> Annex Remo
|
||||||
adjustExportImport' isexport isimport r rs = do
|
adjustExportImport' isexport isimport r rs = do
|
||||||
dbv <- prepdbv
|
dbv <- prepdbv
|
||||||
ciddbv <- prepciddb
|
ciddbv <- prepciddb
|
||||||
let normal = not isexport && not isimport
|
|
||||||
let versioned = versionedExport (exportActions r)
|
let versioned = versionedExport (exportActions r)
|
||||||
let iskeyvaluestore = normal || versioned
|
|
||||||
return $ r
|
return $ r
|
||||||
{ exportActions = if isexport
|
{ exportActions = if isexport
|
||||||
then if isimport
|
then if isimport
|
||||||
|
@ -167,7 +165,7 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
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
|
||||||
else removeKey r k
|
else removeKey r k
|
||||||
, lockContent = if iskeyvaluestore || not mergeable
|
, lockContent = if versioned || not mergeable
|
||||||
then lockContent r
|
then lockContent r
|
||||||
else Nothing
|
else Nothing
|
||||||
, retrieveKeyFile = \k af dest p ->
|
, retrieveKeyFile = \k af dest p ->
|
||||||
|
@ -178,7 +176,7 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
then supportversionedretrieve k af dest p $
|
then supportversionedretrieve 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
|
||||||
, retrieveKeyFileCheap = if iskeyvaluestore
|
, retrieveKeyFileCheap = if versioned
|
||||||
then retrieveKeyFileCheap r
|
then retrieveKeyFileCheap r
|
||||||
else Nothing
|
else Nothing
|
||||||
, checkPresent = \k -> if versioned
|
, checkPresent = \k -> if versioned
|
||||||
|
@ -205,14 +203,10 @@ adjustExportImport' isexport isimport r rs = do
|
||||||
-- silently skip non-present files from behaving
|
-- silently skip non-present files from behaving
|
||||||
-- in confusing ways when there's an export
|
-- in confusing ways when there's an export
|
||||||
-- conflict (or an import conflict).
|
-- conflict (or an import conflict).
|
||||||
, checkPresentCheap = if normal
|
, checkPresentCheap = False
|
||||||
then checkPresentCheap r
|
|
||||||
else False
|
|
||||||
-- git-annex testremote cannot be used to test
|
-- git-annex testremote cannot be used to test
|
||||||
-- import/export since it stores keys.
|
-- import/export since it stores keys.
|
||||||
, mkUnavailable = if normal
|
, mkUnavailable = return Nothing
|
||||||
then mkUnavailable r
|
|
||||||
else return Nothing
|
|
||||||
, getInfo = do
|
, getInfo = do
|
||||||
is <- getInfo r
|
is <- getInfo r
|
||||||
is' <- if isexport && not mergeable
|
is' <- if isexport && not mergeable
|
||||||
|
|
Loading…
Reference in a new issue