summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-17 14:58:43 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-17 14:58:43 -0400
commit7a86dc944306af4d0a707631b03ef93941ecc1be (patch)
tree5f5464144b53c92b5403f4f9c8c0e397f36052c9 /Logs
parent1e37c0c5fc655dc7d6f6c6d2417e7ba79e6395f7 (diff)
cleanup
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Transfer.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index a641c4882..21d2d2c97 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -10,6 +10,7 @@ module Logs.Transfer where
import Common.Annex
import Annex.Perms
import Annex.Exception
+import Annex.UUID
import qualified Git
import Types.Remote
import Types.Key
@@ -48,6 +49,9 @@ data TransferInfo = TransferInfo
}
deriving (Show, Eq, Ord)
+stubTransferInfo :: TransferInfo
+stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing Nothing False
+
data Direction = Upload | Download
deriving (Eq, Ord, Read, Show)
@@ -164,6 +168,11 @@ getFailedTransfers u = catMaybes <$> (liftIO . getpairs =<< concat <$> findfiles
=<< mapM (fromRepo . failedTransferDir u)
[Download, Upload]
+removeFailedTransfer :: Transfer -> Annex ()
+removeFailedTransfer t = do
+ f <- fromRepo $ failedTransferFile t
+ liftIO $ void $ tryIO $ removeFile f
+
{- The transfer information file to use for a given Transfer. -}
transferFile :: Transfer -> Git.Repo -> FilePath
transferFile (Transfer direction u key) r = transferDir direction r