summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-12 15:44:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-12 15:44:54 -0400
commite53900a54597437818d785aa6b1683b3b49d2afb (patch)
tree3a1f37ca19be15361a2a26111eb80a4ad0ef697d
parent4fbdb197d524720d1ea77795b33cb5d24152bce9 (diff)
stub
-rw-r--r--Annex.hs33
-rw-r--r--CmdLine.hs12
-rw-r--r--UUID.hs3
3 files changed, 42 insertions, 6 deletions
diff --git a/Annex.hs b/Annex.hs
index ed3e4e33a..af2569719 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -5,7 +5,12 @@ module Annex (
State,
startAnnex,
annexFile,
- unannexFile
+ unannexFile,
+ annexGetFile,
+ annexWantFile,
+ annexDropFile,
+ annexPushRepo,
+ annexPullRepo
) where
import System.Posix.Files
@@ -83,6 +88,32 @@ unannexFile state file = do
renameFile src file
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. -}
gitPrep :: GitRepo -> IO ()
gitPrep repo = do
diff --git a/CmdLine.hs b/CmdLine.hs
index cc8708889..60ba81d30 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -39,8 +39,12 @@ argvToMode argv = do
where header = "Usage: git-annex [mode] file"
dispatch :: State -> Mode -> FilePath -> IO ()
-dispatch state mode file = do
+dispatch state mode item = do
case (mode) of
- Add -> annexFile state file
- Unannex -> unannexFile state file
- _ -> error "not implemented"
+ Add -> annexFile state item
+ Push -> annexPushRepo state item
+ Pull -> annexPullRepo state item
+ Want -> annexWantFile state item
+ Get -> annexGetFile state item
+ Drop -> annexDropFile state item
+ Unannex -> unannexFile state item
diff --git a/UUID.hs b/UUID.hs
index 0b795b8c1..40c2330ee 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -34,5 +34,6 @@ prepUUID repo =
then do
uuid <- genUUID
gitRun repo ["config", configkey, uuid]
- gitConfigRead repo -- return new repo with updated config
+ -- return new repo with updated config
+ gitConfigRead repo
else return repo