Support configuring remote.web.annex-cost and remote.bittorrent.annex-cost

Seems that has never worked before due to oversight.
This commit is contained in:
Joey Hess 2018-06-23 18:16:37 -04:00
parent b6ae4c0509
commit a5228ac765
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 11 additions and 4 deletions

View file

@ -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.

View file

@ -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

View file

@ -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