webapp: Set locally paired repositories to a lower cost than other network remotes.

This commit is contained in:
Joey Hess 2013-03-13 14:10:29 -04:00
parent 02facde154
commit 9b657a2ccc
7 changed files with 28 additions and 8 deletions

View file

@ -20,15 +20,17 @@ import qualified Command.InitRemote
import Logs.UUID
import Logs.Remote
import Git.Remote
import Config
import qualified Data.Text as T
import qualified Data.Map as M
{- Sets up and begins syncing with a new ssh or rsync remote. -}
makeSshRemote :: Bool -> SshData -> Assistant Remote
makeSshRemote forcersync sshdata = do
makeSshRemote :: Bool -> SshData -> Maybe Int -> Assistant Remote
makeSshRemote forcersync sshdata mcost = do
r <- liftAnnex $
addRemote $ maker (sshRepoName sshdata) sshurl
liftAnnex $ maybe noop (setRemoteCost r) mcost
syncNewRemote r
return r
where