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
|
@ -35,7 +35,7 @@ optParser :: CmdParamsDesc -> Parser MoveOptions
|
|||
optParser desc = MoveOptions
|
||||
<$> cmdParams desc
|
||||
<*> parseFromToOptions
|
||||
<*> optional (parseKeyOptions False)
|
||||
<*> optional (parseKeyOptions <|> parseFailedTransfersOption)
|
||||
|
||||
instance DeferredParseClass MoveOptions where
|
||||
finishParse v = MoveOptions
|
||||
|
@ -61,8 +61,10 @@ startKey o move = start' o move Nothing
|
|||
start' :: MoveOptions -> Bool -> AssociatedFile -> Key -> ActionItem -> CommandStart
|
||||
start' o move afile key ai =
|
||||
case fromToOptions o of
|
||||
FromRemote src -> fromStart move afile key ai =<< getParsed src
|
||||
ToRemote dest -> toStart move afile key ai =<< getParsed dest
|
||||
FromRemote src -> checkFailedTransferDirection ai Download $
|
||||
fromStart move afile key ai =<< getParsed src
|
||||
ToRemote dest -> checkFailedTransferDirection ai Upload $
|
||||
toStart move afile key ai =<< getParsed dest
|
||||
|
||||
showMoveAction :: Bool -> Key -> ActionItem -> Annex ()
|
||||
showMoveAction move = showStart' (if move then "move" else "copy")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue