diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-26 16:44:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-26 16:44:14 -0400 |
commit | b7903eb2d149ceb164d7422fb56573735d83ebde (patch) | |
tree | 83203e2fbc2ce7a6f5e24cfb23bfcc1b821d96cf /Remotes.hs | |
parent | 7f6af79232eee685daf58e72737c5284f80cf482 (diff) |
move partitioning out of keyPossibilities
And a bug fix in passing.
Diffstat (limited to 'Remotes.hs')
-rw-r--r-- | Remotes.hs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Remotes.hs b/Remotes.hs index fe5b7f767..be4c1383a 100644 --- a/Remotes.hs +++ b/Remotes.hs @@ -113,14 +113,10 @@ readConfigs = do {- Cost ordered lists of remotes that the LocationLog indicate may have a key. - - - The first list is of remotes that are trusted to have the key. - - - - The second is of untrusted remotes that may have the key. - - - Also returns a list of UUIDs that are trusted to have the key - (some may not have configured remotes). -} -keyPossibilities :: Key -> Annex ([Git.Repo], [Git.Repo], [UUID]) +keyPossibilities :: Key -> Annex ([Git.Repo], [UUID]) keyPossibilities key = do readConfigs @@ -129,23 +125,17 @@ keyPossibilities key = do u <- getUUID g trusted <- trustGet Trusted - -- get uuids of other repositories that are - -- believed to have the key + -- get uuids of all repositories that are recorded to have the key uuids <- liftIO $ keyLocations g key let validuuids = filter (/= u) uuids - -- get uuids trusted to have the key -- note that validuuids is assumed to not have dups let validtrusteduuids = intersect validuuids trusted -- remotes that match uuids that have the key validremotes <- reposByUUID allremotes validuuids - -- partition out the trusted and untrusted remotes - trustedremotes <- reposByUUID validremotes validtrusteduuids - untrustedremotes <- reposWithoutUUID validremotes trusted - - return (trustedremotes, untrustedremotes, validtrusteduuids) + return (validremotes, validtrusteduuids) {- Checks if a given remote has the content for a key inAnnex. - If the remote cannot be accessed, returns a Left error. |