Mercurial > hg
comparison mercurial/help/revsets.txt @ 29988:96358865edb3
help: move revsets.## documentation into infix section
author | timeless <timeless@mozdev.org> |
---|---|
date | Wed, 21 Sep 2016 17:23:05 +0000 |
parents | 18c1b107898e |
children | 5271ae666152 |
comparison
equal
deleted
inserted
replaced
29987:d532ef155b0e | 29988:96358865edb3 |
---|---|
53 for n == 2, the second parent of changeset in x. | 53 for n == 2, the second parent of changeset in x. |
54 | 54 |
55 ``x~n`` | 55 ``x~n`` |
56 The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``. | 56 The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``. |
57 | 57 |
58 ``x ## y`` | |
59 Concatenate strings and identifiers into one string. | |
60 | |
61 All other prefix, infix and postfix operators have lower priority than | |
62 ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``. | |
63 | |
64 For example:: | |
65 | |
66 [revsetalias] | |
67 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)') | |
68 | |
69 ``issue(1234)`` is equivalent to | |
70 ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` | |
71 in this case. This matches against all of "issue 1234", "issue:1234", | |
72 "issue1234" and "bug(1234)". | |
73 | |
58 There is a single postfix operator: | 74 There is a single postfix operator: |
59 | 75 |
60 ``x^`` | 76 ``x^`` |
61 Equivalent to ``x^1``, the first parent of each changeset in x. | 77 Equivalent to ``x^1``, the first parent of each changeset in x. |
62 | 78 |
84 rs(s, k) = reverse(sort(s, k)) | 100 rs(s, k) = reverse(sort(s, k)) |
85 | 101 |
86 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is | 102 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is |
87 exactly equivalent to ``reverse(sort(0:tip, author))``. | 103 exactly equivalent to ``reverse(sort(0:tip, author))``. |
88 | 104 |
89 An infix operator ``##`` can concatenate strings and identifiers into | |
90 one string. For example:: | |
91 | |
92 [revsetalias] | |
93 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)') | |
94 | |
95 ``issue(1234)`` is equivalent to ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` | |
96 in this case. This matches against all of "issue 1234", "issue:1234", | |
97 "issue1234" and "bug(1234)". | |
98 | |
99 All other prefix, infix and postfix operators have lower priority than | |
100 ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``. | |
101 | 105 |
102 Command line equivalents for :hg:`log`:: | 106 Command line equivalents for :hg:`log`:: |
103 | 107 |
104 -f -> ::. | 108 -f -> ::. |
105 -d x -> date(x) | 109 -d x -> date(x) |