summaryrefslogtreecommitdiff
path: root/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-17 01:13:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-17 01:13:21 -0400
commit50cfcdf54b828fbeab532b712e00063ae9e82581 (patch)
tree1d32f1930baf8d9b13f257ca90ac4de16611effc /Config.hs
parent89fab6c7b8955ef26e653d539f7be3b70129c15e (diff)
make encrypted remotes have slightly higher costs
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Config.hs b/Config.hs
index 53f1a455f..a324427d4 100644
--- a/Config.hs
+++ b/Config.hs
@@ -52,10 +52,25 @@ remoteCost r def = do
cheapRemoteCost :: Int
cheapRemoteCost = 100
semiCheapRemoteCost :: Int
-semiCheapRemoteCost = 150
+semiCheapRemoteCost = 110
expensiveRemoteCost :: Int
expensiveRemoteCost = 200
+{- Adjust's a remote's cost to reflect it being encrypted. -}
+encryptedRemoteCostAdj :: Int
+encryptedRemoteCostAdj = 50
+
+{- Make sure the remote cost numbers work out. -}
+prop_cost_sane :: Bool
+prop_cost_sane = False `notElem`
+ [ expensiveRemoteCost > 0
+ , cheapRemoteCost < semiCheapRemoteCost
+ , semiCheapRemoteCost < expensiveRemoteCost
+ , cheapRemoteCost + encryptedRemoteCostAdj > semiCheapRemoteCost
+ , cheapRemoteCost + encryptedRemoteCostAdj < expensiveRemoteCost
+ , semiCheapRemoteCost + encryptedRemoteCostAdj < expensiveRemoteCost
+ ]
+
{- Checks if a repo should be ignored, based either on annex-ignore
- setting, or on command-line options. Allows command-line to override
- annex-ignore. -}