summaryrefslogtreecommitdiff
path: root/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-30 15:15:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-30 15:15:46 -0400
commit0c73c08c1c0929f0ba53dcfb6d5d32a73a5f28d5 (patch)
treeec87415f92f3b766183108662fcec4bbf2bb665e /Config.hs
parentfdd455e913964200177530df085f2a7ad7c7f8b2 (diff)
cost bugfixes
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Config.hs b/Config.hs
index c821364ce..17a1fa985 100644
--- a/Config.hs
+++ b/Config.hs
@@ -42,14 +42,17 @@ remoteConfig r key = "remote." ++ fromMaybe "" (Git.repoRemoteName r) ++ ".annex
- The default cost is 100 for local repositories, and 200 for remote
- repositories; it can also be configured by remote.<name>.annex-cost
-}
-remoteCost :: Git.Repo -> Annex Int
-remoteCost r = do
+remoteCost :: Git.Repo -> Int -> Annex Int
+remoteCost r def = do
c <- getConfig r "cost" ""
if not $ null c
then return $ read c
- else if not $ Git.repoIsUrl r
- then return 100
- else return 200
+ else return def
+
+cheapRemoteCost :: Int
+cheapRemoteCost = 100
+expensiveRemoteCost :: Int
+expensiveRemoteCost = 200
{- Checks if a repo should be ignored, based either on annex-ignore
- setting, or on command-line options. Allows command-line to override