summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-13 03:51:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-13 03:51:55 -0400
commit1dbf36bf9a951b7a92770ea0b57bc79c8b465795 (patch)
tree0e633e337a45514425120bf4f0203afb548d8eaa /Annex.hs
parentff998a9a677ba4a4af9e4bd45a651653421760cb (diff)
cleanup3
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Annex.hs b/Annex.hs
index eb57e2d57..012e90199 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -24,10 +24,6 @@ import UUID
import LocationLog
import Types
-{- Checks if a given key is currently present in the annexLocation -}
-inAnnex :: State -> Backend -> Key -> IO Bool
-inAnnex state backend key = doesFileExist $ annexLocation state backend key
-
{- On startup, examine the git repo, prepare it, and record state for
- later. -}
startAnnex :: IO State
@@ -89,7 +85,6 @@ unannexFile :: State -> FilePath -> IO ()
unannexFile state file = notinBackend file err $ \(key, backend) -> do
dropFile state backend key
logStatus state key ValueMissing
- let src = annexLocation state backend key
removeFile file
gitRun (repo state) ["rm", file]
gitRun (repo state) ["commit", "-m",
@@ -97,12 +92,13 @@ unannexFile state file = notinBackend file err $ \(key, backend) -> do
-- git rm deletes empty directories;
-- put them back
createDirectoryIfMissing True (parentDir file)
+ let src = annexLocation state backend key
renameFile src file
return ()
where
err = error $ "not annexed " ++ file
-{- Transfers the file from a remote. -}
+{- Gets an annexed file from one of the backends. -}
annexGetFile :: State -> FilePath -> IO ()
annexGetFile state file = notinBackend file err $ \(key, backend) -> do
inannex <- inAnnex state backend key
@@ -165,3 +161,7 @@ logStatus state key status = do
f <- logChange (repo state) key (getUUID (repo state)) status
gitRun (repo state) ["add", f]
gitRun (repo state) ["commit", "-m", "git-annex log update", f]
+
+{- Checks if a given key is currently present in the annexLocation -}
+inAnnex :: State -> Backend -> Key -> IO Bool
+inAnnex state backend key = doesFileExist $ annexLocation state backend key