stub
This commit is contained in:
parent
4fbdb197d5
commit
e53900a545
3 changed files with 42 additions and 6 deletions
33
Annex.hs
33
Annex.hs
|
@ -5,7 +5,12 @@ module Annex (
|
||||||
State,
|
State,
|
||||||
startAnnex,
|
startAnnex,
|
||||||
annexFile,
|
annexFile,
|
||||||
unannexFile
|
unannexFile,
|
||||||
|
annexGetFile,
|
||||||
|
annexWantFile,
|
||||||
|
annexDropFile,
|
||||||
|
annexPushRepo,
|
||||||
|
annexPullRepo
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import System.Posix.Files
|
import System.Posix.Files
|
||||||
|
@ -83,6 +88,32 @@ unannexFile state file = do
|
||||||
renameFile src file
|
renameFile src file
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
{- Transfers the file from a remote. -}
|
||||||
|
annexGetFile :: State -> FilePath -> IO ()
|
||||||
|
annexGetFile state file = do
|
||||||
|
alreadyannexed <- lookupBackend (backends state) (repo state) file
|
||||||
|
case (alreadyannexed) of
|
||||||
|
Nothing -> error $ "not annexed " ++ file
|
||||||
|
Just _ -> do error "not implemented" -- TODO
|
||||||
|
-- 1. find remote with file
|
||||||
|
-- 2. copy file from remote
|
||||||
|
|
||||||
|
{- Indicates a file is wanted. -}
|
||||||
|
annexWantFile :: State -> FilePath -> IO ()
|
||||||
|
annexWantFile state file = do error "not implemented" -- TODO
|
||||||
|
|
||||||
|
{- Indicates a file is now wanted. -}
|
||||||
|
annexDropFile :: State -> FilePath -> IO ()
|
||||||
|
annexDropFile state file = do error "not implemented" -- TODO
|
||||||
|
|
||||||
|
{- Pushes all files to a remote repository. -}
|
||||||
|
annexPushRepo :: State -> String -> IO ()
|
||||||
|
annexPushRepo state reponame = do error "not implemented" -- TODO
|
||||||
|
|
||||||
|
{- Pulls all files from a remote repository. -}
|
||||||
|
annexPullRepo :: State -> String -> IO ()
|
||||||
|
annexPullRepo state reponame = do error "not implemented" -- TODO
|
||||||
|
|
||||||
{- Sets up a git repo for git-annex. May be called repeatedly. -}
|
{- Sets up a git repo for git-annex. May be called repeatedly. -}
|
||||||
gitPrep :: GitRepo -> IO ()
|
gitPrep :: GitRepo -> IO ()
|
||||||
gitPrep repo = do
|
gitPrep repo = do
|
||||||
|
|
12
CmdLine.hs
12
CmdLine.hs
|
@ -39,8 +39,12 @@ argvToMode argv = do
|
||||||
where header = "Usage: git-annex [mode] file"
|
where header = "Usage: git-annex [mode] file"
|
||||||
|
|
||||||
dispatch :: State -> Mode -> FilePath -> IO ()
|
dispatch :: State -> Mode -> FilePath -> IO ()
|
||||||
dispatch state mode file = do
|
dispatch state mode item = do
|
||||||
case (mode) of
|
case (mode) of
|
||||||
Add -> annexFile state file
|
Add -> annexFile state item
|
||||||
Unannex -> unannexFile state file
|
Push -> annexPushRepo state item
|
||||||
_ -> error "not implemented"
|
Pull -> annexPullRepo state item
|
||||||
|
Want -> annexWantFile state item
|
||||||
|
Get -> annexGetFile state item
|
||||||
|
Drop -> annexDropFile state item
|
||||||
|
Unannex -> unannexFile state item
|
||||||
|
|
3
UUID.hs
3
UUID.hs
|
@ -34,5 +34,6 @@ prepUUID repo =
|
||||||
then do
|
then do
|
||||||
uuid <- genUUID
|
uuid <- genUUID
|
||||||
gitRun repo ["config", configkey, uuid]
|
gitRun repo ["config", configkey, uuid]
|
||||||
gitConfigRead repo -- return new repo with updated config
|
-- return new repo with updated config
|
||||||
|
gitConfigRead repo
|
||||||
else return repo
|
else return repo
|
||||||
|
|
Loading…
Reference in a new issue