Show More
@@ -94,6 +94,9 b' The following predicates are supported:' | |||||
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)`` | |||
|
98 | Revision non-ambiguously specified by the given hex string prefix | |||
|
99 | ||||
97 | ``keyword(string)`` |
|
100 | ``keyword(string)`` | |
98 | Search commit message, user name, and names of changed files for |
|
101 | Search commit message, user name, and names of changed files for | |
99 | string. |
|
102 | string. | |
@@ -133,6 +136,9 b' The following predicates are supported:' | |||||
133 | ``removes(pattern)`` |
|
136 | ``removes(pattern)`` | |
134 | Changesets which remove files matching pattern. |
|
137 | Changesets which remove files matching pattern. | |
135 |
|
138 | |||
|
139 | ``rev(number)`` | |||
|
140 | Revision with the given numeric identifier. | |||
|
141 | ||||
136 | ``reverse(set)`` |
|
142 | ``reverse(set)`` | |
137 | Reverse order of set. |
|
143 | Reverse order of set. | |
138 |
|
144 |
@@ -173,6 +173,23 b' def func(repo, subset, a, b):' | |||||
173 |
|
173 | |||
174 | # functions |
|
174 | # functions | |
175 |
|
175 | |||
|
176 | def node(repo, subset, x): | |||
|
177 | l = getargs(x, 1, 1, _("rev wants one argument")) | |||
|
178 | n = getstring(l[0], _("rev wants a string")) | |||
|
179 | if len(n) == 40: | |||
|
180 | rn = repo[n].rev() | |||
|
181 | else: | |||
|
182 | rn = repo.changelog.rev(repo.changelog._partialmatch(n)) | |||
|
183 | return [r for r in subset if r == rn] | |||
|
184 | ||||
|
185 | def rev(repo, subset, x): | |||
|
186 | l = getargs(x, 1, 1, _("rev wants one argument")) | |||
|
187 | try: | |||
|
188 | l = int(getstring(l[0], _("rev wants a number"))) | |||
|
189 | except ValueError: | |||
|
190 | raise error.ParseError(_("rev expects a number")) | |||
|
191 | return [r for r in subset if r == l] | |||
|
192 | ||||
176 | def p1(repo, subset, x): |
|
193 | def p1(repo, subset, x): | |
177 | ps = set() |
|
194 | ps = set() | |
178 | cl = repo.changelog |
|
195 | cl = repo.changelog | |
@@ -501,6 +518,7 b' symbols = {' | |||||
501 | "min": minrev, |
|
518 | "min": minrev, | |
502 | "merge": merge, |
|
519 | "merge": merge, | |
503 | "modifies": modifies, |
|
520 | "modifies": modifies, | |
|
521 | "id": node, | |||
504 | "outgoing": outgoing, |
|
522 | "outgoing": outgoing, | |
505 | "p1": p1, |
|
523 | "p1": p1, | |
506 | "p2": p2, |
|
524 | "p2": p2, | |
@@ -508,6 +526,7 b' symbols = {' | |||||
508 | "present": present, |
|
526 | "present": present, | |
509 | "removes": removes, |
|
527 | "removes": removes, | |
510 | "reverse": reverse, |
|
528 | "reverse": reverse, | |
|
529 | "rev": rev, | |||
511 | "roots": roots, |
|
530 | "roots": roots, | |
512 | "sort": sort, |
|
531 | "sort": sort, | |
513 | "tag": tag, |
|
532 | "tag": tag, |
@@ -247,6 +247,8 b' quoting needed' | |||||
247 | 6 |
|
247 | 6 | |
248 | $ log 'modifies(b)' |
|
248 | $ log 'modifies(b)' | |
249 | 4 |
|
249 | 4 | |
|
250 | $ log 'id(5)' | |||
|
251 | 2 | |||
250 | $ log 'outgoing()' |
|
252 | $ log 'outgoing()' | |
251 | 8 |
|
253 | 8 | |
252 | 9 |
|
254 | 9 | |
@@ -276,6 +278,8 b' quoting needed' | |||||
276 | 4 |
|
278 | 4 | |
277 | 3 |
|
279 | 3 | |
278 | 2 |
|
280 | 2 | |
|
281 | $ log 'rev(5)' | |||
|
282 | 5 | |||
279 | $ log 'sort(limit(reverse(all()), 3))' |
|
283 | $ log 'sort(limit(reverse(all()), 3))' | |
280 | 7 |
|
284 | 7 | |
281 | 8 |
|
285 | 8 |
General Comments 0
You need to be logged in to leave comments.
Login now