{- git-annex command
-
- - Copyright 2010-2023 Joey Hess <id@joeyh.name>
+ - Copyright 2010-2024 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
import Logs.File
import Logs.Location
import Annex.NumCopies
+import Types.Cluster
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy as L
- On the other hand, when the destination repository did not start
- with a copy of a file, it can be dropped from the source without
- making numcopies worse, so the move is allowed even if numcopies
- - is not met.
+ - is not met. (However, when the source is a cluster, dropping from it
+ - drops from all nodes, and so numcopies must be checked.)
-
- Similarly, a file can move from an untrusted repository to another
- untrusted repository, even if that is the only copy of the file.
willDropMakeItWorse :: UUID -> UUID -> DestStartedWithCopy -> Key -> AssociatedFile -> Annex DropCheck
willDropMakeItWorse srcuuid destuuid (DestStartedWithCopy deststartedwithcopy _) key afile =
ifM (Command.Drop.checkRequiredContent (Command.Drop.PreferredContentChecked False) srcuuid key afile)
- ( if deststartedwithcopy
+ ( if deststartedwithcopy || isClusterUUID srcuuid
then unlessforced DropCheckNumCopies
else ifM checktrustlevel
( return DropAllowed
protocol. (done, but need to check for fencepost errors on resume of
incomplete upload with remotes at different points)
-* Problem: `move --from cluster` in "does this make it worse"
- check may fail to realize that dropping from multiple nodes does in fact
- make it worse.
-
* `git-annex sync --content` does not send content to clusters, or to
proxied remotes. And when operating on clusters, it should operate on the
cluster as a whole, not on cluster nodes.