aboutsummaryrefslogtreecommitdiff
path: root/Logs/Presence.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-01 17:53:16 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-01 17:53:16 -0400
commit3dda636033123f6e1d9fa45a1971b9daf6ebcf54 (patch)
tree6d460372256ce6fee41a8bfe6223e2cb40082954 /Logs/Presence.hs
parent73222e307c69415320ed36df8d63a83d278b2f65 (diff)
fsck: Added --distributed and --expire options, for distributed fsck.
Diffstat (limited to 'Logs/Presence.hs')
-rw-r--r--Logs/Presence.hs18
1 files changed, 13 insertions, 5 deletions
diff --git a/Logs/Presence.hs b/Logs/Presence.hs
index cb21adfb3..469ed8de9 100644
--- a/Logs/Presence.hs
+++ b/Logs/Presence.hs
@@ -16,8 +16,10 @@ module Logs.Presence (
addLog,
readLog,
logNow,
+ logThen,
currentLog,
- historicalLog
+ currentLogInfo,
+ historicalLogInfo,
) where
import Data.Time.Clock.POSIX
@@ -42,15 +44,21 @@ logNow s i = do
now <- liftIO getPOSIXTime
return $ LogLine now s i
+logThen :: POSIXTime -> LogStatus -> String -> Annex LogLine
+logThen t s i = return $ LogLine t s i
+
{- Reads a log and returns only the info that is still in effect. -}
-currentLog :: FilePath -> Annex [String]
-currentLog file = map info . filterPresent <$> readLog file
+currentLogInfo :: FilePath -> Annex [String]
+currentLogInfo file = map info <$> currentLog file
+
+currentLog :: FilePath -> Annex [LogLine]
+currentLog file = filterPresent <$> readLog file
{- Reads a historical version of a log and returns the info that was in
- effect at that time.
-
- The date is formatted as shown in gitrevisions man page.
-}
-historicalLog :: RefDate -> FilePath -> Annex [String]
-historicalLog refdate file = map info . filterPresent . parseLog
+historicalLogInfo :: RefDate -> FilePath -> Annex [String]
+historicalLogInfo refdate file = map info . filterPresent . parseLog
<$> Annex.Branch.getHistorical refdate file