make storeExport throw exceptions
This commit is contained in:
parent
dc7dc1e179
commit
4814b444dd
11 changed files with 99 additions and 105 deletions
|
@ -20,6 +20,7 @@ import qualified Git.Ref
|
|||
import Git.Types
|
||||
import Git.FilePath
|
||||
import Git.Sha
|
||||
import qualified Remote
|
||||
import Types.Remote
|
||||
import Types.Export
|
||||
import Annex.Export
|
||||
|
@ -280,7 +281,8 @@ performExport r db ek af contentsha loc allfilledvar = do
|
|||
let rollback = void $
|
||||
performUnexport r db [ek] loc
|
||||
sendAnnex k rollback $ \f ->
|
||||
storer f k loc pm
|
||||
Remote.action $
|
||||
storer f k loc pm
|
||||
, do
|
||||
showNote "not available"
|
||||
return False
|
||||
|
@ -291,7 +293,8 @@ performExport r db ek af contentsha loc allfilledvar = do
|
|||
b <- catObject contentsha
|
||||
liftIO $ L.hPut h b
|
||||
liftIO $ hClose h
|
||||
storer tmp sha1k loc nullMeterUpdate
|
||||
Remote.action $
|
||||
storer tmp sha1k loc nullMeterUpdate
|
||||
let failedsend = liftIO $ modifyMVar_ allfilledvar (pure . const (AllFilled False))
|
||||
case sent of
|
||||
Right True -> next $ cleanupExport r db ek loc True
|
||||
|
|
|
@ -287,15 +287,15 @@ testExportTree runannex mkr mkk1 mkk2 =
|
|||
, check "remove export when not present" $ \ea k1 _k2 ->
|
||||
removeexport ea k1
|
||||
, check "store export" $ \ea k1 _k2 ->
|
||||
storeexport ea k1
|
||||
isRight <$> tryNonAsync (storeexport ea k1)
|
||||
, check "check present export after store" $ \ea k1 _k2 ->
|
||||
checkpresentexport ea k1
|
||||
, check "store export when already present" $ \ea k1 _k2 ->
|
||||
storeexport ea k1
|
||||
isRight <$> tryNonAsync (storeexport ea k1)
|
||||
, check "retrieve export" $ \ea k1 _k2 ->
|
||||
retrieveexport ea k1
|
||||
, check "store new content to export" $ \ea _k1 k2 ->
|
||||
storeexport ea k2
|
||||
isRight <$> tryNonAsync (storeexport ea k2)
|
||||
, check "check present export after store of new content" $ \ea _k1 k2 ->
|
||||
checkpresentexport ea k2
|
||||
, check "retrieve export new content" $ \ea _k1 k2 ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue