Show More
@@ -1,87 +1,87 | |||
|
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. |
|
11 | 11 | |
|
12 | 12 | Special characters can be used in quoted identifiers by escaping them, |
|
13 | 13 | e.g., ``\n`` is interpreted as a newline. To prevent them from being |
|
14 | 14 | interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. |
|
15 | 15 | |
|
16 | 16 | There is a single prefix operator: |
|
17 | 17 | |
|
18 | 18 | ``not x`` |
|
19 | 19 | Changesets not in x. Short form is ``! x``. |
|
20 | 20 | |
|
21 | 21 | These are the supported infix operators: |
|
22 | 22 | |
|
23 | 23 | ``x::y`` |
|
24 | 24 | A DAG range, meaning all changesets that are descendants of x and |
|
25 | 25 | ancestors of y, including x and y themselves. If the first endpoint |
|
26 | 26 | is left out, this is equivalent to ``ancestors(y)``, if the second |
|
27 | 27 | is left out it is equivalent to ``descendants(x)``. |
|
28 | 28 | |
|
29 | 29 | An alternative syntax is ``x..y``. |
|
30 | 30 | |
|
31 | 31 | ``x:y`` |
|
32 | 32 | All changesets with revision numbers between x and y, both |
|
33 | 33 | inclusive. Either endpoint can be left out, they default to 0 and |
|
34 | 34 | tip. |
|
35 | 35 | |
|
36 | 36 | ``x and y`` |
|
37 | 37 | The intersection of changesets in x and y. Short form is ``x & y``. |
|
38 | 38 | |
|
39 | 39 | ``x or y`` |
|
40 | 40 | The union of changesets in x and y. There are two alternative short |
|
41 | 41 | forms: ``x | y`` and ``x + y``. |
|
42 | 42 | |
|
43 | 43 | ``x - y`` |
|
44 | 44 | Changesets in x but not in y. |
|
45 | 45 | |
|
46 | 46 | The following predicates are supported: |
|
47 | 47 | |
|
48 | 48 | .. predicatesmarker |
|
49 | 49 | |
|
50 | 50 | Command line equivalents for :hg:`log`:: |
|
51 | 51 | |
|
52 | 52 | -f -> ::. |
|
53 | 53 | -d x -> date(x) |
|
54 | 54 | -k x -> keyword(x) |
|
55 | 55 | -m -> merge() |
|
56 | 56 | -u x -> user(x) |
|
57 | 57 | -b x -> branch(x) |
|
58 | 58 | -P x -> !::x |
|
59 | 59 | -l x -> limit(expr, x) |
|
60 | 60 | |
|
61 | 61 | Some sample queries: |
|
62 | 62 | |
|
63 | 63 | - Changesets on the default branch:: |
|
64 | 64 | |
|
65 | 65 | hg log -r "branch(default)" |
|
66 | 66 | |
|
67 | 67 | - Changesets on the default branch since tag 1.5 (excluding merges):: |
|
68 | 68 | |
|
69 | 69 | hg log -r "branch(default) and 1.5:: and not merge()" |
|
70 | 70 | |
|
71 | 71 | - Open branch heads:: |
|
72 | 72 | |
|
73 | 73 | hg log -r "head() and not closed()" |
|
74 | 74 | |
|
75 | 75 | - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect |
|
76 | 76 | ``hgext/*``:: |
|
77 | 77 | |
|
78 | 78 | hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')" |
|
79 | 79 | |
|
80 |
- Changesets |
|
|
80 | - Changesets committed in May 2008, sorted by user:: | |
|
81 | 81 | |
|
82 | 82 | hg log -r "sort(date('May 2008'), user)" |
|
83 | 83 | |
|
84 | 84 | - Changesets mentioning "bug" or "issue" that are not in a tagged |
|
85 | 85 | release:: |
|
86 | 86 | |
|
87 | 87 | 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