diff options
author | Joey Hess <joeyh@joeyh.name> | 2019-02-20 15:36:09 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2019-02-20 15:40:07 -0400 |
commit | e8bfc3640b30e395a694d0125b874a2cce109345 (patch) | |
tree | d79a780bf88d5d96552d66e405ee8ffb7b5de879 /Logs.hs | |
parent | 0442842622867ec741d2d2802ae2c3bb812c2c59 (diff) |
storing ContentIdentifier in the git-annex branch
Diffstat (limited to 'Logs.hs')
-rw-r--r-- | Logs.hs | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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 |