convert all per-uuid log files to use Builder

Mostly didn't push the ByteStrings down very deep, but all of these log
files are not written to frequently at all, so slight remaining
innefficiency doesn't matter.

In Logs.UUID, removed the fixBadUUID code that cleaned up after a bug in
git-annex versions 3.20111105-3.20111110. In the unlikely event that a repo was
last touched by that ancient git-annex version, the descriptions of remotes
would appear missing when used with this version of git-annex. That is such minor
breakage, and so unlikely to still be a problem for any repos, that it was not
worth forward-porting that code to ByteString.
This commit is contained in:
Joey Hess 2019-01-09 14:00:35 -04:00
parent de4980ef85
commit 2fef43dd71
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
16 changed files with 70 additions and 54 deletions

View file

@ -20,6 +20,7 @@ module Logs.Schedule (
import qualified Data.Map as M
import qualified Data.Set as S
import Data.Time.LocalTime
import Data.ByteString.Builder
import Annex.Common
import Types.ScheduledActivity
@ -32,7 +33,9 @@ scheduleSet :: UUID -> [ScheduledActivity] -> Annex ()
scheduleSet uuid@(UUID _) activities = do
c <- liftIO currentVectorClock
Annex.Branch.change scheduleLog $
encodeBL . showLog id . changeLog c uuid val . parseLog Just . decodeBL
buildLog (byteString . encodeBS)
. changeLog c uuid val
. parseLog Just . decodeBL
where
val = fromScheduledActivities activities
scheduleSet NoUUID _ = error "unknown UUID; cannot modify"