follow-on changes from MetaData type changes

Including writing and parsing the metadata log files with
bytestring-builder and attoparsec.
This commit is contained in:
Joey Hess 2019-01-07 15:51:05 -04:00
parent 16c798b5ef
commit cb375977a6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
14 changed files with 102 additions and 81 deletions

View file

@ -28,6 +28,7 @@ import qualified Git.Ref
import Git.Types
import Logs.File
import qualified Data.Text as T
import qualified Data.Set as S
import Data.Char
@ -74,15 +75,15 @@ branchView view
branchcomp c
| viewVisible c = branchcomp' c
| otherwise = "(" ++ branchcomp' c ++ ")"
branchcomp' (ViewComponent metafield viewfilter _) =concat
[ forcelegal (fromMetaField metafield)
branchcomp' (ViewComponent metafield viewfilter _) = concat
[ forcelegal (T.unpack (fromMetaField metafield))
, branchvals viewfilter
]
branchvals (FilterValues set) = '=' : branchset set
branchvals (FilterGlob glob) = '=' : forcelegal glob
branchvals (ExcludeValues set) = "!=" ++ branchset set
branchset = intercalate ","
. map (forcelegal . fromMetaValue)
. map (forcelegal . decodeBS . fromMetaValue)
. S.toList
forcelegal s
| Git.Ref.legal True s = s