diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-30 15:15:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-30 15:15:46 -0400 |
commit | 0c73c08c1c0929f0ba53dcfb6d5d32a73a5f28d5 (patch) | |
tree | ec87415f92f3b766183108662fcec4bbf2bb665e /Config.hs | |
parent | fdd455e913964200177530df085f2a7ad7c7f8b2 (diff) |
cost bugfixes
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 |