Show More
@@ -1,203 +1,203 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 |
|
8 | quotes if they contain characters outside of | |
9 | ``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined |
|
9 | ``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined | |
10 | predicates. |
|
10 | predicates. | |
11 |
|
11 | |||
12 | Special characters can be used in quoted identifiers by escaping them, |
|
12 | Special characters can be used in quoted identifiers by escaping them, | |
13 | e.g., ``\n`` is interpreted as a newline. To prevent them from being |
|
13 | e.g., ``\n`` is interpreted as a newline. To prevent them from being | |
14 | interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. |
|
14 | interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. | |
15 |
|
15 | |||
16 | There is a single prefix operator: |
|
16 | There is a single prefix operator: | |
17 |
|
17 | |||
18 | ``not x`` |
|
18 | ``not x`` | |
19 | Changesets not in x. Short form is ``! x``. |
|
19 | Changesets not in x. Short form is ``! x``. | |
20 |
|
20 | |||
21 | These are the supported infix operators: |
|
21 | These are the supported infix operators: | |
22 |
|
22 | |||
23 | ``x::y`` |
|
23 | ``x::y`` | |
24 | A DAG range, meaning all changesets that are descendants of x and |
|
24 | A DAG range, meaning all changesets that are descendants of x and | |
25 | ancestors of y, including x and y themselves. If the first endpoint |
|
25 | ancestors of y, including x and y themselves. If the first endpoint | |
26 | is left out, this is equivalent to ``ancestors(y)``, if the second |
|
26 | is left out, this is equivalent to ``ancestors(y)``, if the second | |
27 | is left out it is equivalent to ``descendants(x)``. |
|
27 | is left out it is equivalent to ``descendants(x)``. | |
28 |
|
28 | |||
29 | An alternative syntax is ``x..y``. |
|
29 | An alternative syntax is ``x..y``. | |
30 |
|
30 | |||
31 | ``x:y`` |
|
31 | ``x:y`` | |
32 | All changesets with revision numbers between x and y, both |
|
32 | All changesets with revision numbers between x and y, both | |
33 | inclusive. Either endpoint can be left out, they default to 0 and |
|
33 | inclusive. Either endpoint can be left out, they default to 0 and | |
34 | tip. |
|
34 | tip. | |
35 |
|
35 | |||
36 | ``x and y`` |
|
36 | ``x and y`` | |
37 | The intersection of changesets in x and y. Short form is ``x & y``. |
|
37 | The intersection of changesets in x and y. Short form is ``x & y``. | |
38 |
|
38 | |||
39 | ``x or y`` |
|
39 | ``x or y`` | |
40 | The union of changesets in x and y. There are two alternative short |
|
40 | The union of changesets in x and y. There are two alternative short | |
41 | forms: ``x | y`` and ``x + y``. |
|
41 | forms: ``x | y`` and ``x + y``. | |
42 |
|
42 | |||
43 | ``x - y`` |
|
43 | ``x - y`` | |
44 | Changesets in x but not in y. |
|
44 | Changesets in x but not in y. | |
45 |
|
45 | |||
46 | The following predicates are supported: |
|
46 | The following predicates are supported: | |
47 |
|
47 | |||
48 | ``adds(pattern)`` |
|
48 | ``adds(pattern)`` | |
49 | Changesets that add a file matching pattern. |
|
49 | Changesets that add a file matching pattern. | |
50 |
|
50 | |||
51 | ``all()`` |
|
51 | ``all()`` | |
52 | All changesets, the same as ``0:tip``. |
|
52 | All changesets, the same as ``0:tip``. | |
53 |
|
53 | |||
54 | ``ancestor(single, single)`` |
|
54 | ``ancestor(single, single)`` | |
55 | Greatest common ancestor of the two changesets. |
|
55 | Greatest common ancestor of the two changesets. | |
56 |
|
56 | |||
57 | ``ancestors(set)`` |
|
57 | ``ancestors(set)`` | |
58 | Changesets that are ancestors of a changeset in set. |
|
58 | Changesets that are ancestors of a changeset in set. | |
59 |
|
59 | |||
60 | ``author(string)`` |
|
60 | ``author(string)`` | |
61 | Alias for ``user(string)``. |
|
61 | Alias for ``user(string)``. | |
62 |
|
62 | |||
63 | ``branch(set)`` |
|
63 | ``branch(set)`` | |
64 | All changesets belonging to the branches of changesets in set. |
|
64 | All changesets belonging to the branches of changesets in set. | |
65 |
|
65 | |||
66 | ``children(set)`` |
|
66 | ``children(set)`` | |
67 | Child changesets of changesets in set. |
|
67 | Child changesets of changesets in set. | |
68 |
|
68 | |||
69 | ``closed()`` |
|
69 | ``closed()`` | |
70 | Changeset is closed. |
|
70 | Changeset is closed. | |
71 |
|
71 | |||
72 | ``contains(pattern)`` |
|
72 | ``contains(pattern)`` | |
73 | Revision contains pattern. |
|
73 | Revision contains pattern. | |
74 |
|
74 | |||
75 | ``date(interval)`` |
|
75 | ``date(interval)`` | |
76 | Changesets within the interval, see :hg:`help dates`. |
|
76 | Changesets within the interval, see :hg:`help dates`. | |
77 |
|
77 | |||
78 | ``descendants(set)`` |
|
78 | ``descendants(set)`` | |
79 | Changesets which are descendants of changesets in set. |
|
79 | Changesets which are descendants of changesets in set. | |
80 |
|
80 | |||
81 | ``file(pattern)`` |
|
81 | ``file(pattern)`` | |
82 | Changesets affecting files matched by pattern. |
|
82 | Changesets affecting files matched by pattern. | |
83 |
|
83 | |||
84 | ``follow()`` |
|
84 | ``follow()`` | |
85 | An alias for ``::.`` (ancestors of the working copy's first parent). |
|
85 | An alias for ``::.`` (ancestors of the working copy's first parent). | |
86 |
|
86 | |||
87 | ``grep(regex)`` |
|
87 | ``grep(regex)`` | |
88 | Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')`` |
|
88 | Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')`` | |
89 | to ensure special escape characters are handled correctly. |
|
89 | to ensure special escape characters are handled correctly. | |
90 |
|
90 | |||
91 | ``head()`` |
|
91 | ``head()`` | |
92 | Changeset is a named branch head. |
|
92 | Changeset is a named branch head. | |
93 |
|
93 | |||
94 | ``heads(set)`` |
|
94 | ``heads(set)`` | |
95 | Members of set with no children in set. |
|
95 | Members of set with no children in set. | |
96 |
|
96 | |||
97 | ``id(string)`` |
|
97 | ``id(string)`` | |
98 | Revision non-ambiguously specified by the given hex string prefix |
|
98 | Revision non-ambiguously specified by the given hex string prefix | |
99 |
|
99 | |||
100 | ``keyword(string)`` |
|
100 | ``keyword(string)`` | |
101 | Search commit message, user name, and names of changed files for |
|
101 | Search commit message, user name, and names of changed files for | |
102 | string. |
|
102 | string. | |
103 |
|
103 | |||
104 | ``limit(set, n)`` |
|
104 | ``limit(set, n)`` | |
105 | First n members of set. |
|
105 | First n members of set. | |
106 |
|
106 | |||
107 | ``max(set)`` |
|
107 | ``max(set)`` | |
108 | Changeset with highest revision number in set. |
|
108 | Changeset with highest revision number in set. | |
109 |
|
109 | |||
110 | ``min(set)`` |
|
110 | ``min(set)`` | |
111 | Changeset with lowest revision number in set. |
|
111 | Changeset with lowest revision number in set. | |
112 |
|
112 | |||
113 | ``merge()`` |
|
113 | ``merge()`` | |
114 | Changeset is a merge changeset. |
|
114 | Changeset is a merge changeset. | |
115 |
|
115 | |||
116 | ``modifies(pattern)`` |
|
116 | ``modifies(pattern)`` | |
117 | Changesets modifying files matched by pattern. |
|
117 | Changesets modifying files matched by pattern. | |
118 |
|
118 | |||
119 | ``outgoing([path])`` |
|
119 | ``outgoing([path])`` | |
120 | Changesets not found in the specified destination repository, or the |
|
120 | Changesets not found in the specified destination repository, or the | |
121 | default push location. |
|
121 | default push location. | |
122 |
|
122 | |||
123 | ``p1(set)`` |
|
123 | ``p1(set)`` | |
124 | First parent of changesets in set. |
|
124 | First parent of changesets in set. | |
125 |
|
125 | |||
126 | ``p2(set)`` |
|
126 | ``p2(set)`` | |
127 | Second parent of changesets in set. |
|
127 | Second parent of changesets in set. | |
128 |
|
128 | |||
129 | ``parents(set)`` |
|
129 | ``parents(set)`` | |
130 | The set of all parents for all changesets in set. |
|
130 | The set of all parents for all changesets in set. | |
131 |
|
131 | |||
132 | ``present(set)`` |
|
132 | ``present(set)`` | |
133 | An empty set, if any revision in set isn't found; otherwise, |
|
133 | An empty set, if any revision in set isn't found; otherwise, | |
134 | all revisions in set. |
|
134 | all revisions in set. | |
135 |
|
135 | |||
136 | ``removes(pattern)`` |
|
136 | ``removes(pattern)`` | |
137 | Changesets which remove files matching pattern. |
|
137 | Changesets which remove files matching pattern. | |
138 |
|
138 | |||
139 | ``rev(number)`` |
|
139 | ``rev(number)`` | |
140 | Revision with the given numeric identifier. |
|
140 | Revision with the given numeric identifier. | |
141 |
|
141 | |||
142 | ``reverse(set)`` |
|
142 | ``reverse(set)`` | |
143 | Reverse order of set. |
|
143 | Reverse order of set. | |
144 |
|
144 | |||
145 | ``roots(set)`` |
|
145 | ``roots(set)`` | |
146 | Changesets with no parent changeset in set. |
|
146 | Changesets with no parent changeset in set. | |
147 |
|
147 | |||
148 | ``sort(set[, [-]key...])`` |
|
148 | ``sort(set[, [-]key...])`` | |
149 | Sort set by keys. The default sort order is ascending, specify a key |
|
149 | Sort set by keys. The default sort order is ascending, specify a key | |
150 | as ``-key`` to sort in descending order. |
|
150 | as ``-key`` to sort in descending order. | |
151 |
|
151 | |||
152 | The keys can be: |
|
152 | The keys can be: | |
153 |
|
153 | |||
154 | - ``rev`` for the revision number, |
|
154 | - ``rev`` for the revision number, | |
155 | - ``branch`` for the branch name, |
|
155 | - ``branch`` for the branch name, | |
156 | - ``desc`` for the commit message (description), |
|
156 | - ``desc`` for the commit message (description), | |
157 | - ``user`` for user name (``author`` can be used as an alias), |
|
157 | - ``user`` for user name (``author`` can be used as an alias), | |
158 | - ``date`` for the commit date |
|
158 | - ``date`` for the commit date | |
159 |
|
159 | |||
160 | ``tag(name)`` |
|
160 | ``tag(name)`` | |
161 | The specified tag by name, or all tagged revisions if no name is given. |
|
161 | The specified tag by name, or all tagged revisions if no name is given. | |
162 |
|
162 | |||
163 | ``user(string)`` |
|
163 | ``user(string)`` | |
164 | User name is string. |
|
164 | User name is string. | |
165 |
|
165 | |||
166 | Command line equivalents for :hg:`log`:: |
|
166 | Command line equivalents for :hg:`log`:: | |
167 |
|
167 | |||
168 | -f -> ::. |
|
168 | -f -> ::. | |
169 | -d x -> date(x) |
|
169 | -d x -> date(x) | |
170 | -k x -> keyword(x) |
|
170 | -k x -> keyword(x) | |
171 | -m -> merge() |
|
171 | -m -> merge() | |
172 | -u x -> user(x) |
|
172 | -u x -> user(x) | |
173 | -b x -> branch(x) |
|
173 | -b x -> branch(x) | |
174 | -P x -> !::x |
|
174 | -P x -> !::x | |
175 | -l x -> limit(expr, x) |
|
175 | -l x -> limit(expr, x) | |
176 |
|
176 | |||
177 | Some sample queries: |
|
177 | Some sample queries: | |
178 |
|
178 | |||
179 | - Changesets on the default branch:: |
|
179 | - Changesets on the default branch:: | |
180 |
|
180 | |||
181 |
hg log -r |
|
181 | hg log -r "branch(default)" | |
182 |
|
182 | |||
183 | - Changesets on the default branch since tag 1.5 (excluding merges):: |
|
183 | - Changesets on the default branch since tag 1.5 (excluding merges):: | |
184 |
|
184 | |||
185 |
hg log -r |
|
185 | hg log -r "branch(default) and 1.5:: and not merge()" | |
186 |
|
186 | |||
187 | - Open branch heads:: |
|
187 | - Open branch heads:: | |
188 |
|
188 | |||
189 |
hg log -r |
|
189 | hg log -r "head() and not closed()" | |
190 |
|
190 | |||
191 | - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect |
|
191 | - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect | |
192 | ``hgext/*``:: |
|
192 | ``hgext/*``:: | |
193 |
|
193 | |||
194 |
hg log -r |
|
194 | hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')" | |
195 |
|
195 | |||
196 | - Changesets in committed May 2008, sorted by user:: |
|
196 | - Changesets in committed May 2008, sorted by user:: | |
197 |
|
197 | |||
198 |
hg log -r |
|
198 | hg log -r "sort(date('May 2008'), user)" | |
199 |
|
199 | |||
200 | - Changesets mentioning "bug" or "issue" that are not in a tagged |
|
200 | - Changesets mentioning "bug" or "issue" that are not in a tagged | |
201 | release:: |
|
201 | release:: | |
202 |
|
202 | |||
203 |
hg log -r |
|
203 | 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