summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs32
1 files changed, 1 insertions, 31 deletions
diff --git a/Messages.hs b/Messages.hs
index 339823d42..f1055efb8 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -5,8 +5,6 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
-
module Messages (
showStart,
ActionItem,
@@ -53,11 +51,10 @@ import System.Log.Handler.Simple
import Common
import Types
import Types.Messages
-import Git.FilePath
+import Types.ActionItem
import Messages.Internal
import qualified Messages.JSON as JSON
import Utility.JSONStream (JSONChunk(..))
-import Types.Key
import qualified Annex
showStart :: String -> FilePath -> Annex ()
@@ -66,33 +63,6 @@ showStart command file = outputMessage json $
where
json = JSON.start command (Just file) Nothing
-data ActionItem
- = ActionItemAssociatedFile AssociatedFile
- | ActionItemKey
- | ActionItemBranchFilePath BranchFilePath
-
-class MkActionItem t where
- mkActionItem :: t -> ActionItem
-
-instance MkActionItem AssociatedFile where
- mkActionItem = ActionItemAssociatedFile
-
-instance MkActionItem Key where
- mkActionItem _ = ActionItemKey
-
-instance MkActionItem BranchFilePath where
- mkActionItem = ActionItemBranchFilePath
-
-actionItemDesc :: ActionItem -> Key -> String
-actionItemDesc (ActionItemAssociatedFile (Just f)) _ = f
-actionItemDesc (ActionItemAssociatedFile Nothing) k = key2file k
-actionItemDesc ActionItemKey k = key2file k
-actionItemDesc (ActionItemBranchFilePath bfp) _ = descBranchFilePath bfp
-
-actionItemWorkTreeFile :: ActionItem -> Maybe FilePath
-actionItemWorkTreeFile (ActionItemAssociatedFile af) = af
-actionItemWorkTreeFile _ = Nothing
-
showStart' :: String -> Key -> ActionItem -> Annex ()
showStart' command key i = outputMessage json $
command ++ " " ++ actionItemDesc i key ++ " "