summaryrefslogtreecommitdiff
path: root/Logs.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2019-02-20 15:36:09 -0400
committerJoey Hess <joeyh@joeyh.name>2019-02-20 15:40:07 -0400
commite8bfc3640b30e395a694d0125b874a2cce109345 (patch)
treed79a780bf88d5d96552d66e405ee8ffb7b5de879 /Logs.hs
parent0442842622867ec741d2d2802ae2c3bb812c2c59 (diff)
storing ContentIdentifier in the git-annex branch
Diffstat (limited to 'Logs.hs')
-rw-r--r--Logs.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/Logs.hs b/Logs.hs
index 63d64efadd..2bced05608 100644
--- a/Logs.hs
+++ b/Logs.hs
@@ -1,6 +1,6 @@
{- git-annex log file names
-
- - Copyright 2013-2018 Joey Hess <id@joeyh.name>
+ - Copyright 2013-2019 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -25,7 +25,7 @@ data LogVariety
getLogVariety :: FilePath -> Maybe LogVariety
getLogVariety f
| f `elem` topLevelUUIDBasedLogs = Just UUIDBasedLog
- | isRemoteStateLog f = Just NewUUIDBasedLog
+ | isRemoteStateLog f || isRemoteContentIdentifierLog f = Just NewUUIDBasedLog
| isChunkLog f = ChunkLog <$> chunkLogFileKey f
| isRemoteMetaDataLog f = Just RemoteMetaDataLog
| isMetaDataLog f || f `elem` otherLogs = Just OtherLog
@@ -54,7 +54,7 @@ presenceLogs f =
, locationLogFileKey f
]
-{- Logs that are neither UUID based nor presence logs. -}
+{- Top-level logs that are neither UUID based nor presence logs. -}
otherLogs :: [FilePath]
otherLogs =
[ numcopiesLog
@@ -197,3 +197,13 @@ remoteMetaDataLogExt = ".log.rmet"
isRemoteMetaDataLog :: FilePath -> Bool
isRemoteMetaDataLog path = remoteMetaDataLogExt `isSuffixOf` path
+
+{- The filename of the remote content identifier log for a given key. -}
+remoteContentIdentifierLogFile :: GitConfig -> Key -> FilePath
+remoteContentIdentifierLogFile config key = branchHashDir config key </> keyFile key ++ remoteContentIdentifierExt
+
+remoteContentIdentifierExt :: String
+remoteContentIdentifierExt = ".log.cid"
+
+isRemoteContentIdentifierLog :: FilePath -> Bool
+isRemoteContentIdentifierLog path = remoteContentIdentifierExt `isSuffixOf` path