support thirdPartyPopulated

These don't have importTree in their config, because they don't support
tree import, but they do still support import, and do not support export
or key/value modification.
This commit is contained in:
Joey Hess 2020-12-21 13:46:04 -04:00
parent 706e2a63fb
commit 57b03630b3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 7 additions and 4 deletions

View file

@ -11,7 +11,7 @@ import Annex.Common
import qualified Annex import qualified Annex
import Logs.Trust import Logs.Trust
import Annex.NumCopies import Annex.NumCopies
import Types.Remote (uuid, appendonly, config) import Types.Remote (uuid, appendonly, config, remotetype, thirdPartyPopulated)
import qualified Remote import qualified Remote
import qualified Command.Drop import qualified Command.Drop
import Command import Command
@ -88,6 +88,7 @@ handleDropsFrom locs rs reason fromhere key afile si preverified runner = do
| appendonly r = go fs rest n | appendonly r = go fs rest n
| exportTree (config r) = go fs rest n | exportTree (config r) = go fs rest n
| importTree (config r) = go fs rest n | importTree (config r) = go fs rest n
| thirdPartyPopulated (remotetype r) = go fs rest n
| checkcopies n (Just $ Remote.uuid r) = | checkcopies n (Just $ Remote.uuid r) =
dropr fs r n >>= go fs rest dropr fs r n >>= go fs rest
| otherwise = pure n | otherwise = pure n

View file

@ -57,7 +57,8 @@ calcSyncRemotes = do
contentremotes <- filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) $ contentremotes <- filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) $
filter (\r -> Remote.uuid r /= NoUUID) syncable filter (\r -> Remote.uuid r /= NoUUID) syncable
let (exportremotes, nonexportremotes) = partition (exportTree . Remote.config) contentremotes let (exportremotes, nonexportremotes) = partition (exportTree . Remote.config) contentremotes
let dataremotes = filter (not . importTree . Remote.config) nonexportremotes let isimport r = importTree (Remote.config r) || Remote.thirdPartyPopulated (Remote.remotetype r)
let dataremotes = filter (not . isimport) nonexportremotes
return $ \dstatus -> dstatus return $ \dstatus -> dstatus
{ syncRemotes = syncable { syncRemotes = syncable

View file

@ -212,8 +212,9 @@ seek' o = do
dataremotes <- filter (\r -> Remote.uuid r /= NoUUID) dataremotes <- filter (\r -> Remote.uuid r /= NoUUID)
<$> filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) remotes <$> filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) remotes
let (exportremotes, nonexportremotes) = partition (exportTree . Remote.config) dataremotes let (exportremotes, nonexportremotes) = partition (exportTree . Remote.config) dataremotes
let importremotes = filter (importTree . Remote.config) dataremotes let isimport r = importTree (Remote.config r) || Remote.thirdPartyPopulated (Remote.remotetype r)
let keyvalueremotes = filter (not . importTree . Remote.config) nonexportremotes let importremotes = filter isimport dataremotes
let keyvalueremotes = filter (not . isimport) nonexportremotes
if cleanupOption o if cleanupOption o
then do then do