##// END OF EJS Templates
revset: improve help on strings
Matt Mackall -
r11420:a99ef371 default
parent child Browse files
Show More
@@ -1,166 +1,166 b''
1 Mercurial supports a functional language for selecting a set of
1 Mercurial supports a functional language for selecting a set of
2 revisions.
2 revisions.
3
3
4 The language supports a number of predicates which are joined by infix
4 The language supports a number of predicates which are joined by infix
5 operators. Parenthesis can be used for grouping.
5 operators. Parenthesis can be used for grouping.
6
6
7 Identifiers such as branch names must be quoted with single or double
7 Identifiers such as branch names must be quoted with single or double
8 quotes if they contain characters outside of ``[a-zA-Z0-9]`` or if
8 quotes if they contain characters outside of
9 they match one of the predefined predicates. Special characters can be
9 ``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined
10 used in the identifiers by quoting them, e.g., ``\n`` is interpreted
10 predicates. Special characters can be used in quoted identifiers by
11 as a newline.
11 escaping them, e.g., ``\n`` is interpreted as a newline.
12
12
13 There is a single prefix operator:
13 There is a single prefix operator:
14
14
15 ``not x``
15 ``not x``
16 Changesets not in x. Short form is ``! x``.
16 Changesets not in x. Short form is ``! x``.
17
17
18 These are the supported infix operators:
18 These are the supported infix operators:
19
19
20 ``x::y``
20 ``x::y``
21 A DAG range, meaning all changesets that are descendants of x and
21 A DAG range, meaning all changesets that are descendants of x and
22 ancestors of y, including x and y themselves. If the first endpoint
22 ancestors of y, including x and y themselves. If the first endpoint
23 is left out, this is equivalent to ``ancestors(y)``, if the second
23 is left out, this is equivalent to ``ancestors(y)``, if the second
24 is left out it is equivalent to ``descendents(x)``.
24 is left out it is equivalent to ``descendents(x)``.
25
25
26 An alternative syntax is ``x..y``.
26 An alternative syntax is ``x..y``.
27
27
28 ``x:y``
28 ``x:y``
29 All changesets with revision numbers between x and y, both
29 All changesets with revision numbers between x and y, both
30 inclusive. Either endpoint can be left out, they default to 0 and
30 inclusive. Either endpoint can be left out, they default to 0 and
31 tip.
31 tip.
32
32
33 ``x and y``
33 ``x and y``
34 The intersection of changesets in x and y. Short form is ``x & y``.
34 The intersection of changesets in x and y. Short form is ``x & y``.
35
35
36 ``x or y``
36 ``x or y``
37 The union of changesets in x and y. There are two alternative short
37 The union of changesets in x and y. There are two alternative short
38 forms: ``x | y`` and ``x + y``.
38 forms: ``x | y`` and ``x + y``.
39
39
40 ``x - y``
40 ``x - y``
41 Changesets in x but not in y.
41 Changesets in x but not in y.
42
42
43 The following predicates are supported:
43 The following predicates are supported:
44
44
45 ``adds(pattern)``
45 ``adds(pattern)``
46 Changesets that add a file matching pattern.
46 Changesets that add a file matching pattern.
47
47
48 ``all()``
48 ``all()``
49 All changesets, the same as ``0:tip``.
49 All changesets, the same as ``0:tip``.
50
50
51 ``ancestor(single, single)``
51 ``ancestor(single, single)``
52 Greatest common ancestor of the two changesets.
52 Greatest common ancestor of the two changesets.
53
53
54 ``ancestors(set)``
54 ``ancestors(set)``
55 Changesets that are ancestors of a changeset in set.
55 Changesets that are ancestors of a changeset in set.
56
56
57 ``author(string)``
57 ``author(string)``
58 Alias for ``user(string)``.
58 Alias for ``user(string)``.
59
59
60 ``branch(set)``
60 ``branch(set)``
61 The branch names are found for changesets in set, and the result is
61 The branch names are found for changesets in set, and the result is
62 all changesets belonging to one those branches.
62 all changesets belonging to one those branches.
63
63
64 ``children(set)``
64 ``children(set)``
65 Child changesets of changesets in set.
65 Child changesets of changesets in set.
66
66
67 ``closed()``
67 ``closed()``
68 Changeset is closed.
68 Changeset is closed.
69
69
70 ``contains(pattern)``
70 ``contains(pattern)``
71 Revision contains pattern.
71 Revision contains pattern.
72
72
73 ``date(interval)``
73 ``date(interval)``
74 Changesets within the interval, see :hg:`help dates`.
74 Changesets within the interval, see :hg:`help dates`.
75
75
76 ``descendants(set)``
76 ``descendants(set)``
77 Changesets which are decendants of changesets in set.
77 Changesets which are decendants of changesets in set.
78
78
79 ``file(pattern)``
79 ``file(pattern)``
80 Changesets which manually affected files matching pattern.
80 Changesets which manually affected files matching pattern.
81
81
82 ``follow()``
82 ``follow()``
83 An alias for ``::.`` (ancestors of the working copy's first parent).
83 An alias for ``::.`` (ancestors of the working copy's first parent).
84
84
85 ``grep(regex)``
85 ``grep(regex)``
86 Like ``keyword(string)`` but accepts a regex.
86 Like ``keyword(string)`` but accepts a regex.
87
87
88 ``head()``
88 ``head()``
89 Changeset is a head.
89 Changeset is a head.
90
90
91 ``heads(set)``
91 ``heads(set)``
92 Members of set with no children in set.
92 Members of set with no children in set.
93
93
94 ``keyword(string)``
94 ``keyword(string)``
95 Search commit message, user name, and names of changed files for
95 Search commit message, user name, and names of changed files for
96 string.
96 string.
97
97
98 ``limit(set, n)``
98 ``limit(set, n)``
99 First n members of set.
99 First n members of set.
100
100
101 ``max(set)``
101 ``max(set)``
102 Changeset with highest revision number in set.
102 Changeset with highest revision number in set.
103
103
104 ``merge()``
104 ``merge()``
105 Changeset is a merge changeset.
105 Changeset is a merge changeset.
106
106
107 ``modifies(pattern)``
107 ``modifies(pattern)``
108 Changesets which modify files matching pattern.
108 Changesets which modify files matching pattern.
109
109
110 ``outgoing([path])``
110 ``outgoing([path])``
111 Changesets missing in path.
111 Changesets missing in path.
112
112
113 ``p1(set)``
113 ``p1(set)``
114 First parent of changesets in set.
114 First parent of changesets in set.
115
115
116 ``p2(set)``
116 ``p2(set)``
117 Second parent of changesets in set.
117 Second parent of changesets in set.
118
118
119 ``parents(set)``
119 ``parents(set)``
120 The set of all parents for all changesets in set.
120 The set of all parents for all changesets in set.
121
121
122 ``removes(pattern)``
122 ``removes(pattern)``
123 Changesets which remove files matching pattern.
123 Changesets which remove files matching pattern.
124
124
125 ``reverse(set)``
125 ``reverse(set)``
126 Reverse order of set.
126 Reverse order of set.
127
127
128 ``roots(set)``
128 ``roots(set)``
129 Changesets with no parent changeset in set.
129 Changesets with no parent changeset in set.
130
130
131 ``sort(set[, [-]key...])``
131 ``sort(set[, [-]key...])``
132 Sort set by keys. The default sort order is ascending, specify a key
132 Sort set by keys. The default sort order is ascending, specify a key
133 as ``-key`` to sort in descending order.
133 as ``-key`` to sort in descending order.
134
134
135 The keys can be:
135 The keys can be:
136
136
137 - ``rev`` for the revision number,
137 - ``rev`` for the revision number,
138 - ``branch`` for the branch name,
138 - ``branch`` for the branch name,
139 - ``desc`` for the commit message (description),
139 - ``desc`` for the commit message (description),
140 - ``user`` for user name (``author`` can be used as an alias),
140 - ``user`` for user name (``author`` can be used as an alias),
141 - ``date`` for the commit date
141 - ``date`` for the commit date
142
142
143 ``tagged()``
143 ``tagged()``
144 Changeset is tagged.
144 Changeset is tagged.
145
145
146 ``user(string)``
146 ``user(string)``
147 User name is string.
147 User name is string.
148
148
149 Command line equivalents for :hg:`log`::
149 Command line equivalents for :hg:`log`::
150
150
151 -f -> ::.
151 -f -> ::.
152 -d x -> date(x)
152 -d x -> date(x)
153 -k x -> keyword(x)
153 -k x -> keyword(x)
154 -m -> merge()
154 -m -> merge()
155 -u x -> user(x)
155 -u x -> user(x)
156 -b x -> branch(x)
156 -b x -> branch(x)
157 -P x -> !::x
157 -P x -> !::x
158 -l x -> limit(expr, x)
158 -l x -> limit(expr, x)
159
159
160 Some sample queries::
160 Some sample queries::
161
161
162 hg log -r 'branch(default)'
162 hg log -r 'branch(default)'
163 hg log -r 'branch(default) and 1.5:: and not merge()'
163 hg log -r 'branch(default) and 1.5:: and not merge()'
164 hg log -r '1.3::1.5 and keyword(bug) and file("hgext/*")'
164 hg log -r '1.3::1.5 and keyword(bug) and file("hgext/*")'
165 hg log -r 'sort(date("May 2008"), user)'
165 hg log -r 'sort(date("May 2008"), user)'
166 hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())'
166 hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())'
General Comments 0
You need to be logged in to leave comments. Login now