From: Joey Hess Date: Thu, 12 Nov 2020 16:40:35 +0000 (-0400) Subject: move old direct mode stuff out of Annex.Locations X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~102^2~86 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b1eb47599ad44679aa1f99c931bb911ba65dc064;p=git-annex.git move old direct mode stuff out of Annex.Locations --- diff --git a/Annex/Locations.hs b/Annex/Locations.hs index 482d2688ab..46b19c7428 100644 --- a/Annex/Locations.hs +++ b/Annex/Locations.hs @@ -20,8 +20,6 @@ module Annex.Locations ( gitAnnexLink, gitAnnexLinkCanonical, gitAnnexContentLock, - gitAnnexMapping, - gitAnnexInodeCache, gitAnnexInodeSentinal, gitAnnexInodeSentinalCache, annexLocations, @@ -68,7 +66,6 @@ module Annex.Locations ( gitAnnexJournalDir', gitAnnexJournalLock, gitAnnexGitQueueLock, - gitAnnexMergeLock, gitAnnexIndex, gitAnnexIndexStatus, gitAnnexViewIndex, @@ -161,9 +158,6 @@ gitAnnexLocationDepth config = hashlevels + 1 - - When the file is not present, returns the location where the file should - be stored. - - - - This does not take direct mode into account, so in direct mode it is not - - the actual location of the file's content. -} gitAnnexLocation :: Key -> Git.Repo -> GitConfig -> IO RawFilePath gitAnnexLocation key r config = gitAnnexLocation' key r config @@ -237,21 +231,6 @@ gitAnnexContentLock key r config = do loc <- gitAnnexLocation key r config return $ loc <> ".lck" -{- File that maps from a key to the file(s) in the git repository. - - Used in direct mode. -} -gitAnnexMapping :: Key -> Git.Repo -> GitConfig -> IO RawFilePath -gitAnnexMapping key r config = do - loc <- gitAnnexLocation key r config - return $ loc <> ".map" - -{- File that caches information about a key's content, used to determine - - if a file has changed. - - Used in direct mode. -} -gitAnnexInodeCache :: Key -> Git.Repo -> GitConfig -> IO RawFilePath -gitAnnexInodeCache key r config = do - loc <- gitAnnexLocation key r config - return $ loc <> ".cache" - gitAnnexInodeSentinal :: Git.Repo -> RawFilePath gitAnnexInodeSentinal r = gitAnnexDir r P. "sentinal" @@ -435,8 +414,8 @@ gitAnnexFeedStateDir r = P.addTrailingPathSeparator $ gitAnnexFeedState :: Key -> Git.Repo -> RawFilePath gitAnnexFeedState k r = gitAnnexFeedStateDir r P. keyFile k -{- .git/annex/merge/ is used as a empty work tree for direct mode merges and - - merges in adjusted branches. -} +{- .git/annex/merge/ is used as a empty work tree for merges in + - adjusted branches. -} gitAnnexMergeDir :: Git.Repo -> FilePath gitAnnexMergeDir r = fromRawFilePath $ P.addTrailingPathSeparator $ gitAnnexDir r P. "merge" @@ -466,10 +445,6 @@ gitAnnexJournalLock r = gitAnnexDir r P. "journal.lck" gitAnnexGitQueueLock :: Git.Repo -> RawFilePath gitAnnexGitQueueLock r = gitAnnexDir r P. "gitqueue.lck" -{- Lock file for direct mode merge. -} -gitAnnexMergeLock :: Git.Repo -> FilePath -gitAnnexMergeLock r = fromRawFilePath $ gitAnnexDir r P. "merge.lck" - {- .git/annex/index is used to stage changes to the git-annex branch -} gitAnnexIndex :: Git.Repo -> RawFilePath gitAnnexIndex r = gitAnnexDir r P. "index" diff --git a/Upgrade/V5/Direct.hs b/Upgrade/V5/Direct.hs index d10d1182e7..7aa800f166 100644 --- a/Upgrade/V5/Direct.hs +++ b/Upgrade/V5/Direct.hs @@ -128,3 +128,16 @@ removeInodeCache key = withInodeCacheFile key $ \f -> withInodeCacheFile :: Key -> (RawFilePath -> Annex a) -> Annex a withInodeCacheFile key a = a =<< calcRepo (gitAnnexInodeCache key) + +{- File that maps from a key to the file(s) in the git repository. -} +gitAnnexMapping :: Key -> Git.Repo -> GitConfig -> IO RawFilePath +gitAnnexMapping key r c = do + loc <- gitAnnexLocation key r c + return $ loc <> ".map" + +{- File that caches information about a key's content, used to determine + - if a file has changed. -} +gitAnnexInodeCache :: Key -> Git.Repo -> GitConfig -> IO RawFilePath +gitAnnexInodeCache key r c = do + loc <- gitAnnexLocation key r c + return $ loc <> ".cache"