summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-08 15:15:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-08 15:15:21 -0400
commit070e8530c1151dc96dec099eac8b967277751b10 (patch)
tree8605013ee71aeafdb2bb89612cf3e2044882ab6d /Command
parent02a21d7f274568a2e2f94498607955aab8713a24 (diff)
refactoring, no code changes really
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs1
-rw-r--r--Command/Drop.hs1
-rw-r--r--Command/DropKey.hs1
-rw-r--r--Command/Fix.hs1
-rw-r--r--Command/FromKey.hs1
-rw-r--r--Command/Fsck.hs29
-rw-r--r--Command/Get.hs1
-rw-r--r--Command/Init.hs1
-rw-r--r--Command/Move.hs5
-rw-r--r--Command/SetKey.hs1
-rw-r--r--Command/Unannex.hs1
11 files changed, 13 insertions, 30 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 825c1d8c1..3cc681f69 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -19,6 +19,7 @@ import qualified Backend
import LocationLog
import Types
import Core
+import Messages
{- The add subcommand annexes a file, storing it in a backend, and then
- moving it into the annex directory and setting up the symlink pointing
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 6cdf216f4..d1ebd7f64 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -17,6 +17,7 @@ import qualified Backend
import LocationLog
import Types
import Core
+import Messages
{- Indicates a file's content is not wanted anymore, and should be removed
- if it's safe to do so. -}
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index bdd9b55b1..8076e6fd3 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -17,6 +17,7 @@ import qualified Backend
import LocationLog
import Types
import Core
+import Messages
{- Drops cached content for a key. -}
start :: SubCmdStartString
diff --git a/Command/Fix.hs b/Command/Fix.hs
index 90257a8a5..7963a1d2e 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -15,6 +15,7 @@ import Command
import qualified Annex
import Utility
import Core
+import Messages
{- Fixes the symlink to an annexed file. -}
start :: SubCmdStartString
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index 3071f218f..de555475c 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -18,6 +18,7 @@ import Utility
import qualified Backend
import Types
import Core
+import Messages
{- Adds a file pointing at a manually-specified key -}
start :: SubCmdStartString
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 785aecd8a..5405ce120 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -8,19 +8,11 @@
module Command.Fsck where
import qualified Data.Map as M
-import System.Directory
-import System.Posix.Files
-import Monad (filterM)
-import Control.Monad.State (liftIO)
-import Data.Maybe
import Command
import Types
import Core
-import Locations
-import qualified Annex
-import qualified GitRepo as Git
-import qualified Backend
+import Messages
{- Checks the whole annex for problems. -}
start :: SubCmdStart
@@ -71,22 +63,3 @@ unusedKeys = do
existsMap :: Ord k => [k] -> M.Map k Int
existsMap l = M.fromList $ map (\k -> (k, 1)) l
-
-getKeysPresent :: Annex [Key]
-getKeysPresent = do
- g <- Annex.gitRepo
- let top = annexDir g
- contents <- liftIO $ getDirectoryContents top
- files <- liftIO $ filterM (isreg top) contents
- return $ map fileKey files
- where
- isreg top f = do
- s <- getFileStatus $ top ++ "/" ++ f
- return $ isRegularFile s
-
-getKeysReferenced :: Annex [Key]
-getKeysReferenced = do
- g <- Annex.gitRepo
- files <- liftIO $ Git.inRepo g $ Git.workTree g
- keypairs <- mapM Backend.lookupFile files
- return $ map fst $ catMaybes keypairs
diff --git a/Command/Get.hs b/Command/Get.hs
index 1433bc8d0..c50b5a377 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -11,6 +11,7 @@ import Command
import qualified Backend
import Types
import Core
+import Messages
{- Gets an annexed file from one of the backends. -}
start :: SubCmdStartString
diff --git a/Command/Init.hs b/Command/Init.hs
index b1e4e0e06..fd55242a4 100644
--- a/Command/Init.hs
+++ b/Command/Init.hs
@@ -15,6 +15,7 @@ import qualified Annex
import Core
import qualified GitRepo as Git
import UUID
+import Messages
{- Stores description for the repository etc. -}
start :: SubCmdStartString
diff --git a/Command/Move.hs b/Command/Move.hs
index cee941622..6ca923a31 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -20,6 +20,7 @@ import Core
import qualified GitRepo as Git
import qualified Remotes
import UUID
+import Messages
{- Move a file either --to or --from a repository.
-
@@ -64,7 +65,7 @@ moveToPerform key = do
showNote $ show err
return Nothing
Right False -> do
- Core.showNote $ "moving to " ++ (Git.repoDescribe remote) ++ "..."
+ showNote $ "moving to " ++ (Git.repoDescribe remote) ++ "..."
let tmpfile = (annexTmpLocation remote) ++ (keyFile key)
ok <- Remotes.copyToRemote remote key tmpfile
if (ok)
@@ -112,7 +113,7 @@ moveFromPerform key = do
if (ishere)
then return $ Just $ moveFromCleanup remote key
else do
- Core.showNote $ "moving from " ++ (Git.repoDescribe remote) ++ "..."
+ showNote $ "moving from " ++ (Git.repoDescribe remote) ++ "..."
ok <- getViaTmp key (Remotes.copyFromRemote remote key)
if (ok)
then return $ Just $ moveFromCleanup remote key
diff --git a/Command/SetKey.hs b/Command/SetKey.hs
index a5710643e..9286e740b 100644
--- a/Command/SetKey.hs
+++ b/Command/SetKey.hs
@@ -18,6 +18,7 @@ import qualified Backend
import LocationLog
import Types
import Core
+import Messages
{- Sets cached content for a key. -}
start :: SubCmdStartString
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 5cffb2d89..e0848cd4a 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -19,6 +19,7 @@ import LocationLog
import Types
import Core
import qualified GitRepo as Git
+import Messages
{- The unannex subcommand undoes an add. -}
start :: SubCmdStartString