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

@ -34,7 +34,7 @@ setGlobalConfig' :: ConfigName -> ConfigValue -> Annex ()
setGlobalConfig' name new = do
c <- liftIO currentVectorClock
Annex.Branch.change configLog $
showMapLog id id . changeMapLog c name new . parseGlobalConfig
encodeBL . showMapLog id id . changeMapLog c name new . parseGlobalConfig . decodeBL
unsetGlobalConfig :: ConfigName -> Annex ()
unsetGlobalConfig name = do
@ -50,5 +50,5 @@ parseGlobalConfig :: String -> MapLog ConfigName ConfigValue
parseGlobalConfig = parseMapLog Just Just
loadGlobalConfig :: Annex (M.Map ConfigName ConfigValue)
loadGlobalConfig = M.filter (not . null) . simpleMap . parseGlobalConfig
loadGlobalConfig = M.filter (not . null) . simpleMap . parseGlobalConfig . decodeBL
<$> Annex.Branch.get configLog