view, vfilter: Add support for filtering tags and values out of a view, using !tag and field!=value.
Note that negated globs are not supported. Would have complicated the code to add them, without changing the data type serialization in a non-backwards-compatable way. This commit was sponsored by Denver Gingerich.
This commit is contained in:
parent
2432ecbdcc
commit
c2e8c21ca6
8 changed files with 82 additions and 40 deletions
10
Logs/View.hs
10
Logs/View.hs
|
@ -75,12 +75,14 @@ branchView view
|
|||
| otherwise = "(" ++ branchcomp' c ++ ")"
|
||||
branchcomp' (ViewComponent metafield viewfilter _) =concat
|
||||
[ forcelegal (fromMetaField metafield)
|
||||
, "="
|
||||
, branchvals viewfilter
|
||||
]
|
||||
branchvals (FilterValues set) = intercalate "," $
|
||||
map (forcelegal . fromMetaValue) $ S.toList set
|
||||
branchvals (FilterGlob glob) = forcelegal glob
|
||||
branchvals (FilterValues set) = '=' : branchset set
|
||||
branchvals (FilterGlob glob) = '=' : forcelegal glob
|
||||
branchvals (ExcludeValues set) = "!=" ++ branchset set
|
||||
branchset = intercalate ","
|
||||
. map (forcelegal . fromMetaValue)
|
||||
. S.toList
|
||||
forcelegal s
|
||||
| Git.Ref.legal True s = s
|
||||
| otherwise = map (\c -> if isAlphaNum c then c else '_') s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue