aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Pairing
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-26 18:23:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-26 18:23:13 -0400
commitf8dd20a34d7851d7e3827387d323ffab585a25a2 (patch)
tree49e95430ce8e76bba061ba84f65a8550110cf830 /Assistant/Pairing
parent629a103affcf2703098e0af77c69e19f03df4f06 (diff)
external special remotes mostly implemented (untested)
This has not been tested at all. It compiles! The only known missing things are support for encryption, and for get/set of special remote configuration, and of key state. (The latter needs separate work to add a new per-key log file to store that state.) Only thing I don't much like is that initremote needs to be passed both type=external and externaltype=foo. It would be better to have just type=foo Most of this is quite straightforward code, that largely wrote itself given the types. The only tricky parts were: * Need to lock the remote when using it to eg make a request, because in theory git-annex could have multiple threads that each try to use a remote at the same time. I don't think that git-annex ever does that currently, but better safe than sorry. * Rather than starting up every external special remote program when git-annex starts, they are started only on demand, when first used. This will avoid slowdown, especially when running fast git-annex query commands. Once started, they keep running until git-annex stops, currently, which may not be ideal, but it's hard to know a better time to stop them. * Bit of a chicken and egg problem with caching the cost of the remote, because setting annex-cost in the git config needs the remote to already be set up. Managed to finesse that. This commit was sponsored by Lukas Anzinger.
Diffstat (limited to 'Assistant/Pairing')
-rw-r--r--Assistant/Pairing/MakeRemote.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assistant/Pairing/MakeRemote.hs b/Assistant/Pairing/MakeRemote.hs
index 144b236a4..3f3823664 100644
--- a/Assistant/Pairing/MakeRemote.hs
+++ b/Assistant/Pairing/MakeRemote.hs
@@ -15,6 +15,7 @@ import Assistant.MakeRemote
import Assistant.Sync
import Config.Cost
import Config
+import qualified Types.Remote as Remote
import Network.Socket
import qualified Data.Text as T
@@ -46,7 +47,7 @@ finishedLocalPairing msg keypair = do
]
Nothing
r <- liftAnnex $ addRemote $ makeSshRemote sshdata
- liftAnnex $ setRemoteCost r semiExpensiveRemoteCost
+ liftAnnex $ setRemoteCost (Remote.repo r) semiExpensiveRemoteCost
syncRemote r
{- Mostly a straightforward conversion. Except: