diff --git a/CHANGELOG b/CHANGELOG index 25da6e4afe..f694af942b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ + + * Support configuring remote.web.annex-cost and remote.bittorrent.annex-cost + git-annex (6.20180530) UNRELEASED; urgency=medium * Fix build with ghc 8.4+, which broke due to the Semigroup Monoid change. diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs index 8cc559d917..3246153c4a 100644 --- a/Remote/BitTorrent.hs +++ b/Remote/BitTorrent.hs @@ -14,6 +14,7 @@ import Types.Remote import qualified Annex import qualified Git import qualified Git.Construct +import Config import Config.Cost import Logs.Web import Types.UrlContents @@ -51,10 +52,11 @@ list _autoinit = do return [r] gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex (Maybe Remote) -gen r _ c gc = +gen r _ c gc = do + cst <- remoteCost gc expensiveRemoteCost return $ Just Remote { uuid = bitTorrentUUID - , cost = expensiveRemoteCost + , cost = cst , name = Git.repoDescribe r , storeKey = uploadKey , retrieveKeyFile = downloadKey diff --git a/Remote/Web.hs b/Remote/Web.hs index 03cbe706d5..0cff68ceba 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -15,6 +15,7 @@ import qualified Git import qualified Git.Construct import Annex.Content import Config.Cost +import Config import Logs.Web import Annex.UUID import Messages.Progress @@ -40,10 +41,11 @@ list _autoinit = do return [r] gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex (Maybe Remote) -gen r _ c gc = +gen r _ c gc = do + cst <- remoteCost gc expensiveRemoteCost return $ Just Remote { uuid = webUUID - , cost = expensiveRemoteCost + , cost = cst , name = Git.repoDescribe r , storeKey = uploadKey , retrieveKeyFile = downloadKey