summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-04 02:36:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-04 02:36:02 -0400
commit6b3a9cdaddec120f27e947e03ece5ee2ebde1d14 (patch)
tree14ee0b96ed66ba71fe2843f002f4f56f915c9ff5
parent8a7785e219c5aa08e0c91a813022e03cb92f16a3 (diff)
moved AssociatedFile definition
-rw-r--r--Annex/Wanted.hs1
-rw-r--r--Assistant/Drop.hs2
-rw-r--r--Assistant/TransferrerPool.hs1
-rw-r--r--Assistant/Types/TransferQueue.hs1
-rw-r--r--Command/Get.hs1
-rw-r--r--Command/Move.hs1
-rw-r--r--Command/TransferKeys.hs1
-rw-r--r--Logs/Transfer.hs1
-rw-r--r--Logs/Unused.hs2
-rw-r--r--Seek.hs14
-rw-r--r--Types.hs1
-rw-r--r--Types/Key.hs6
-rw-r--r--Types/Remote.hs3
13 files changed, 15 insertions, 20 deletions
diff --git a/Annex/Wanted.hs b/Annex/Wanted.hs
index 2500f80d1..b90a1af31 100644
--- a/Annex/Wanted.hs
+++ b/Annex/Wanted.hs
@@ -10,7 +10,6 @@ module Annex.Wanted where
import Common.Annex
import Logs.PreferredContent
import Annex.UUID
-import Types.Remote
import qualified Data.Set as S
diff --git a/Assistant/Drop.hs b/Assistant/Drop.hs
index 1fc2f75d9..d677a69c8 100644
--- a/Assistant/Drop.hs
+++ b/Assistant/Drop.hs
@@ -11,7 +11,7 @@ import Assistant.Common
import Assistant.DaemonStatus
import Logs.Location
import Logs.Trust
-import Types.Remote (AssociatedFile, uuid)
+import Types.Remote (uuid)
import qualified Remote
import qualified Command.Drop
import Command
diff --git a/Assistant/TransferrerPool.hs b/Assistant/TransferrerPool.hs
index 68ec743f8..d9104f74d 100644
--- a/Assistant/TransferrerPool.hs
+++ b/Assistant/TransferrerPool.hs
@@ -16,7 +16,6 @@ import Control.Concurrent.STM
import System.Process (create_group)
import Control.Exception (throw)
import Control.Concurrent
-import Types.Remote (AssociatedFile)
{- Runs an action with a Transferrer from the pool. -}
withTransferrer :: FilePath -> TransferrerPool -> (Transferrer -> IO a) -> IO a
diff --git a/Assistant/Types/TransferQueue.hs b/Assistant/Types/TransferQueue.hs
index e4e305d5a..e4bf2ae92 100644
--- a/Assistant/Types/TransferQueue.hs
+++ b/Assistant/Types/TransferQueue.hs
@@ -9,7 +9,6 @@ module Assistant.Types.TransferQueue where
import Common.Annex
import Logs.Transfer
-import Types.Remote
import Control.Concurrent.STM
import Utility.TList
diff --git a/Command/Get.hs b/Command/Get.hs
index 0bbe4dc1a..31a75c3e1 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -16,7 +16,6 @@ import Logs.Transfer
import Annex.Wanted
import GitAnnex.Options
import Types.Key
-import Types.Remote
def :: [Command]
def = [withOptions getOptions $ command "get" paramPaths seek
diff --git a/Command/Move.hs b/Command/Move.hs
index 142a84d71..357ccc21e 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -19,7 +19,6 @@ import Logs.Presence
import Logs.Transfer
import GitAnnex.Options
import Types.Key
-import Types.Remote
def :: [Command]
def = [withOptions moveOptions $ command "move" paramPaths seek
diff --git a/Command/TransferKeys.hs b/Command/TransferKeys.hs
index 2f5ea1fe4..8da29e211 100644
--- a/Command/TransferKeys.hs
+++ b/Command/TransferKeys.hs
@@ -15,7 +15,6 @@ import Annex.Content
import Logs.Location
import Logs.Transfer
import qualified Remote
-import Types.Remote (AssociatedFile)
import Types.Key
import qualified Option
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index 47c6e7495..ec3e9cb26 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -13,7 +13,6 @@ import Common.Annex
import Annex.Perms
import Annex.Exception
import qualified Git
-import Types.Remote
import Types.Key
import Utility.Metered
import Utility.Percentage
diff --git a/Logs/Unused.hs b/Logs/Unused.hs
index 271211ed2..4de5bc17a 100644
--- a/Logs/Unused.hs
+++ b/Logs/Unused.hs
@@ -6,7 +6,7 @@
-}
module Logs.Unused (
- UnusedMap(..),
+ UnusedMap,
writeUnusedLog,
readUnusedLog,
unusedKeys,
diff --git a/Seek.hs b/Seek.hs
index b90a337e6..817687b45 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -134,15 +134,15 @@ withNothing _ _ = error "This command takes no parameters."
withKeyOptions :: (Key -> CommandStart) -> CommandSeek -> CommandSeek
withKeyOptions keyop fallbackop params = do
bare <- fromRepo Git.repoIsLocalBare
- all <- Annex.getFlag "all" <||> pure bare
+ allkeys <- Annex.getFlag "all" <||> pure bare
unused <- Annex.getFlag "unused"
auto <- Annex.getState Annex.auto
- case (all , unused, auto ) of
- (True , False , False) -> go loggedKeys
- (False, True , False) -> go unusedKeys
- (True , True , _ ) -> error "Cannot use --all with --unused."
- (False, False , _ ) -> fallbackop params
- (_ , _ , True )
+ case (allkeys , unused, auto ) of
+ (True , False , False) -> go loggedKeys
+ (False , True , False) -> go unusedKeys
+ (True , True , _ ) -> error "Cannot use --all with --unused."
+ (False , False , _ ) -> fallbackop params
+ (_ , _ , True )
| bare -> error "Cannot use --auto in a bare repository."
| otherwise -> error "Cannot use --auto with --all or --unused."
where
diff --git a/Types.hs b/Types.hs
index ea0fa6b89..8768ed1fe 100644
--- a/Types.hs
+++ b/Types.hs
@@ -9,6 +9,7 @@ module Types (
Annex,
Backend,
Key,
+ AssociatedFile,
UUID(..),
GitConfig(..),
RemoteGitConfig(..),
diff --git a/Types/Key.hs b/Types/Key.hs
index 51449ca33..910819a14 100644
--- a/Types/Key.hs
+++ b/Types/Key.hs
@@ -9,6 +9,7 @@
module Types.Key (
Key(..),
+ AssociatedFile,
stubKey,
key2file,
file2key,
@@ -21,7 +22,7 @@ import System.Posix.Types
import Common
import Utility.QuickCheck
-{- A Key has a unique name, is associated with a key/value backend,
+{- A Key has a unique name, which is derived from a particular backend,
- and may contain other optional metadata. -}
data Key = Key {
keyName :: String,
@@ -30,6 +31,9 @@ data Key = Key {
keyMtime :: Maybe EpochTime
} deriving (Eq, Ord, Read, Show)
+{- A filename may be associated with a Key. -}
+type AssociatedFile = Maybe FilePath
+
stubKey :: Key
stubKey = Key {
keyName = "",
diff --git a/Types/Remote.hs b/Types/Remote.hs
index 98cac37e4..8492be06d 100644
--- a/Types/Remote.hs
+++ b/Types/Remote.hs
@@ -37,9 +37,6 @@ data RemoteTypeA a = RemoteType {
instance Eq (RemoteTypeA a) where
x == y = typename x == typename y
-{- A filename associated with a Key, for display to user. -}
-type AssociatedFile = Maybe FilePath
-
{- An individual remote. -}
data RemoteA a = Remote {
-- each Remote has a unique uuid