Special remotes now all rollback storage of keys that get modified during the transfer, which can happen in direct mode.

This commit is contained in:
Joey Hess 2013-01-09 18:42:29 -04:00
parent b3559d8eae
commit 1bc49b7158
11 changed files with 63 additions and 44 deletions

View file

@ -24,11 +24,16 @@ seek = [withKeys start]
start :: Key -> CommandStart
start key = ifM (inAnnex key)
( fieldTransfer Upload key $ \_p ->
sendAnnex key $ liftIO . rsyncServerSend
sendAnnex key rollback $ liftIO . rsyncServerSend
, do
warning "requested key is not present"
liftIO exitFailure
)
where
{- No need to do any rollback; when sendAnnex fails, a nonzero
- exit will be propigated, and the remote will know the transfer
- failed. -}
rollback = noop
fieldTransfer :: Direction -> Key -> (MeterUpdate -> Annex Bool) -> CommandStart
fieldTransfer direction key a = do