Mercurial > public > mercurial-scm > hg
diff mercurial/revset.py @ 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 | 931a60880df4 |
children | 0b49449a01f4 |
line wrap: on
line diff
--- a/mercurial/revset.py Sat Jan 07 21:26:32 2017 -0500 +++ b/mercurial/revset.py Sat Jan 07 23:35:35 2017 -0500 @@ -588,9 +588,7 @@ def bookmark(repo, subset, x): """The named bookmark or all bookmarks. - If `name` starts with `re:`, the remainder of the name is treated as - a regular expression. To match a bookmark that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `name`. See ``hg help revsets.patterns``. """ # i18n: "bookmark" is a keyword args = getargs(x, 0, 1, _('bookmark takes one or no arguments')) @@ -628,9 +626,8 @@ All changesets belonging to the given branch or the branches of the given changesets. - If `string` starts with `re:`, the remainder of the name is treated as - a regular expression. To match a branch that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `string`. See + ``hg help revsets.patterns``. """ getbi = repo.revbranchcache().branchinfo @@ -815,9 +812,8 @@ def desc(repo, subset, x): """Search commit message for string. The match is case-insensitive. - If `string` starts with `re:`, the remainder of the string is treated as - a regular expression. To match a substring that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `string`. See + ``hg help revsets.patterns``. """ # i18n: "desc" is a keyword ds = getstring(x, _("desc requires a string")) @@ -927,9 +923,8 @@ """Changesets with the given label in the extra metadata, with the given optional value. - If `value` starts with `re:`, the remainder of the value is treated as - a regular expression. To match a value that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `value`. See + ``hg help revsets.patterns``. """ args = getargsdict(x, 'extra', 'label value') if 'label' not in args: @@ -1409,9 +1404,8 @@ def named(repo, subset, x): """The changesets in a given namespace. - If `namespace` starts with `re:`, the remainder of the string is treated as - a regular expression. To match a namespace that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `namespace`. See + ``hg help revsets.patterns``. """ # i18n: "named" is a keyword args = getargs(x, 1, 1, _('named requires a namespace argument')) @@ -2267,9 +2261,8 @@ def tag(repo, subset, x): """The specified tag by name, or all tagged revisions if no name is given. - If `name` starts with `re:`, the remainder of the name is treated as - a regular expression. To match a tag that actually starts with `re:`, - use the prefix `literal:`. + Pattern matching is supported for `name`. See + ``hg help revsets.patterns``. """ # i18n: "tag" is a keyword args = getargs(x, 0, 1, _("tag takes one or no arguments")) @@ -2310,9 +2303,8 @@ def user(repo, subset, x): """User name contains string. The match is case-insensitive. - If `string` starts with `re:`, the remainder of the string is treated as - a regular expression. To match a user that actually contains `re:`, use - the prefix `literal:`. + Pattern matching is supported for `string`. See + ``hg help revsets.patterns``. """ return author(repo, subset, x)