summaryrefslogtreecommitdiff
path: root/Command/Move.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-12-30 14:19:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-12-30 14:19:16 -0400
commit6a5be9d53cad9ee2988c6d54001f387dfe1f2716 (patch)
treebae7346474d2ae932b856f1d70a0fca187ca6454 /Command/Move.hs
parent14d59b40fb4f3a4c9a89266fecae91a0daf08088 (diff)
rename some stuff and prepare to break out more into Command/*
Diffstat (limited to 'Command/Move.hs')
-rw-r--r--Command/Move.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index eb223f5ab..8ba8dbfac 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -21,14 +21,14 @@ import qualified Remotes
import UUID
import Messages
-seek :: [SubCmdSeek]
+seek :: [CommandSeek]
seek = [withFilesInGit $ start True]
{- Move (or copy) a file either --to or --from a repository.
-
- This only operates on the cached file content; it does not involve
- moving data in the key-value backend. -}
-start :: Bool -> SubCmdStartString
+start :: Bool -> CommandStartString
start move file = do
fromName <- Annex.flagGet "fromrepository"
toName <- Annex.flagGet "torepository"
@@ -61,7 +61,7 @@ remoteHasKey remote key present = do
- A file's content can be moved even if there are insufficient copies to
- allow it to be dropped.
-}
-toStart :: Bool -> SubCmdStartString
+toStart :: Bool -> CommandStartString
toStart move file = isAnnexed file $ \(key, _) -> do
ishere <- inAnnex key
if not ishere
@@ -69,7 +69,7 @@ toStart move file = isAnnexed file $ \(key, _) -> do
else do
showAction move file
return $ Just $ toPerform move key
-toPerform :: Bool -> Key -> SubCmdPerform
+toPerform :: Bool -> Key -> CommandPerform
toPerform move key = do
-- checking the remote is expensive, so not done in the start step
remote <- Remotes.commandLineRemote
@@ -86,7 +86,7 @@ toPerform move key = do
then return $ Just $ toCleanup move remote key tmpfile
else return Nothing -- failed
Right True -> return $ Just $ Command.Drop.cleanup key
-toCleanup :: Bool -> Git.Repo -> Key -> FilePath -> SubCmdCleanup
+toCleanup :: Bool -> Git.Repo -> Key -> FilePath -> CommandCleanup
toCleanup move remote key tmpfile = do
-- Tell remote to use the transferred content.
ok <- Remotes.runCmd remote "git-annex" ["setkey", "--quiet",
@@ -107,7 +107,7 @@ toCleanup move remote key tmpfile = do
- If the current repository already has the content, it is still removed
- from the other repository when moving.
-}
-fromStart :: Bool -> SubCmdStartString
+fromStart :: Bool -> CommandStartString
fromStart move file = isAnnexed file $ \(key, _) -> do
remote <- Remotes.commandLineRemote
(trusted, untrusted, _) <- Remotes.keyPossibilities key
@@ -116,7 +116,7 @@ fromStart move file = isAnnexed file $ \(key, _) -> do
else do
showAction move file
return $ Just $ fromPerform move key
-fromPerform :: Bool -> Key -> SubCmdPerform
+fromPerform :: Bool -> Key -> CommandPerform
fromPerform move key = do
remote <- Remotes.commandLineRemote
ishere <- inAnnex key
@@ -128,7 +128,7 @@ fromPerform move key = do
if ok
then return $ Just $ fromCleanup move remote key
else return Nothing -- fail
-fromCleanup :: Bool -> Git.Repo -> Key -> SubCmdCleanup
+fromCleanup :: Bool -> Git.Repo -> Key -> CommandCleanup
fromCleanup True remote key = do
ok <- Remotes.runCmd remote "git-annex"
["dropkey", "--quiet", "--force",