diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-09 16:54:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-09 16:54:18 -0400 |
commit | 8ce7e73f74e95276472d18816b7c6a60bab25abb (patch) | |
tree | f4a29907c46af2735411fe9fcbeca0f9c3149cab /Annex | |
parent | 58563c5b1aa995ea3ce72cddaa1f02d2ea792c2d (diff) |
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.)
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 12 |
1 files changed, 12 insertions, 0 deletions
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 |