summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-16 21:44:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-16 21:44:42 -0400
commit4b5f9f886356580cea75f68787601ac1be32122f (patch)
treefb1797914b34ca235f915c8aebf88d278b7fbfa4 /Command
parent344755c7d7df9bbcfdc3187bde4215e9e32ff63f (diff)
drop: fix misleading message
Diffstat (limited to 'Command')
-rw-r--r--Command/Drop.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 2552b3d37..f7491deae 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -108,21 +108,22 @@ canDropKey key numcopiesM have check skip = do
findCopies key need skip have check
findCopies :: Key -> Int -> [UUID] -> [UUID] -> [Remote] -> Annex Bool
-findCopies key need skip = helper []
+findCopies key need skip = helper [] []
where
- helper bad have []
+ helper bad missing have []
| length have >= need = return True
- | otherwise = notEnoughCopies key need have skip bad
- helper bad have (r:rs)
+ | otherwise = notEnoughCopies key need have (skip++missing) bad
+ helper bad missing have (r:rs)
| length have >= need = return True
| otherwise = do
let u = Remote.uuid r
let duplicate = u `elem` have
haskey <- Remote.hasKey r key
case (duplicate, haskey) of
- (False, Right True) -> helper bad (u:have) rs
- (False, Left _) -> helper (r:bad) have rs
- _ -> helper bad have rs
+ (False, Right True) -> helper bad missing (u:have) rs
+ (False, Left _) -> helper (r:bad) missing have rs
+ (False, Right False) -> helper bad (u:missing) have rs
+ _ -> helper bad missing have rs
notEnoughCopies :: Key -> Int -> [UUID] -> [UUID] -> [Remote] -> Annex Bool
notEnoughCopies key need have skip bad = do