comparison mercurial/help/revsets.txt @ 29989:5271ae666152

help: add sections for revsets
author timeless <timeless@mozdev.org>
date Wed, 21 Sep 2016 17:05:27 -0400
parents 96358865edb3
children b8a188a6f191
comparison
equal deleted inserted replaced
29988:96358865edb3 29989:5271ae666152
10 10
11 Special characters can be used in quoted identifiers by escaping them, 11 Special characters can be used in quoted identifiers by escaping them,
12 e.g., ``\n`` is interpreted as a newline. To prevent them from being 12 e.g., ``\n`` is interpreted as a newline. To prevent them from being
13 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. 13 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
14 14
15 Prefix
16 ======
17
15 There is a single prefix operator: 18 There is a single prefix operator:
16 19
17 ``not x`` 20 ``not x``
18 Changesets not in x. Short form is ``! x``. 21 Changesets not in x. Short form is ``! x``.
22
23 Infix
24 =====
19 25
20 These are the supported infix operators: 26 These are the supported infix operators:
21 27
22 ``x::y`` 28 ``x::y``
23 A DAG range, meaning all changesets that are descendants of x and 29 A DAG range, meaning all changesets that are descendants of x and
69 ``issue(1234)`` is equivalent to 75 ``issue(1234)`` is equivalent to
70 ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` 76 ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
71 in this case. This matches against all of "issue 1234", "issue:1234", 77 in this case. This matches against all of "issue 1234", "issue:1234",
72 "issue1234" and "bug(1234)". 78 "issue1234" and "bug(1234)".
73 79
80 Postfix
81 =======
82
74 There is a single postfix operator: 83 There is a single postfix operator:
75 84
76 ``x^`` 85 ``x^``
77 Equivalent to ``x^1``, the first parent of each changeset in x. 86 Equivalent to ``x^1``, the first parent of each changeset in x.
78 87
88 Predicates
89 ==========
79 90
80 The following predicates are supported: 91 The following predicates are supported:
81 92
82 .. predicatesmarker 93 .. predicatesmarker
94
95 Aliases
96 =======
83 97
84 New predicates (known as "aliases") can be defined, using any combination of 98 New predicates (known as "aliases") can be defined, using any combination of
85 existing predicates or other aliases. An alias definition looks like:: 99 existing predicates or other aliases. An alias definition looks like::
86 100
87 <alias> = <definition> 101 <alias> = <definition>
100 rs(s, k) = reverse(sort(s, k)) 114 rs(s, k) = reverse(sort(s, k))
101 115
102 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is 116 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
103 exactly equivalent to ``reverse(sort(0:tip, author))``. 117 exactly equivalent to ``reverse(sort(0:tip, author))``.
104 118
119 Equivalents
120 ===========
105 121
106 Command line equivalents for :hg:`log`:: 122 Command line equivalents for :hg:`log`::
107 123
108 -f -> ::. 124 -f -> ::.
109 -d x -> date(x) 125 -d x -> date(x)
111 -m -> merge() 127 -m -> merge()
112 -u x -> user(x) 128 -u x -> user(x)
113 -b x -> branch(x) 129 -b x -> branch(x)
114 -P x -> !::x 130 -P x -> !::x
115 -l x -> limit(expr, x) 131 -l x -> limit(expr, x)
132
133 Examples
134 ========
116 135
117 Some sample queries: 136 Some sample queries:
118 137
119 - Changesets on the default branch:: 138 - Changesets on the default branch::
120 139