From 13fff71f2019ae098c3f8532ac2734cb1ab11498 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 13 Dec 2011 15:05:07 -0400 Subject: split out three modules from Git Constructors and configuration make sense in separate modules. A separate Git.Types is needed to avoid cycles. --- Remote/Bup.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Remote/Bup.hs') diff --git a/Remote/Bup.hs b/Remote/Bup.hs index e705bbb34..4d63d88e1 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -15,6 +15,8 @@ import System.Process import Common.Annex import Types.Remote import qualified Git +import qualified Git.Config +import qualified Git.Construct import Config import Annex.Ssh import Remote.Helper.Special @@ -163,8 +165,8 @@ storeBupUUID u buprepo = do [Params $ "config annex.uuid " ++ v] >>! error "ssh failed" else liftIO $ do - r' <- Git.configRead r - let olduuid = Git.configGet "annex.uuid" "" r' + r' <- Git.Config.read r + let olduuid = Git.Config.get "annex.uuid" "" r' when (olduuid == "") $ Git.run "config" [Param "annex.uuid", Param v] r' @@ -192,9 +194,9 @@ getBupUUID :: Git.Repo -> UUID -> Annex (UUID, Git.Repo) getBupUUID r u | Git.repoIsUrl r = return (u, r) | otherwise = liftIO $ do - ret <- try $ Git.configRead r + ret <- try $ Git.Config.read r case ret of - Right r' -> return (toUUID $ Git.configGet "annex.uuid" "" r', r') + Right r' -> return (toUUID $ Git.Config.get "annex.uuid" "" r', r') Left _ -> return (NoUUID, r) {- Converts a bup remote path spec into a Git.Repo. There are some @@ -203,13 +205,13 @@ bup2GitRemote :: BupRepo -> IO Git.Repo bup2GitRemote "" = do -- bup -r "" operates on ~/.bup h <- myHomeDir - Git.repoFromAbsPath $ h ".bup" + Git.Construct.fromAbsPath $ h ".bup" bup2GitRemote r | bupLocal r = if head r == '/' - then Git.repoFromAbsPath r + then Git.Construct.fromAbsPath r else error "please specify an absolute path" - | otherwise = Git.repoFromUrl $ "ssh://" ++ host ++ slash dir + | otherwise = Git.Construct.fromUrl $ "ssh://" ++ host ++ slash dir where bits = split ":" r host = head bits -- cgit v1.2.3