From 77aedbef8bd755754f1395dec8f5c57f6d6e576f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Dec 2020 16:25:02 -0400 Subject: [PATCH] fix call to warnExportImportConflict That needs a Remote that has the right export/import set up, not the input Remote, which does not yet. --- Remote/Helper/ExportImport.hs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Remote/Helper/ExportImport.hs b/Remote/Helper/ExportImport.hs index 412f297066..9ff6f92800 100644 --- a/Remote/Helper/ExportImport.hs +++ b/Remote/Helper/ExportImport.hs @@ -104,11 +104,7 @@ adjustExportImport :: Remote -> RemoteStateHandle -> Annex Remote adjustExportImport r rs = do isexport <- pure (exportTree (config r)) <&&> isExportSupported r isimport <- pure (importTree (config r)) <&&> isImportSupported r - let normal = not isexport && not isimport - let iskeyvaluestore = normal || appendonly r - dbv <- prepdbv - ciddbv <- prepciddb - return $ r + let r' = r { remotetype = (remotetype r) { exportSupported = if isexport then exportSupported (remotetype r) @@ -117,7 +113,19 @@ adjustExportImport r rs = do then importSupported (remotetype r) else importUnsupported } - , exportActions = if isexport + } + if not isexport && not isimport + then return r' + else adjustExportImport' isexport isimport r' rs + +adjustExportImport' :: Bool -> Bool -> Remote -> RemoteStateHandle -> Annex Remote +adjustExportImport' isexport isimport r rs = do + dbv <- prepdbv + ciddbv <- prepciddb + let normal = not isexport && not isimport + let iskeyvaluestore = normal || appendonly r + return $ r + { exportActions = if isexport then if isimport then exportActionsForImport dbv ciddbv (exportActions r) else exportActions r -- 2.30.2