convert git-annex branch access to ByteStrings and Builders

Most of the individual logs are not converted yet, only presense logs
have an efficient ByteString Builder implemented so far. The rest
convert to and from String.
This commit is contained in:
Joey Hess 2019-01-03 13:21:48 -04:00
parent 53905490df
commit bfc9039ead
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
27 changed files with 163 additions and 120 deletions

View file

@ -32,14 +32,14 @@ scheduleSet :: UUID -> [ScheduledActivity] -> Annex ()
scheduleSet uuid@(UUID _) activities = do
c <- liftIO currentVectorClock
Annex.Branch.change scheduleLog $
showLog id . changeLog c uuid val . parseLog Just
encodeBL . showLog id . changeLog c uuid val . parseLog Just . decodeBL
where
val = fromScheduledActivities activities
scheduleSet NoUUID _ = error "unknown UUID; cannot modify"
scheduleMap :: Annex (M.Map UUID [ScheduledActivity])
scheduleMap = simpleMap
. parseLogWithUUID parser
. parseLogWithUUID parser . decodeBL
<$> Annex.Branch.get scheduleLog
where
parser _uuid = eitherToMaybe . parseScheduledActivities