move old direct mode stuff out of Annex.Locations
authorJoey Hess <joeyh@joeyh.name>
Thu, 12 Nov 2020 16:40:35 +0000 (12:40 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 12 Nov 2020 16:40:35 +0000 (12:40 -0400)
Annex/Locations.hs
Upgrade/V5/Direct.hs

index 482d2688ab700670f6262e6b9385a3ebad65b017..46b19c74286d11fa1e819e5444848fbc70e10af6 100644 (file)
@@ -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"
index d10d1182e732afc02b96566c511dd49b6a0e32d6..7aa800f166429aa96680fd4b5ad0e5efdba3d29b 100644 (file)
@@ -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"