This commit is contained in:
Joey Hess 2011-06-23 15:30:04 -04:00
parent 068703c405
commit c5531046bc

View file

@ -131,19 +131,7 @@ remotesWithoutUUID rs us = filter (\r -> uuid r `notElem` us) rs
{- Cost ordered lists of remotes that the LocationLog indicate may have a key.
-}
keyPossibilities :: Key -> Annex [Remote Annex]
keyPossibilities key = do
g <- Annex.gitRepo
u <- getUUID g
-- get uuids of all remotes that are recorded to have the key
uuids <- keyLocations key
let validuuids = filter (/= u) uuids
-- remotes that match uuids that have the key
allremotes <- genList
let validremotes = remotesWithUUID allremotes validuuids
return $ sort validremotes
keyPossibilities key = return . fst =<< keyPossibilities' False key
{- Cost ordered lists of remotes that the LocationLog indicate may have a key.
-
@ -151,10 +139,13 @@ keyPossibilities key = do
- (some may not have configured remotes).
-}
keyPossibilitiesTrusted :: Key -> Annex ([Remote Annex], [UUID])
keyPossibilitiesTrusted key = do
keyPossibilitiesTrusted = keyPossibilities' True
keyPossibilities' :: Bool -> Key -> Annex ([Remote Annex], [UUID])
keyPossibilities' withtrusted key = do
g <- Annex.gitRepo
u <- getUUID g
trusted <- trustGet Trusted
trusted <- if withtrusted then trustGet Trusted else return []
-- get uuids of all remotes that are recorded to have the key
uuids <- keyLocations key