Show More
@@ -1,166 +1,166 | |||||
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. Special characters can be used in quoted identifiers by |
|
10 | predicates. Special characters can be used in quoted identifiers by | |
11 | escaping them, e.g., ``\n`` is interpreted 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 ``descendants(x)``. |
|
24 | is left out it is equivalent to ``descendants(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 | All changesets belonging to the branches of changesets in set. | |
62 | all changesets belonging to one those branches. |
|
|||
63 |
|
62 | |||
64 | ``children(set)`` |
|
63 | ``children(set)`` | |
65 | Child changesets of changesets in set. |
|
64 | Child changesets of changesets in set. | |
66 |
|
65 | |||
67 | ``closed()`` |
|
66 | ``closed()`` | |
68 | Changeset is closed. |
|
67 | Changeset is closed. | |
69 |
|
68 | |||
70 | ``contains(pattern)`` |
|
69 | ``contains(pattern)`` | |
71 | Revision contains pattern. |
|
70 | Revision contains pattern. | |
72 |
|
71 | |||
73 | ``date(interval)`` |
|
72 | ``date(interval)`` | |
74 | Changesets within the interval, see :hg:`help dates`. |
|
73 | Changesets within the interval, see :hg:`help dates`. | |
75 |
|
74 | |||
76 | ``descendants(set)`` |
|
75 | ``descendants(set)`` | |
77 | Changesets which are decendants of changesets in set. |
|
76 | Changesets which are descendants of changesets in set. | |
78 |
|
77 | |||
79 | ``file(pattern)`` |
|
78 | ``file(pattern)`` | |
80 |
Changesets |
|
79 | Changesets affecting files matched by pattern. | |
81 |
|
80 | |||
82 | ``follow()`` |
|
81 | ``follow()`` | |
83 | An alias for ``::.`` (ancestors of the working copy's first parent). |
|
82 | An alias for ``::.`` (ancestors of the working copy's first parent). | |
84 |
|
83 | |||
85 | ``grep(regex)`` |
|
84 | ``grep(regex)`` | |
86 | Like ``keyword(string)`` but accepts a regex. |
|
85 | Like ``keyword(string)`` but accepts a regex. | |
87 |
|
86 | |||
88 | ``head()`` |
|
87 | ``head()`` | |
89 | Changeset is a head. |
|
88 | Changeset is a head. | |
90 |
|
89 | |||
91 | ``heads(set)`` |
|
90 | ``heads(set)`` | |
92 | Members of set with no children in set. |
|
91 | Members of set with no children in set. | |
93 |
|
92 | |||
94 | ``keyword(string)`` |
|
93 | ``keyword(string)`` | |
95 | Search commit message, user name, and names of changed files for |
|
94 | Search commit message, user name, and names of changed files for | |
96 | string. |
|
95 | string. | |
97 |
|
96 | |||
98 | ``limit(set, n)`` |
|
97 | ``limit(set, n)`` | |
99 | First n members of set. |
|
98 | First n members of set. | |
100 |
|
99 | |||
101 | ``max(set)`` |
|
100 | ``max(set)`` | |
102 | Changeset with highest revision number in set. |
|
101 | Changeset with highest revision number in set. | |
103 |
|
102 | |||
104 | ``merge()`` |
|
103 | ``merge()`` | |
105 | Changeset is a merge changeset. |
|
104 | Changeset is a merge changeset. | |
106 |
|
105 | |||
107 | ``modifies(pattern)`` |
|
106 | ``modifies(pattern)`` | |
108 |
Changesets |
|
107 | Changesets modifying files matched by pattern. | |
109 |
|
108 | |||
110 | ``outgoing([path])`` |
|
109 | ``outgoing([path])`` | |
111 | Changesets missing in path. |
|
110 | Changesets not found in the specified destination repository, or the | |
|
111 | default push location. | |||
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