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:
Joey Hess 2016-08-03 12:37:12 -04:00
parent 0fc85c45b5
commit 1a0e2c9901
Failed to extract signature
53 changed files with 254 additions and 127 deletions

View file

@ -14,6 +14,7 @@ import Annex.Transfer
import Annex.NumCopies
import Annex.Wanted
import qualified Command.Move
import Types.ActionItem
cmd :: Command
cmd = withGlobalOptions (jobsOption : jsonOption : annexedMatchingOptions) $
@ -34,7 +35,7 @@ optParser desc = GetOptions
<$> cmdParams desc
<*> optional parseFromOption
<*> parseAutoOption
<*> optional (parseKeyOptions True)
<*> optional (parseIncompleteOption <|> parseKeyOptions <|> parseFailedTransfersOption)
<*> parseBatchOption
seek :: GetOptions -> CommandSeek
@ -57,7 +58,8 @@ start o from file key = start' expensivecheck from key afile (mkActionItem afile
| otherwise = return True
startKeys :: Maybe Remote -> Key -> ActionItem -> CommandStart
startKeys from key = start' (return True) from key Nothing
startKeys from key ai = checkFailedTransferDirection ai Download $
start' (return True) from key Nothing ai
start' :: Annex Bool -> Maybe Remote -> Key -> AssociatedFile -> ActionItem -> CommandStart
start' expensivecheck from key afile ai = stopUnless (not <$> inAnnex key) $