##// END OF EJS Templates
help: avoid using "$n" parameter in revsetalias example...
Yuya Nishihara -
r28986:97811ff7 stable
parent child Browse files
Show More
@@ -66,7 +66,7 b' existing predicates or other aliases. An'
66 <alias> = <definition>
66 <alias> = <definition>
67
67
68 in the ``revsetalias`` section of a Mercurial configuration file. Arguments
68 in the ``revsetalias`` section of a Mercurial configuration file. Arguments
69 of the form `$1`, `$2`, etc. are substituted from the alias into the
69 of the form `a1`, `a2`, etc. are substituted from the alias into the
70 definition.
70 definition.
71
71
72 For example,
72 For example,
@@ -75,8 +75,8 b' For example,'
75
75
76 [revsetalias]
76 [revsetalias]
77 h = heads()
77 h = heads()
78 d($1) = sort($1, date)
78 d(s) = sort(s, date)
79 rs($1, $2) = reverse(sort($1, $2))
79 rs(s, k) = reverse(sort(s, k))
80
80
81 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
81 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
82 exactly equivalent to ``reverse(sort(0:tip, author))``.
82 exactly equivalent to ``reverse(sort(0:tip, author))``.
@@ -85,14 +85,14 b' An infix operator ``##`` can concatenate'
85 one string. For example::
85 one string. For example::
86
86
87 [revsetalias]
87 [revsetalias]
88 issue($1) = grep(r'\bissue[ :]?' ## $1 ## r'\b|\bbug\(' ## $1 ## r'\)')
88 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
89
89
90 ``issue(1234)`` is equivalent to ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
90 ``issue(1234)`` is equivalent to ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
91 in this case. This matches against all of "issue 1234", "issue:1234",
91 in this case. This matches against all of "issue 1234", "issue:1234",
92 "issue1234" and "bug(1234)".
92 "issue1234" and "bug(1234)".
93
93
94 All other prefix, infix and postfix operators have lower priority than
94 All other prefix, infix and postfix operators have lower priority than
95 ``##``. For example, ``$1 ## $2~2`` is equivalent to ``($1 ## $2)~2``.
95 ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``.
96
96
97 Command line equivalents for :hg:`log`::
97 Command line equivalents for :hg:`log`::
98
98
General Comments 0
You need to be logged in to leave comments. Login now