diff options
Diffstat (limited to 'Logs/SingleValue.hs')
-rw-r--r-- | Logs/SingleValue.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Logs/SingleValue.hs b/Logs/SingleValue.hs index 24242c83f..1a6181f56 100644 --- a/Logs/SingleValue.hs +++ b/Logs/SingleValue.hs @@ -15,7 +15,6 @@ module Logs.SingleValue where import Annex.Common import qualified Annex.Branch -import Logs.TimeStamp import Logs.Line import Annex.VectorClock @@ -28,21 +27,21 @@ class SingleValueSerializable v where data LogEntry v = LogEntry { changed :: VectorClock , value :: v - } deriving (Eq, Show, Ord) + } deriving (Eq, Ord) type Log v = S.Set (LogEntry v) showLog :: (SingleValueSerializable v) => Log v -> String showLog = unlines . map showline . S.toList where - showline (LogEntry t v) = unwords [show t, serialize v] + showline (LogEntry c v) = unwords [formatVectorClock c, serialize v] parseLog :: (Ord v, SingleValueSerializable v) => String -> Log v parseLog = S.fromList . mapMaybe parse . splitLines where parse line = do - let (ts, s) = splitword line - c <- VectorClock <$> parsePOSIXTime ts + let (sc, s) = splitword line + c <- parseVectorClock sc v <- deserialize s Just (LogEntry c v) splitword = separate (== ' ') |