diff hgext/lfs/__init__.py @ 35741:73432eee0ac4

fileset: add kind:pat operator ":" isn't taken as a symbol character but an infix operator so we can write e.g. "path:'foo bar'" as well as "'path:foo bar'". An invalid pattern kind is rejected in the former form as we know a kind is specified explicitly. The binding strength is copied from "x:y" range operator of revset. Perhaps it can be adjusted later if we want to parse "foo:bar()" as "(foo:bar)()", not "foo:(bar())". We can also add "kind:" postfix operator if we want. One possible confusion is that the scope of the leading "set:" vs "kind:pat" operator. The former is consumed by a matcher so applies to the whole fileset expression: $ hg files 'set:foo() or kind:bar or baz' ^^^^^^^^^^^^^^^^^^^^^^^^ Whereas the scope of kind:pat operator is narrow: $ hg files 'set:foo() or kind:bar or baz' ^^^
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Jan 2018 13:29:15 +0900
parents 693e3bcae19e
children 60a6ab7bcda7
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Sun Jan 14 13:33:56 2018 +0900
+++ b/hgext/lfs/__init__.py	Sun Jan 14 13:29:15 2018 +0900
@@ -45,7 +45,7 @@
 
     # Which files to track in LFS.  Path tests are "**.extname" for file
     # extensions, and "path:under/some/directory" for path prefix.  Both
-    # are relative to the repository root, and the latter must be quoted.
+    # are relative to the repository root.
     # File size can be tested with the "size()" fileset, and tests can be
     # joined with fileset operators.  (See "hg help filesets.operators".)
     #
@@ -55,9 +55,9 @@
     # - size(">20MB")               # larger than 20MB
     # - !**.txt                     # anything not a *.txt file
     # - **.zip | **.tar.gz | **.7z  # some types of compressed files
-    # - "path:bin"                  # files under "bin" in the project root
+    # - path:bin                    # files under "bin" in the project root
     # - (**.php & size(">2MB")) | (**.js & size(">5MB")) | **.tar.gz
-    #     | ("path:bin" & !"path:/bin/README") | size(">1GB")
+    #     | (path:bin & !path:/bin/README) | size(">1GB")
     # (default: none())
     #
     # This is ignored if there is a tracked '.hglfs' file, and this setting