break depends cycle

This commit is contained in:
Joey Hess 2010-10-14 15:58:53 -04:00
parent 859731ee5b
commit d4ce072452
3 changed files with 13 additions and 3 deletions

View file

@ -33,6 +33,19 @@ import qualified Annex
import Utility import Utility
import Types import Types
import qualified BackendTypes as B import qualified BackendTypes as B
import BackendList
{- List of backends in the order to try them when storing a new key. -}
backendList :: Annex [Backend]
backendList = do
l <- Annex.backends
if (0 < length l)
then return l
else do
g <- Annex.gitRepo
let l = parseBackendList $ Git.configGet g "annex.backends" ""
Annex.backendsChange l
return l
{- Attempts to store a file in one of the backends. -} {- Attempts to store a file in one of the backends. -}
storeFileKey :: FilePath -> Annex (Maybe (Key, Backend)) storeFileKey :: FilePath -> Annex (Maybe (Key, Backend))

View file

@ -14,7 +14,6 @@ import Locations
import qualified Remotes import qualified Remotes
import qualified GitRepo as Git import qualified GitRepo as Git
import Utility import Utility
import Core
backend = Backend { backend = Backend {
name = "file", name = "file",

View file

@ -27,8 +27,6 @@ start = do
g' <- liftIO $ Git.configRead g g' <- liftIO $ Git.configRead g
Annex.gitRepoChange g' Annex.gitRepoChange g'
liftIO $ gitSetup g' liftIO $ gitSetup g'
Annex.backendsChange $ parseBackendList $
Git.configGet g' "annex.backends" ""
prepUUID prepUUID
{- Sets up a git repo for git-annex. May be called repeatedly. -} {- Sets up a git repo for git-annex. May be called repeatedly. -}