summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-05 20:16:57 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-05 20:16:57 -0400
commit6040d8aed17de582f5d5c179040e29c599315e31 (patch)
treebb524b386d740353e35a99c235a5d9b6af1f4ddb /Command
parent9f1577f74684d8d627e75d3021eb1ff50ef7492f (diff)
factor out RemoteLog
Diffstat (limited to 'Command')
-rw-r--r--Command/InitRemote.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index a3054630c..15962ad99 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -15,6 +15,7 @@ import Data.String.Utils
import Command
import qualified Remote
+import qualified RemoteLog
import qualified Types.Remote as R
import Types
import UUID
@@ -42,7 +43,7 @@ start ws = do
where
name = head ws
- config = Remote.keyValToConfig $ tail ws
+ config = RemoteLog.keyValToConfig $ tail ws
needname = do
let err s = error $ "Specify a name for the remote. " ++ s
names <- remoteNames
@@ -58,13 +59,13 @@ perform t u c = do
cleanup :: UUID -> R.RemoteConfig -> CommandCleanup
cleanup u c = do
- Remote.configSet u c
+ RemoteLog.configSet u c
return True
{- Look up existing remote's UUID and config by name, or generate a new one -}
findByName :: String -> Annex (UUID, R.RemoteConfig)
findByName name = do
- m <- Remote.readRemoteLog
+ m <- RemoteLog.readRemoteLog
maybe generate return $ findByName' name m
where
generate = do
@@ -83,7 +84,7 @@ findByName' n m = if null matches then Nothing else Just $ head matches
remoteNames :: Annex [String]
remoteNames = do
- m <- Remote.readRemoteLog
+ m <- RemoteLog.readRemoteLog
return $ catMaybes $ map ((M.lookup nameKey) . snd) $ M.toList m
{- find the specified remote type -}