diff mercurial/help/revisions.txt @ 30784:5dd67f0993ce

help: eliminate duplicate text for revset string patterns There's no reason to duplicate this so many times, and it's likely an instance will be missed if support for a new pattern is added and documented. The stringmatcher is mostly used by revsets, though it is also used for the 'tag' related templates, and namespace filtering in the journal extension. So maybe there's a better place to document it. `hg help patterns` seems inappropriate, because that is all file pattern matching. While here, indicate how to perform case insensitive regex searches.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 07 Jan 2017 23:35:35 -0500
parents c2cbc1b050db
children 091d6b9157da
line wrap: on
line diff
--- a/mercurial/help/revisions.txt	Sat Jan 07 21:26:32 2017 -0500
+++ b/mercurial/help/revisions.txt	Sat Jan 07 23:35:35 2017 -0500
@@ -119,6 +119,23 @@
 ``x^``
   Equivalent to ``x^1``, the first parent of each changeset in x.
 
+Patterns
+========
+
+Where noted, predicates that perform string matching can accept a pattern
+string. The pattern may be either a literal, or a regular expression. If the
+pattern starts with ``re:``, the remainder of the pattern is treated as a
+regular expression. Otherwise, it is treated as a literal. To match a pattern
+that actually starts with ``re:``, use the prefix ``literal:``.
+
+Matching is case-sensitive, unless otherwise noted.  To perform a case-
+insensitive match on a case-sensitive predicate, use a regular expression,
+prefixed with ``(?i)``.
+
+  For example::
+
+    ``tag(r're:(?i)release')`` matches "release" or "RELEASE" or "Release", etc
+
 Predicates
 ==========