add directory to views for files that lack specified metadata
* view: New field?=glob and ?tag syntax that includes a directory "_" in the view for files that do not have the specified metadata set. * Added annex.viewunsetdirectory git config to change the name of the "_" directory in a view. When in a view using the new syntax, old git-annex will fail to parse the view log. It errors with "Not in a view.", which is not ideal. But that only affects view commands. annex.viewunsetdirectory is included in the View for a couple of reasons. One is to avoid needing to warn the user that it should not be changed when in a view, since that would confuse git-annex. Another reason is that it helped with plumbing the value through to some pure functions. annex.viewunsetdirectory is actually mangled the same as any other view directory. So if it's configured to something like "N/A", there won't be multiple levels of directories, which would also confuse git-annex. Sponsored-By: Jack Hill on Patreon
This commit is contained in:
parent
fb30ad7846
commit
aa0350ff49
14 changed files with 179 additions and 50 deletions
|
@ -1,6 +1,6 @@
|
|||
{- types for metadata based branch views
|
||||
-
|
||||
- Copyright 2014 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2014-2023 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -9,9 +9,9 @@
|
|||
|
||||
module Types.View where
|
||||
|
||||
import Annex.Common
|
||||
import Types.MetaData
|
||||
import Utility.QuickCheck
|
||||
import Utility.Monad
|
||||
import qualified Git
|
||||
|
||||
import qualified Data.Set as S
|
||||
|
@ -42,6 +42,11 @@ data ViewFilter
|
|||
= FilterValues (S.Set MetaValue)
|
||||
| FilterGlob String
|
||||
| ExcludeValues (S.Set MetaValue)
|
||||
| FilterValuesOrUnset (S.Set MetaValue) ViewUnset
|
||||
| FilterGlobOrUnset String ViewUnset
|
||||
deriving (Eq, Read, Show)
|
||||
|
||||
newtype ViewUnset = ViewUnset String
|
||||
deriving (Eq, Read, Show)
|
||||
|
||||
instance Arbitrary ViewFilter where
|
||||
|
@ -60,3 +65,5 @@ multiValue :: ViewFilter -> Bool
|
|||
multiValue (FilterValues s) = S.size s > 1
|
||||
multiValue (FilterGlob _) = True
|
||||
multiValue (ExcludeValues _) = False
|
||||
multiValue (FilterValuesOrUnset _ _) = True
|
||||
multiValue (FilterGlobOrUnset _ _) = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue