summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-02 14:53:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-02 14:53:19 -0400
commitd6744f85d3ad9b924eeee47148d34bec6992b5eb (patch)
treee2e6bd867580e8850a7fbab6df2df18eb12ccf7d /Command
parentbe4e7d409c851eb1f0e65da98f93331c5ba8c1b7 (diff)
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.
Diffstat (limited to 'Command')
-rw-r--r--Command/VAdd.hs2
-rw-r--r--Command/VFilter.hs2
-rw-r--r--Command/View.hs14
3 files changed, 2 insertions, 16 deletions
diff --git a/Command/VAdd.hs b/Command/VAdd.hs
index 6b53aa7ea..e3726a051 100644
--- a/Command/VAdd.hs
+++ b/Command/VAdd.hs
@@ -10,7 +10,7 @@ module Command.VAdd where
import Common.Annex
import Command
import Annex.View
-import Command.View (parseViewParam, checkoutViewBranch)
+import Command.View (checkoutViewBranch)
def :: [Command]
def = [notBareRepo $ notDirect $ command "vadd" (paramRepeating "FIELD=GLOB")
diff --git a/Command/VFilter.hs b/Command/VFilter.hs
index c16b28956..bd17aca45 100644
--- a/Command/VFilter.hs
+++ b/Command/VFilter.hs
@@ -10,7 +10,7 @@ module Command.VFilter where
import Common.Annex
import Command
import Annex.View
-import Command.View (paramView, parseViewParam, checkoutViewBranch)
+import Command.View (paramView, checkoutViewBranch)
def :: [Command]
def = [notBareRepo $ notDirect $
diff --git a/Command/View.hs b/Command/View.hs
index 932bc2d00..9aad12558 100644
--- a/Command/View.hs
+++ b/Command/View.hs
@@ -13,8 +13,6 @@ import qualified Git
import qualified Git.Command
import qualified Git.Ref
import qualified Git.Branch
-import Types.MetaData
-import Annex.MetaData
import Types.View
import Annex.View
import Logs.View
@@ -46,18 +44,6 @@ perform view = do
paramView :: String
paramView = paramPair (paramRepeating "TAG") (paramRepeating "FIELD=VALUE")
-{- Parse field=value
- -
- - Note that the field may not be a legal metadata field name,
- - but it's let through anyway.
- - This is useful when matching on directory names with spaces,
- - which are not legal MetaFields.
- -}
-parseViewParam :: String -> (MetaField, String)
-parseViewParam s = case separate (== '=') s of
- (tag, []) -> (tagMetaField, tag)
- (field, wanted) -> (mkMetaFieldUnchecked field, wanted)
-
mkView :: [String] -> Annex View
mkView params = do
v <- View <$> viewbranch <*> pure []