rename file

This commit is contained in:
Joey Hess 2011-03-15 22:04:50 -04:00
parent f27df5e658
commit 4594bd51c1
12 changed files with 21 additions and 22 deletions

View file

@ -25,7 +25,7 @@ import Data.Maybe
import qualified GitRepo as Git
import qualified GitQueue
import qualified BackendTypes
import qualified BackendClass
import Utility
-- git-annex's monad
@ -34,8 +34,8 @@ type Annex = StateT AnnexState IO
-- internal state storage
data AnnexState = AnnexState
{ repo :: Git.Repo
, backends :: [BackendTypes.Backend Annex]
, supportedBackends :: [BackendTypes.Backend Annex]
, backends :: [BackendClass.Backend Annex]
, supportedBackends :: [BackendClass.Backend Annex]
, repoqueue :: GitQueue.Queue
, quiet :: Bool
, force :: Bool
@ -47,7 +47,7 @@ data AnnexState = AnnexState
, remotesread :: Bool
} deriving (Show)
newState :: Git.Repo -> [BackendTypes.Backend Annex] -> AnnexState
newState :: Git.Repo -> [BackendClass.Backend Annex] -> AnnexState
newState gitrepo allbackends = AnnexState
{ repo = gitrepo
, backends = []
@ -64,7 +64,7 @@ newState gitrepo allbackends = AnnexState
}
{- Create and returns an Annex state object for the specified git repo. -}
new :: Git.Repo -> [BackendTypes.Backend Annex] -> IO AnnexState
new :: Git.Repo -> [BackendClass.Backend Annex] -> IO AnnexState
new gitrepo allbackends = do
gitrepo' <- liftIO $ Git.configRead gitrepo
return $ newState gitrepo' allbackends

View file

@ -40,7 +40,7 @@ import qualified GitRepo as Git
import qualified Annex
import Types
import Key
import qualified BackendTypes as B
import qualified BackendClass as B
import Messages
{- List of backends in the order to try them when storing a new key. -}

View file

@ -18,7 +18,7 @@ import Control.Monad.State
import System.Directory
import Data.List
import BackendTypes
import BackendClass
import LocationLog
import Locations
import qualified Remotes

View file

@ -16,7 +16,7 @@ import Data.Maybe
import System.Posix.Files
import qualified Backend.File
import BackendTypes
import BackendClass
import Messages
import qualified Annex
import Locations

View file

@ -11,7 +11,7 @@ import Control.Monad.State (liftIO)
import Data.String.Utils
import Types
import BackendTypes
import BackendClass
import Utility
import Messages

View file

@ -14,7 +14,7 @@ import System.Directory
import Data.Maybe
import qualified Backend.File
import BackendTypes
import BackendClass
import Locations
import qualified Annex
import Content

View file

@ -7,7 +7,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
module BackendTypes where
module BackendClass where
import Key

View file

@ -17,7 +17,7 @@ import Data.List
import Types
import qualified Backend
import qualified BackendTypes
import qualified BackendClass
import Messages
import qualified Annex
import qualified GitRepo as Git
@ -237,7 +237,7 @@ cmdlineKey = do
backends <- Backend.list
return $ stubKey {
keyName = kname k,
keyBackendName = BackendTypes.name $ head backends
keyBackendName = BackendClass.name $ head backends
}
where
kname Nothing = badkey

View file

@ -13,7 +13,7 @@ import System.Exit
import Command
import Content
import qualified Backend
import qualified BackendTypes
import qualified BackendClass
import Key
command :: [Command]
@ -28,7 +28,7 @@ start keyname = do
backends <- Backend.list
let key = stubKey {
keyName = keyname,
keyBackendName = BackendTypes.name (head backends)
keyBackendName = BackendClass.name (head backends)
}
error "BROKEN. fixme!"
present <- inAnnex key

3
Key.hs
View file

@ -76,11 +76,10 @@ instance Arbitrary Key where
arbitrary = do
n <- arbitrary
b <- elements ['A'..'Z']
s <- arbitrary
return $ Key {
keyName = n,
keyBackendName = [b],
keySize = s,
keySize = Nothing,
keyMtime = Nothing
}

View file

@ -11,6 +11,6 @@ module Types (
Key
) where
import BackendTypes
import BackendClass
import Annex
import Key

View file

@ -29,7 +29,7 @@ import qualified Backend
import qualified GitRepo as Git
import qualified Locations
import qualified Utility
import qualified BackendTypes
import qualified BackendClass
import qualified Types
import qualified GitAnnex
import qualified LocationLog
@ -120,8 +120,8 @@ test_add = "git-annex add" ~: TestList [basic, sha1dup]
test_setkey :: Test
test_setkey = "git-annex setkey/fromkey" ~: TestCase $ inmainrepo $ do
writeFile tmp $ content sha1annexedfile
r <- annexeval $ BackendTypes.getKey backendSHA1 tmp
let sha1 = BackendTypes.keyName $ fromJust r
r <- annexeval $ BackendClass.getKey backendSHA1 tmp
let sha1 = Key.keyName $ fromJust r
git_annex "setkey" ["-q", "--backend", "SHA1", "--key", sha1, tmp] @? "setkey failed"
git_annex "fromkey" ["-q", "--backend", "SHA1", "--key", sha1, sha1annexedfile] @? "fromkey failed"
Utility.boolSystem "git" [Utility.Params "commit -q -a -m commit"] @? "git commit failed"
@ -439,7 +439,7 @@ test_unused = "git-annex unused/dropunused" ~: intmpclonerepo $ do
checkunused [annexedfilekey, sha1annexedfilekey]
-- good opportunity to test dropkey also
git_annex "dropkey" ["-q", "--force", BackendTypes.keyName annexedfilekey]
git_annex "dropkey" ["-q", "--force", Key.keyName annexedfilekey]
@? "dropkey failed"
checkunused [sha1annexedfilekey]