summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 02:41:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 02:41:54 -0400
commit4c1d8b9689043c18214b1da7d5c145fb0859443d (patch)
tree5a64d81d7e1cc8805c1283e2f48a5d11532c2fe9
parent48643b68b3ff05399b72f44b8b02ff34d6de046c (diff)
more namespace cleanup
-rw-r--r--Annex.hs10
-rw-r--r--BackendFile.hs8
-rw-r--r--Remotes.hs18
3 files changed, 18 insertions, 18 deletions
diff --git a/Annex.hs b/Annex.hs
index 54f9b9dff..c26baabef 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -20,7 +20,7 @@ import List
import qualified GitRepo as Git
import Utility
import Locations
-import Backend
+import qualified Backend
import BackendList
import UUID
import LocationLog
@@ -46,7 +46,7 @@ start = do
prepUUID
inBackend file yes no = do
- r <- liftIO $ lookupFile file
+ r <- liftIO $ Backend.lookupFile file
case (r) of
Just v -> yes v
Nothing -> no
@@ -57,7 +57,7 @@ notinBackend file yes no = inBackend file no yes
annexCmd :: FilePath -> Annex ()
annexCmd file = inBackend file err $ do
liftIO $ checkLegal file
- stored <- storeFile file
+ stored <- Backend.storeFile file
g <- gitAnnex
case (stored) of
Nothing -> error $ "no backend could store: " ++ file
@@ -93,7 +93,7 @@ annexCmd file = inBackend file err $ do
{- Inverse of annexCmd. -}
unannexCmd :: FilePath -> Annex ()
unannexCmd file = notinBackend file err $ \(key, backend) -> do
- dropFile backend key
+ Backend.dropFile backend key
logStatus key ValueMissing
g <- gitAnnex
let src = annexLocation g backend key
@@ -121,7 +121,7 @@ getCmd file = notinBackend file err $ \(key, backend) -> do
g <- gitAnnex
let dest = annexLocation g backend key
liftIO $ createDirectoryIfMissing True (parentDir dest)
- success <- retrieveFile backend key dest
+ success <- Backend.retrieveFile backend key dest
if (success)
then do
logStatus key ValuePresent
diff --git a/BackendFile.hs b/BackendFile.hs
index 6c1dc0623..a0396f51d 100644
--- a/BackendFile.hs
+++ b/BackendFile.hs
@@ -10,7 +10,7 @@ import Control.Exception
import Types
import LocationLog
import Locations
-import Remotes
+import qualified Remotes
import qualified GitRepo as Git
backend = Backend {
@@ -39,17 +39,17 @@ dummyRemove url = return False
- and copy it over to this one. -}
copyKeyFile :: Key -> FilePath -> Annex (Bool)
copyKeyFile key file = do
- remotes <- remotesWithKey key
+ remotes <- Remotes.withKey key
trycopy remotes remotes
where
trycopy full [] = error $ "unable to get: " ++ (keyFile key) ++ "\n" ++
"To get that file, need access to one of these remotes: " ++
- (remotesList full)
+ (Remotes.list full)
trycopy full (r:rs) = do
-- annexLocation needs the git config to have been
-- read for a remote, so do that now,
-- if it hasn't been already
- r' <- remoteEnsureGitConfigRead r
+ r' <- Remotes.ensureGitConfigRead r
result <- liftIO $ (try (copyFromRemote r' key file)::IO (Either SomeException ()))
case (result) of
Left err -> do
diff --git a/Remotes.hs b/Remotes.hs
index 39404bf19..918ae2290 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -1,9 +1,9 @@
{- git-annex remote repositories -}
module Remotes (
- remotesList,
- remotesWithKey,
- remoteEnsureGitConfigRead
+ list,
+ withKey,
+ ensureGitConfigRead
) where
import Control.Monad.State (liftIO)
@@ -17,12 +17,12 @@ import UUID
import List
{- Human visible list of remotes. -}
-remotesList :: [Git.Repo] -> String
-remotesList remotes = join " " $ map Git.repoDescribe remotes
+list :: [Git.Repo] -> String
+list remotes = join " " $ map Git.repoDescribe remotes
{- Cost ordered list of remotes that the LocationLog indicate may have a key. -}
-remotesWithKey :: Key -> Annex [Git.Repo]
-remotesWithKey key = do
+withKey :: Key -> Annex [Git.Repo]
+withKey key = do
g <- gitAnnex
uuids <- liftIO $ keyLocations g key
allremotes <- remotesByCost
@@ -71,8 +71,8 @@ repoCost r = do
- because reading it may be expensive. This function ensures that it is
- read for a specified remote, and updates state. It returns the
- updated git repo also. -}
-remoteEnsureGitConfigRead :: Git.Repo -> Annex Git.Repo
-remoteEnsureGitConfigRead r = do
+ensureGitConfigRead :: Git.Repo -> Annex Git.Repo
+ensureGitConfigRead r = do
if (Map.null $ Git.configMap r)
then do
r' <- liftIO $ Git.configRead r