drop: fix misleading message
This commit is contained in:
parent
e68e65f5a3
commit
52e6eeaf06
1 changed files with 8 additions and 7 deletions
|
@ -108,21 +108,22 @@ canDropKey key numcopiesM have check skip = do
|
||||||
findCopies key need skip have check
|
findCopies key need skip have check
|
||||||
|
|
||||||
findCopies :: Key -> Int -> [UUID] -> [UUID] -> [Remote] -> Annex Bool
|
findCopies :: Key -> Int -> [UUID] -> [UUID] -> [Remote] -> Annex Bool
|
||||||
findCopies key need skip = helper []
|
findCopies key need skip = helper [] []
|
||||||
where
|
where
|
||||||
helper bad have []
|
helper bad missing have []
|
||||||
| length have >= need = return True
|
| length have >= need = return True
|
||||||
| otherwise = notEnoughCopies key need have skip bad
|
| otherwise = notEnoughCopies key need have (skip++missing) bad
|
||||||
helper bad have (r:rs)
|
helper bad missing have (r:rs)
|
||||||
| length have >= need = return True
|
| length have >= need = return True
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
let u = Remote.uuid r
|
let u = Remote.uuid r
|
||||||
let duplicate = u `elem` have
|
let duplicate = u `elem` have
|
||||||
haskey <- Remote.hasKey r key
|
haskey <- Remote.hasKey r key
|
||||||
case (duplicate, haskey) of
|
case (duplicate, haskey) of
|
||||||
(False, Right True) -> helper bad (u:have) rs
|
(False, Right True) -> helper bad missing (u:have) rs
|
||||||
(False, Left _) -> helper (r:bad) have rs
|
(False, Left _) -> helper (r:bad) missing have rs
|
||||||
_ -> helper bad 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 -> Int -> [UUID] -> [UUID] -> [Remote] -> Annex Bool
|
||||||
notEnoughCopies key need have skip bad = do
|
notEnoughCopies key need have skip bad = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue