summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-16 16:05:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-16 16:05:05 -0400
commite7b557ef5d347831142fd98eac901d79c7e1305d (patch)
treedbd5d0bcb578e457a6bb23a856b27f4aa27abd36 /Command
parent84836ed804633fa3d8ff50064331b8b90bb160dd (diff)
got rid of Core module
Most of it was to do with managing annexed Content, so put there
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs2
-rw-r--r--Command/Drop.hs2
-rw-r--r--Command/DropKey.hs2
-rw-r--r--Command/Find.hs2
-rw-r--r--Command/Fix.hs2
-rw-r--r--Command/FromKey.hs2
-rw-r--r--Command/Get.hs2
-rw-r--r--Command/InAnnex.hs2
-rw-r--r--Command/Migrate.hs2
-rw-r--r--Command/Move.hs2
-rw-r--r--Command/RecvKey.hs3
-rw-r--r--Command/SendKey.hs2
-rw-r--r--Command/SetKey.hs2
-rw-r--r--Command/Unannex.hs2
-rw-r--r--Command/Unlock.hs2
-rw-r--r--Command/Unused.hs13
16 files changed, 28 insertions, 16 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index c74b726e3..4b49297fc 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -15,7 +15,7 @@ import qualified Annex
import qualified Backend
import LocationLog
import Types
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/Drop.hs b/Command/Drop.hs
index a425c6138..065e1743a 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -13,7 +13,7 @@ import Command
import qualified Backend
import LocationLog
import Types
-import Core
+import Content
import Messages
import Utility
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index 29056139d..6ba5c117c 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -12,7 +12,7 @@ import qualified Annex
import qualified Backend
import LocationLog
import Types
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/Find.hs b/Command/Find.hs
index 6d94ea3f4..3ed15c153 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -11,7 +11,7 @@ import Control.Monad (when)
import Control.Monad.State (liftIO)
import Command
-import Core
+import Content
command :: [Command]
command = [Command "find" (paramOptional $ paramRepeating paramPath) seek
diff --git a/Command/Fix.hs b/Command/Fix.hs
index 8b08a26f6..d67eca164 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -14,7 +14,7 @@ import System.Directory
import Command
import qualified Annex
import Utility
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index 0a13b8c73..9c4a3cfdc 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -17,7 +17,7 @@ import qualified Annex
import Utility
import qualified Backend
import Types
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/Get.hs b/Command/Get.hs
index e3668649e..e0af6c407 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -10,7 +10,7 @@ module Command.Get where
import Command
import qualified Backend
import Types
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/InAnnex.hs b/Command/InAnnex.hs
index d49539513..68ac9a2c6 100644
--- a/Command/InAnnex.hs
+++ b/Command/InAnnex.hs
@@ -12,7 +12,7 @@ import System.Exit
import Command
import Types
-import Core
+import Content
import qualified Backend
command :: [Command]
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index 59ad36a2b..5bc54ceab 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -16,7 +16,7 @@ import qualified Annex
import qualified Backend
import Locations
import Types
-import Core
+import Content
import Messages
import qualified Command.Add
diff --git a/Command/Move.hs b/Command/Move.hs
index 3e7fde370..2920c0661 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -14,7 +14,7 @@ import qualified Command.Drop
import qualified Annex
import LocationLog
import Types
-import Core
+import Content
import qualified GitRepo as Git
import qualified Remotes
import UUID
diff --git a/Command/RecvKey.hs b/Command/RecvKey.hs
index 840b32861..0abea07f2 100644
--- a/Command/RecvKey.hs
+++ b/Command/RecvKey.hs
@@ -13,7 +13,8 @@ import System.Exit
import Command
import Types
-import Core
+import CmdLine
+import Content
import qualified Backend
import RsyncFile
diff --git a/Command/SendKey.hs b/Command/SendKey.hs
index 0ddc0d23b..aaa0b4836 100644
--- a/Command/SendKey.hs
+++ b/Command/SendKey.hs
@@ -15,7 +15,7 @@ import Locations
import qualified Annex
import Command
import Types
-import Core
+import Content
import qualified Backend
import RsyncFile
diff --git a/Command/SetKey.hs b/Command/SetKey.hs
index 5048d052f..412504b2e 100644
--- a/Command/SetKey.hs
+++ b/Command/SetKey.hs
@@ -16,7 +16,7 @@ import Utility
import qualified Backend
import LocationLog
import Types
-import Core
+import Content
import Messages
command :: [Command]
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 2c60a23bb..cdd577ba8 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -16,7 +16,7 @@ import Utility
import qualified Backend
import LocationLog
import Types
-import Core
+import Content
import qualified GitRepo as Git
import Messages
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 4bd6e8599..645fac8a2 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -17,7 +17,7 @@ import qualified Backend
import Types
import Messages
import Locations
-import Core
+import Content
import CopyFile
command :: [Command]
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 62bc5d023..9fdf4cda6 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -9,13 +9,16 @@ module Command.Unused where
import Control.Monad.State (liftIO)
import qualified Data.Map as M
+import Data.Maybe
import Command
import Types
-import Core
+import Content
import Messages
import Locations
import qualified Annex
+import qualified GitRepo as Git
+import qualified Backend
command :: [Command]
command = [Command "unused" paramNothing seek "look for unused file content"]
@@ -80,3 +83,11 @@ unusedKeys = do
existsMap :: Ord k => [k] -> M.Map k Int
existsMap l = M.fromList $ map (\k -> (k, 1)) l
+
+{- List of keys referenced by symlinks in the git repo. -}
+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