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/
This commit is contained in:
parent
0fc85c45b5
commit
1a0e2c9901
53 changed files with 254 additions and 127 deletions
32
Messages.hs
32
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 ++ " "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue