From 8ce7e73f74e95276472d18816b7c6a60bab25abb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Nov 2011 16:54:18 -0400 Subject: reorg to allow taking content lock The lock will only persist during the perform stage, so the content must be removed from the annex then, rather than in the cleanup stage. (No lock is actually taken yet.) --- Annex/Content.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Annex') diff --git a/Annex/Content.hs b/Annex/Content.hs index ecfec66aa..dc714276d 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -7,6 +7,8 @@ module Annex.Content ( inAnnex, + lockExclusive, + lockShared, calcGitLink, logStatus, getViaTmp, @@ -41,6 +43,16 @@ inAnnex key = do error "inAnnex cannot check remote repo" inRepo $ doesFileExist . gitAnnexLocation key +{- Content is exclusively locked to indicate that it's in the process of + - being removed. -} +lockExclusive :: Key -> Annex a -> Annex a +lockExclusive key a = a -- TODO + +{- Things that rely on content being present can take a shared lock to + - avoid it vanishing from under them. -} +lockShared :: Key -> Annex a -> Annex a +lockShared key a = a -- TODO + {- Calculates the relative path to use to link a file to a key. -} calcGitLink :: FilePath -> Key -> Annex FilePath calcGitLink file key = do -- cgit v1.2.3