aboutsummaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-10-17 17:54:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-10-17 18:48:53 -0400
commit2d31b1e209f0dd1787f2ff9fac0e55f9e1216754 (patch)
tree5a287c1c71c2da572f395799544b7773cfc69960 /Annex.hs
parentf31dbb13cad2e8e1b29180fff755026256eabd57 (diff)
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.
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Annex.hs b/Annex.hs
index 8e79e63c1..32a303239 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -61,7 +61,6 @@ import Types.UUID
import Types.FileMatcher
import Types.NumCopies
import Types.LockCache
-import Types.Transfer
import Types.DesktopNotify
import Types.CleanupActions
import qualified Database.Keys.Handle as Keys
@@ -126,7 +125,6 @@ data AnnexState = AnnexState
, groupmap :: Maybe GroupMap
, ciphers :: M.Map StorableCipher Cipher
, lockcache :: LockCache
- , currentprocesstransfers :: TVar (S.Set Transfer)
, sshstalecleaned :: TMVar Bool
, flags :: M.Map String Bool
, fields :: M.Map String String
@@ -140,6 +138,7 @@ data AnnexState = AnnexState
, existinghooks :: M.Map Git.Hook.Hook Bool
, desktopnotify :: DesktopNotify
, workers :: [Either AnnexState (Async AnnexState)]
+ , activekeys :: TVar (M.Map Key ThreadId)
, activeremotes :: MVar (M.Map (Types.Remote.RemoteA Annex) Integer)
, keysdbhandle :: Maybe Keys.DbHandle
, cachedcurrentbranch :: Maybe Git.Branch
@@ -149,9 +148,9 @@ data AnnexState = AnnexState
newState :: GitConfig -> Git.Repo -> IO AnnexState
newState c r = do
emptyactiveremotes <- newMVar M.empty
+ emptyactivekeys <- newTVarIO M.empty
o <- newMessageState
sc <- newTMVarIO False
- cpt <- newTVarIO S.empty
return $ AnnexState
{ repo = r
, repoadjustment = return
@@ -182,7 +181,6 @@ newState c r = do
, groupmap = Nothing
, ciphers = M.empty
, lockcache = M.empty
- , currentprocesstransfers = cpt
, sshstalecleaned = sc
, flags = M.empty
, fields = M.empty
@@ -196,6 +194,7 @@ newState c r = do
, existinghooks = M.empty
, desktopnotify = mempty
, workers = []
+ , activekeys = emptyactivekeys
, activeremotes = emptyactiveremotes
, keysdbhandle = Nothing
, cachedcurrentbranch = Nothing