mercurial/match.py
changeset 25216 dc562165044a
parent 25215 4040e06e9b99
child 25231 8545bd381504
--- a/mercurial/match.py	Sat May 16 15:56:52 2015 -0700
+++ b/mercurial/match.py	Sat May 16 16:06:22 2015 -0700
@@ -528,7 +528,21 @@
 def readpatternfile(filepath, warn):
     '''parse a pattern file, returning a list of
     patterns. These patterns should be given to compile()
-    to be validated and converted into a match function.'''
+    to be validated and converted into a match function.
+
+    trailing white space is dropped.
+    the escape character is backslash.
+    comments start with #.
+    empty lines are skipped.
+
+    lines can be of the following formats:
+
+    syntax: regexp # defaults following lines to non-rooted regexps
+    syntax: glob   # defaults following lines to non-rooted globs
+    re:pattern     # non-rooted regular expression
+    glob:pattern   # non-rooted glob
+    pattern        # pattern of the current default type'''
+
     syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:',
                 'include': 'include'}
     syntax = 'relre:'