From 508517de485e77196a8d8e33558f4185c50dea96 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 3 Aug 2016 12:37:12 -0400 Subject: 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/ --- Messages.hs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'Messages.hs') 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 ++ " " -- cgit v1.2.3