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