moved AssociatedFile definition
This commit is contained in:
parent
7ae3223eab
commit
7a7e426352
13 changed files with 15 additions and 20 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-}
|
||||
|
||||
module Logs.Unused (
|
||||
UnusedMap(..),
|
||||
UnusedMap,
|
||||
writeUnusedLog,
|
||||
readUnusedLog,
|
||||
unusedKeys,
|
||||
|
|
8
Seek.hs
8
Seek.hs
|
@ -134,14 +134,14 @@ 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
|
||||
case (allkeys , unused, auto ) of
|
||||
(True , False , False) -> go loggedKeys
|
||||
(False, True , False) -> go unusedKeys
|
||||
(False , True , False) -> go unusedKeys
|
||||
(True , True , _ ) -> error "Cannot use --all with --unused."
|
||||
(False, False , _ ) -> fallbackop params
|
||||
(False , False , _ ) -> fallbackop params
|
||||
(_ , _ , True )
|
||||
| bare -> error "Cannot use --auto in a bare repository."
|
||||
| otherwise -> error "Cannot use --auto with --all or --unused."
|
||||
|
|
1
Types.hs
1
Types.hs
|
@ -9,6 +9,7 @@ module Types (
|
|||
Annex,
|
||||
Backend,
|
||||
Key,
|
||||
AssociatedFile,
|
||||
UUID(..),
|
||||
GitConfig(..),
|
||||
RemoteGitConfig(..),
|
||||
|
|
|
@ -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 = "",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue