moved AssociatedFile definition

This commit is contained in:
Joey Hess 2013-07-04 02:36:02 -04:00
parent 7ae3223eab
commit 7a7e426352
13 changed files with 15 additions and 20 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -6,7 +6,7 @@
-}
module Logs.Unused (
UnusedMap(..),
UnusedMap,
writeUnusedLog,
readUnusedLog,
unusedKeys,

14
Seek.hs
View file

@ -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

View file

@ -9,6 +9,7 @@ module Types (
Annex,
Backend,
Key,
AssociatedFile,
UUID(..),
GitConfig(..),
RemoteGitConfig(..),

View file

@ -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 = "",

View file

@ -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