summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-13 15:55:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-13 15:55:18 -0400
commite28ff5bdaf7ce56c0c928904ff883c1e2cd093de (patch)
tree53426c78f8d22c1a0b4e5a52811cd1299c97f85b /Annex.hs
parent77055f5ff82d2712f599ba77e03d5d2cc022ff65 (diff)
almost able to get files from remotes now!
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs30
1 files changed, 1 insertions, 29 deletions
diff --git a/Annex.hs b/Annex.hs
index e06bd84bc..834c26115 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -9,7 +9,6 @@ module Annex (
annexWantFile,
annexDropFile,
annexPushRepo,
- annexRemotes,
annexPullRepo
) where
@@ -161,37 +160,10 @@ gitSetup repo = do
{- Updates the LocationLog when a key's presence changes. -}
logStatus state key status = do
- f <- logChange (repo state) key (getUUID (repo state)) status
+ f <- logChange (repo state) key (getUUID state (repo state)) status
gitRun (repo state) ["add", f]
gitRun (repo state) ["commit", "-m", "git-annex log update", f]
{- Checks if a given key is currently present in the annexLocation -}
inAnnex :: State -> Backend -> Key -> IO Bool
inAnnex state backend key = doesFileExist $ annexLocation state backend key
-
-{- Ordered list of remotes for the annex. -}
-annexRemotes :: State -> [GitRepo]
-annexRemotes state = reposByCost state $ gitConfigRemotes (repo state)
-
-{- Orders a list of git repos by cost. -}
-reposByCost :: State -> [GitRepo] -> [GitRepo]
-reposByCost state l =
- fst $ unzip $ sortBy (\(r1, c1) (r2, c2) -> compare c1 c2) $ costpairs l
- where
- costpairs l = map (\r -> (r, repoCost state r)) l
-
-{- Calculates cost for a repo.
- -
- - The default cost is 100 for local repositories, and 200 for remote
- - repositories; it can also be configured by remote.<name>.annex-cost
- -}
-repoCost :: State -> GitRepo -> Int
-repoCost state r =
- if ((length $ config state r) > 0)
- then read $ config state r
- else if (gitRepoIsLocal r)
- then 100
- else 200
- where
- config state r = gitConfig (repo state) (configkey r) ""
- configkey r = "remote." ++ (gitRepoRemoteName r) ++ ".annex-cost"