summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-08-03 12:37:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-08-03 12:37:12 -0400
commit508517de485e77196a8d8e33558f4185c50dea96 (patch)
tree319fc6e63da144e40dd124a07f4bb6c0ad25c5ee /Messages.hs
parent019733f00d01301d71acc46245d2dc130934d951 (diff)
get, move, copy, mirror: Added --failed switch which retries failed copies/moves
Note that get --from foo --failed will get things that a previous get --from bar tried and failed to get, etc. I considered making --failed only retry transfers from the same remote, but it was easier, and seems more useful, to not have the same remote requirement. Noisy due to some refactoring into Types/
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 ++ " "