summaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 03:18:11 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 03:18:11 -0400
commit6f3572e47f57bbe5cc76b58c8bcdc9c6c455dce0 (patch)
tree4f7f31a703051b9df3986e2a3e7dbfb146e2e032 /Remotes.hs
parent0b55bd05de7b83a474ea58e9d45676934667f4bd (diff)
more reorg, spiffed up state monad
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Remotes.hs b/Remotes.hs
index 918ae2290..1802ff28e 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -9,8 +9,9 @@ module Remotes (
import Control.Monad.State (liftIO)
import qualified Data.Map as Map
import Data.String.Utils
-import AbstractTypes
+import Types
import qualified GitRepo as Git
+import qualified Annex
import LocationLog
import Locations
import UUID
@@ -23,7 +24,7 @@ list remotes = join " " $ map Git.repoDescribe remotes
{- Cost ordered list of remotes that the LocationLog indicate may have a key. -}
withKey :: Key -> Annex [Git.Repo]
withKey key = do
- g <- gitAnnex
+ g <- Annex.gitRepo
uuids <- liftIO $ keyLocations g key
allremotes <- remotesByCost
remotes <- reposByUUID allremotes uuids
@@ -36,7 +37,7 @@ withKey key = do
{- Cost Ordered list of remotes. -}
remotesByCost :: Annex [Git.Repo]
remotesByCost = do
- g <- gitAnnex
+ g <- Annex.gitRepo
reposByCost $ Git.remotes g
{- Orders a list of git repos by cost. -}
@@ -57,7 +58,7 @@ reposByCost l = do
-}
repoCost :: Git.Repo -> Annex Int
repoCost r = do
- g <- gitAnnex
+ g <- Annex.gitRepo
if ((length $ config g r) > 0)
then return $ read $ config g r
else if (Git.repoIsLocal r)
@@ -76,10 +77,10 @@ ensureGitConfigRead r = do
if (Map.null $ Git.configMap r)
then do
r' <- liftIO $ Git.configRead r
- g <- gitAnnex
+ g <- Annex.gitRepo
let l = Git.remotes g
let g' = Git.remotesAdd g $ exchange l r'
- gitAnnexChange g'
+ Annex.gitRepoChange g'
return r'
else return r
where