summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-18 02:06:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-18 02:06:27 -0400
commitf3dcc8489d7b7f9417f9752987a298976838ce47 (patch)
treedccdaea2a16f6fde8f314c381f54b288c19a8996
parent0382d26cdbdc52c1e985cba9667a4d50d0653216 (diff)
gratuitous rename
-rw-r--r--Annex.hs30
-rw-r--r--Backend.hs14
-rw-r--r--Backend/File.hs2
-rw-r--r--Backend/SHA1.hs2
-rw-r--r--Backend/URL.hs2
-rw-r--r--Backend/WORM.hs2
-rw-r--r--BackendList.hs2
-rw-r--r--Commands.hs4
-rw-r--r--Locations.hs2
-rw-r--r--TypeInternals.hs (renamed from BackendTypes.hs)6
-rw-r--r--Types.hs2
11 files changed, 33 insertions, 35 deletions
diff --git a/Annex.hs b/Annex.hs
index 5fd500d94..b68e51355 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -17,17 +17,17 @@ import Control.Monad.State
import qualified GitRepo as Git
import Types
-import qualified BackendTypes as Backend
+import qualified TypeInternals as Internals
{- Create and returns an Annex state object for the specified git repo.
-}
new :: Git.Repo -> [Backend] -> IO AnnexState
new gitrepo allbackends = do
- let s = Backend.AnnexState {
- Backend.repo = gitrepo,
- Backend.backends = [],
- Backend.supportedBackends = allbackends,
- Backend.flags = []
+ let s = Internals.AnnexState {
+ Internals.repo = gitrepo,
+ Internals.backends = [],
+ Internals.supportedBackends = allbackends,
+ Internals.flags = []
}
(_,s') <- Annex.run s (prep gitrepo)
return s'
@@ -44,34 +44,34 @@ run state action = runStateT (action) state
gitRepo :: Annex Git.Repo
gitRepo = do
state <- get
- return (Backend.repo state)
+ return (Internals.repo state)
gitRepoChange :: Git.Repo -> Annex ()
gitRepoChange r = do
state <- get
- put state { Backend.repo = r }
+ put state { Internals.repo = r }
return ()
backends :: Annex [Backend]
backends = do
state <- get
- return (Backend.backends state)
+ return (Internals.backends state)
backendsChange :: [Backend] -> Annex ()
backendsChange b = do
state <- get
- put state { Backend.backends = b }
+ put state { Internals.backends = b }
return ()
supportedBackends :: Annex [Backend]
supportedBackends = do
state <- get
- return (Backend.supportedBackends state)
+ return (Internals.supportedBackends state)
flagIsSet :: Flag -> Annex Bool
flagIsSet flag = do
state <- get
- return $ elem flag $ Backend.flags state
+ return $ elem flag $ Internals.flags state
flagChange :: Flag -> Bool -> Annex ()
flagChange flag set = do
state <- get
- let f = filter (/= flag) $ Backend.flags state
+ let f = filter (/= flag) $ Internals.flags state
if (set)
- then put state { Backend.flags = (flag:f) }
- else put state { Backend.flags = f }
+ then put state { Internals.flags = (flag:f) }
+ else put state { Internals.flags = f }
return ()
diff --git a/Backend.hs b/Backend.hs
index dfaa55970..a427234d7 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -33,7 +33,7 @@ import qualified GitRepo as Git
import qualified Annex
import Utility
import Types
-import qualified BackendTypes as B
+import qualified TypeInternals as Internals
{- List of backends in the order to try them when storing a new key. -}
backendList :: Annex [Backend]
@@ -59,7 +59,7 @@ lookupBackendName all s =
if ((length matches) /= 1)
then error $ "unknown backend " ++ s
else matches !! 0
- where matches = filter (\b -> s == B.name b) all
+ where matches = filter (\b -> s == Internals.name b) all
{- Attempts to store a file in one of the backends. -}
storeFileKey :: FilePath -> Annex (Maybe (Key, Backend))
@@ -70,11 +70,11 @@ storeFileKey file = do
storeFileKey' b file relfile
storeFileKey' [] _ _ = return Nothing
storeFileKey' (b:bs) file relfile = do
- try <- (B.getKey b) relfile
+ try <- (Internals.getKey b) relfile
case (try) of
Nothing -> nextbackend
Just key -> do
- stored <- (B.storeFileKey b) file key
+ stored <- (Internals.storeFileKey b) file key
if (not stored)
then nextbackend
else do
@@ -85,17 +85,17 @@ storeFileKey' (b:bs) file relfile = do
{- Attempts to retrieve an key from one of the backends, saving it to
- a specified location. -}
retrieveKeyFile :: Backend -> Key -> FilePath -> Annex Bool
-retrieveKeyFile backend key dest = (B.retrieveKeyFile backend) key dest
+retrieveKeyFile backend key dest = (Internals.retrieveKeyFile backend) key dest
{- Removes a key from a backend. -}
removeKey :: Backend -> Key -> Annex Bool
-removeKey backend key = (B.removeKey backend) key
+removeKey backend key = (Internals.removeKey backend) key
{- Checks if a backend has its key. -}
hasKey :: Key -> Annex Bool
hasKey key = do
all <- Annex.supportedBackends
- (B.hasKey (lookupBackendName all $ backendName key)) key
+ (Internals.hasKey (lookupBackendName all $ backendName key)) key
{- Looks up the key and backend corresponding to an annexed file,
- by examining what the file symlinks to. -}
diff --git a/Backend/File.hs b/Backend/File.hs
index 9b81bef9a..c97a354d0 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -16,7 +16,7 @@ import System.Cmd
import System.Exit
import Control.Exception
-import BackendTypes
+import TypeInternals
import LocationLog
import Locations
import qualified Remotes
diff --git a/Backend/SHA1.hs b/Backend/SHA1.hs
index c01e01a72..2143a6af5 100644
--- a/Backend/SHA1.hs
+++ b/Backend/SHA1.hs
@@ -6,7 +6,7 @@ module Backend.SHA1 (backend) where
import Data.Digest.Pure.SHA
import qualified Backend.File
-import BackendTypes
+import TypeInternals
backend = Backend.File.backend {
name = "SHA1",
diff --git a/Backend/URL.hs b/Backend/URL.hs
index 753520766..5c1fd74c9 100644
--- a/Backend/URL.hs
+++ b/Backend/URL.hs
@@ -8,7 +8,7 @@ import Data.String.Utils
import System.Cmd
import System.Exit
-import BackendTypes
+import TypeInternals
import Core
backend = Backend {
diff --git a/Backend/WORM.hs b/Backend/WORM.hs
index 463b0ac8e..0588ddaf8 100644
--- a/Backend/WORM.hs
+++ b/Backend/WORM.hs
@@ -9,7 +9,7 @@ import System.Posix.Files
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Backend.File
-import BackendTypes
+import TypeInternals
import Utility
backend = Backend.File.backend {
diff --git a/BackendList.hs b/BackendList.hs
index 920f8fc0a..25f3ae5ea 100644
--- a/BackendList.hs
+++ b/BackendList.hs
@@ -3,8 +3,6 @@
module BackendList (allBackends) where
-import BackendTypes
-
-- When adding a new backend, import it here and add it to the list.
import qualified Backend.WORM
import qualified Backend.SHA1
diff --git a/Commands.hs b/Commands.hs
index bdeab5fc9..fab72160a 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -21,7 +21,7 @@ import LocationLog
import Types
import Core
import qualified Remotes
-import qualified BackendTypes
+import qualified TypeInternals
data CmdWants = FilesInGit | FilesNotInGit | RepoName | SingleString
data Command = Command {
@@ -87,7 +87,7 @@ parseCmd argv state = do
[] -> error usage
[Command _ action want _] -> do
f <- findWanted want (drop 1 params)
- (BackendTypes.repo state)
+ (TypeInternals.repo state)
return (flags, map action $ filter notstate f)
where
-- never include files from the state directory
diff --git a/Locations.hs b/Locations.hs
index 2b0adb7ba..18d416eb4 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -14,7 +14,7 @@ module Locations (
import Data.String.Utils
import Types
-import qualified BackendTypes as Backend
+import qualified TypeInternals as Internals
import qualified GitRepo as Git
{- Long-term, cross-repo state is stored in files inside the .git-annex
diff --git a/BackendTypes.hs b/TypeInternals.hs
index 548ef17a2..e8f7cb9e7 100644
--- a/BackendTypes.hs
+++ b/TypeInternals.hs
@@ -1,9 +1,9 @@
-{- git-annex backend data types
+{- git-annex internal data types
-
- - Mostly only backend implementations should need to import this.
+ - Most things should not need this, using Types and/or Annex instead.
-}
-module BackendTypes where
+module TypeInternals where
import Control.Monad.State (StateT)
import Data.String.Utils
diff --git a/Types.hs b/Types.hs
index 6bf26d36e..2284d9267 100644
--- a/Types.hs
+++ b/Types.hs
@@ -10,4 +10,4 @@ module Types (
Flag(..),
) where
-import BackendTypes
+import TypeInternals