From 2d31b1e209f0dd1787f2ff9fac0e55f9e1216754 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Oct 2017 17:54:38 -0400 Subject: better dup key with -J fix This avoids all the complication about redundant work discussed in the previous try at fixing this. At the expense of needing each command that could have the problem to be patched to simply wrap the action in onlyActionOn once the key is known. But there do not seem to be many such commands. onlyActionOn' should not be used with a CommandStart (or CommandPerform), although the types do allow it. onlyActionOn handles running the whole CommandStart chain. I couldn't immediately see a way to avoid mistken use of onlyActionOn'. This commit was supported by the NSF-funded DataLad project. --- Types/ActionItem.hs | 1 - Types/Transfer.hs | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'Types') diff --git a/Types/ActionItem.hs b/Types/ActionItem.hs index 0b53bec01..73d845101 100644 --- a/Types/ActionItem.hs +++ b/Types/ActionItem.hs @@ -10,7 +10,6 @@ module Types.ActionItem where import Key -import Types import Types.Transfer import Git.FilePath diff --git a/Types/Transfer.hs b/Types/Transfer.hs index 093307ea9..ade8fc763 100644 --- a/Types/Transfer.hs +++ b/Types/Transfer.hs @@ -7,13 +7,10 @@ module Types.Transfer where -import Types.Remote -import Types.Key -import Types.UUID +import Types import Utility.PID import Utility.QuickCheck -import Control.Concurrent.STM import Data.Time.Clock.POSIX import Control.Concurrent import Control.Applicative @@ -33,18 +30,18 @@ data Transfer = Transfer - git repository. It's some file, possibly relative to some directory, - of some repository, that was acted on to initiate the transfer. -} -data TransferInfoA a = TransferInfo +data TransferInfo = TransferInfo { startedTime :: Maybe POSIXTime , transferPid :: Maybe PID , transferTid :: Maybe ThreadId - , transferRemote :: Maybe (RemoteA a) + , transferRemote :: Maybe Remote , bytesComplete :: Maybe Integer , associatedFile :: AssociatedFile , transferPaused :: Bool } deriving (Show, Eq, Ord) -stubTransferInfo :: TransferInfoA a +stubTransferInfo :: TransferInfo stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing (AssociatedFile Nothing) False data Direction = Upload | Download @@ -59,7 +56,7 @@ parseDirection "upload" = Just Upload parseDirection "download" = Just Download parseDirection _ = Nothing -instance Arbitrary (TransferInfoA a) where +instance Arbitrary TransferInfo where arbitrary = TransferInfo <$> arbitrary <*> arbitrary -- cgit v1.2.3