summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-14 12:33:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-14 12:33:02 -0400
commitd611c20fe039881461db7b76ca3155d10e9b6a1f (patch)
tree50ded25a8f75817aaf56e5f6d9fd9b6d8cb457b2 /Annex
parent195d478d65ba0b0e862e2b9ea28edd49012d651f (diff)
Changed drop ordering when using git annex sync --content or the assistant, to drop from remotes first and from the local repo last. This works better with the behavior changes to drop in many cases.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Drop.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Annex/Drop.hs b/Annex/Drop.hs
index 791273d8e..aabc1c31f 100644
--- a/Annex/Drop.hs
+++ b/Annex/Drop.hs
@@ -30,7 +30,10 @@ type Reason = String
- The UUIDs are ones where the content is believed to be present.
- The Remote list can include other remotes that do not have the content;
- only ones that match the UUIDs will be dropped from.
- - If allowed to drop fromhere, that drop will be tried first.
+ -
+ - If allowed to drop fromhere, that drop will be done last. This is done
+ - because local drops do not need any LockedCopy evidence, and so dropping
+ - from local last allows the content to be removed from more remotes.
-
- A VerifiedCopy can be provided as an optimisation when eg, a key
- has just been uploaded to a remote.
@@ -52,8 +55,8 @@ handleDropsFrom locs rs reason fromhere key afile preverified runner = do
, return $ maybeToList afile
)
n <- getcopies fs
- if fromhere && checkcopies n Nothing
- then go fs rs =<< dropl fs n
+ void $ if fromhere && checkcopies n Nothing
+ then go fs rs n >>= dropl fs
else go fs rs n
where
getcopies fs = do
@@ -78,12 +81,12 @@ handleDropsFrom locs rs reason fromhere key afile preverified runner = do
| S.member u untrusted = v
| otherwise = decrcopies v Nothing
- go _ [] _ = noop
+ go _ [] n = pure n
go fs (r:rest) n
| uuid r `S.notMember` slocs = go fs rest n
| checkcopies n (Just $ Remote.uuid r) =
dropr fs r n >>= go fs rest
- | otherwise = noop
+ | otherwise = pure n
checkdrop fs n u a
| null fs = check $ -- no associated files; unused content