add loggedKeys

This commit is contained in:
Joey Hess 2011-04-02 15:50:51 -04:00
parent 00b9a9a25d
commit f005a84e56
4 changed files with 50 additions and 13 deletions

View file

@ -21,6 +21,7 @@ module Locations (
isLinkToAnnex,
logFile,
logFileOld,
logFileKey,
hashDirMixed,
prop_idempotent_fileKey
@ -127,6 +128,14 @@ logFile' :: (Key -> FilePath) -> Git.Repo -> Key -> String
logFile' hasher repo key =
gitStateDir repo ++ hasher key ++ keyFile key ++ ".log"
{- Converts a log filename into a key. -}
logFileKey :: FilePath -> Maybe Key
logFileKey file
| end == ".log" = readKey beginning
| otherwise = Nothing
where
(beginning, end) = splitAt (length file - 4) file
{- Converts a key into a filename fragment.
-
- Escape "/" in the key name, to keep a flat tree of files and avoid