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 |
is left out it is equivalent to ``descend |
|
|
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 | 61 | The branch names are found for changesets in set, and the result is |
|
62 | 62 | all changesets belonging to one those branches. |
|
63 | 63 | |
|
64 | 64 | ``children(set)`` |
|
65 | 65 | Child changesets of changesets in set. |
|
66 | 66 | |
|
67 | 67 | ``closed()`` |
|
68 | 68 | Changeset is closed. |
|
69 | 69 | |
|
70 | 70 | ``contains(pattern)`` |
|
71 | 71 | Revision contains pattern. |
|
72 | 72 | |
|
73 | 73 | ``date(interval)`` |
|
74 | 74 | Changesets within the interval, see :hg:`help dates`. |
|
75 | 75 | |
|
76 | 76 | ``descendants(set)`` |
|
77 | 77 | Changesets which are decendants of changesets in set. |
|
78 | 78 | |
|
79 | 79 | ``file(pattern)`` |
|
80 | 80 | Changesets which manually affected files matching pattern. |
|
81 | 81 | |
|
82 | 82 | ``follow()`` |
|
83 | 83 | An alias for ``::.`` (ancestors of the working copy's first parent). |
|
84 | 84 | |
|
85 | 85 | ``grep(regex)`` |
|
86 | 86 | Like ``keyword(string)`` but accepts a regex. |
|
87 | 87 | |
|
88 | 88 | ``head()`` |
|
89 | 89 | Changeset is a head. |
|
90 | 90 | |
|
91 | 91 | ``heads(set)`` |
|
92 | 92 | Members of set with no children in set. |
|
93 | 93 | |
|
94 | 94 | ``keyword(string)`` |
|
95 | 95 | Search commit message, user name, and names of changed files for |
|
96 | 96 | string. |
|
97 | 97 | |
|
98 | 98 | ``limit(set, n)`` |
|
99 | 99 | First n members of set. |
|
100 | 100 | |
|
101 | 101 | ``max(set)`` |
|
102 | 102 | Changeset with highest revision number in set. |
|
103 | 103 | |
|
104 | 104 | ``merge()`` |
|
105 | 105 | Changeset is a merge changeset. |
|
106 | 106 | |
|
107 | 107 | ``modifies(pattern)`` |
|
108 | 108 | Changesets which modify files matching pattern. |
|
109 | 109 | |
|
110 | 110 | ``outgoing([path])`` |
|
111 | 111 | Changesets missing in path. |
|
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