Mercurial > hg
annotate mercurial/help/revisions.txt @ 32425:397e3a2e9347
python3: allow hgloader to work with lazy loaders
Don't clobber the loader returned from find_spec.
This brings `hg version` down from 0.27 seconds to 0.17.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 21 May 2017 13:26:17 -0700 |
parents | 091d6b9157da |
children | f75d0aa5dc83 |
rev | line source |
---|---|
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
1 Mercurial supports several ways to specify revisions. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
2 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
3 Specifying single revisions |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
4 =========================== |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
5 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
6 A plain integer is treated as a revision number. Negative integers are |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
7 treated as sequential offsets from the tip, with -1 denoting the tip, |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
8 -2 denoting the revision prior to the tip, and so forth. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
9 |
30767
bbb5cc55ab8b
help: use a single paragraph to describe full and abbreviated nodeids
Martin von Zweigbergk <martinvonz@google.com>
parents:
20245
diff
changeset
|
10 A 40-digit hexadecimal string is treated as a unique revision identifier. |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
11 A hexadecimal string less than 40 characters long is treated as a |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
12 unique revision identifier and is referred to as a short-form |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
13 identifier. A short-form identifier is only valid if it is the prefix |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
14 of exactly one full-length identifier. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
15 |
16740
43cfe56121d3
help: include bookmarks in 'help revisions' and simplify wording
Kevin Bullock <kbullock@ringworld.org>
parents:
9999
diff
changeset
|
16 Any other string is treated as a bookmark, tag, or branch name. A |
43cfe56121d3
help: include bookmarks in 'help revisions' and simplify wording
Kevin Bullock <kbullock@ringworld.org>
parents:
9999
diff
changeset
|
17 bookmark is a movable pointer to a revision. A tag is a permanent name |
20245
4edd179fefb8
help: branch names primarily denote the tipmost unclosed branch head
Mads Kiilerich <madski@unity3d.com>
parents:
16740
diff
changeset
|
18 associated with a revision. A branch name denotes the tipmost open branch head |
4edd179fefb8
help: branch names primarily denote the tipmost unclosed branch head
Mads Kiilerich <madski@unity3d.com>
parents:
16740
diff
changeset
|
19 of that branch - or if they are all closed, the tipmost closed head of the |
4edd179fefb8
help: branch names primarily denote the tipmost unclosed branch head
Mads Kiilerich <madski@unity3d.com>
parents:
16740
diff
changeset
|
20 branch. Bookmark, tag, and branch names must not contain the ":" character. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
21 |
16740
43cfe56121d3
help: include bookmarks in 'help revisions' and simplify wording
Kevin Bullock <kbullock@ringworld.org>
parents:
9999
diff
changeset
|
22 The reserved name "tip" always identifies the most recent revision. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
23 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
24 The reserved name "null" indicates the null revision. This is the |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
25 revision of an empty repository, and the parent of revision 0. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
26 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
27 The reserved name "." indicates the working directory parent. If no |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
28 working directory is checked out, it is equivalent to null. If an |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
29 uncommitted merge is in progress, "." is the revision of the first |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
30 parent. |
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
31 |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
32 Finally, commands that expect a single revision (like ``hg update``) also |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
33 accept revsets (see below for details). When given a revset, they use the |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
34 last revision of the revset. A few commands accept two single revisions |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
35 (like ``hg diff``). When given a revset, they use the first and the last |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
36 revisions of the revset. |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
37 |
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
38 Specifying multiple revisions |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
39 ============================= |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
40 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
41 Mercurial supports a functional language for selecting a set of |
30770
d0a758e7002b
help: explain what the term "revset" means
Martin von Zweigbergk <martinvonz@google.com>
parents:
30769
diff
changeset
|
42 revisions. Expressions in this language are called revsets. |
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
43 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
44 The language supports a number of predicates which are joined by infix |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
45 operators. Parenthesis can be used for grouping. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
46 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
47 Identifiers such as branch names may need quoting with single or |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
48 double quotes if they contain characters like ``-`` or if they match |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
49 one of the predefined predicates. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
50 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
51 Special characters can be used in quoted identifiers by escaping them, |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
52 e.g., ``\n`` is interpreted as a newline. To prevent them from being |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
53 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
54 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
55 Operators |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
56 ========= |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
57 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
58 There is a single prefix operator: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
59 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
60 ``not x`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
61 Changesets not in x. Short form is ``! x``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
62 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
63 These are the supported infix operators: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
64 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
65 ``x::y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
66 A DAG range, meaning all changesets that are descendants of x and |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
67 ancestors of y, including x and y themselves. If the first endpoint |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
68 is left out, this is equivalent to ``ancestors(y)``, if the second |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
69 is left out it is equivalent to ``descendants(x)``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
70 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
71 An alternative syntax is ``x..y``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
72 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
73 ``x:y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
74 All changesets with revision numbers between x and y, both |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
75 inclusive. Either endpoint can be left out, they default to 0 and |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
76 tip. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
77 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
78 ``x and y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
79 The intersection of changesets in x and y. Short form is ``x & y``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
80 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
81 ``x or y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
82 The union of changesets in x and y. There are two alternative short |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
83 forms: ``x | y`` and ``x + y``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
84 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
85 ``x - y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
86 Changesets in x but not in y. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
87 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
88 ``x % y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
89 Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y). |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
90 This is shorthand notation for ``only(x, y)`` (see below). The second |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
91 argument is optional and, if left out, is equivalent to ``only(x)``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
92 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
93 ``x^n`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
94 The nth parent of x, n == 0, 1, or 2. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
95 For n == 0, x; for n == 1, the first parent of each changeset in x; |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
96 for n == 2, the second parent of changeset in x. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
97 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
98 ``x~n`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
99 The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
100 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
101 ``x ## y`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
102 Concatenate strings and identifiers into one string. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
103 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
104 All other prefix, infix and postfix operators have lower priority than |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
105 ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
106 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
107 For example:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
108 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
109 [revsetalias] |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
110 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)') |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
111 |
32084
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
112 ``issue(1234)`` is equivalent to |
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
113 ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` |
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
114 in this case. This matches against all of "issue 1234", "issue:1234", |
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
115 "issue1234" and "bug(1234)". |
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
116 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
117 There is a single postfix operator: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
118 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
119 ``x^`` |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
120 Equivalent to ``x^1``, the first parent of each changeset in x. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
121 |
30784
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
122 Patterns |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
123 ======== |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
124 |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
125 Where noted, predicates that perform string matching can accept a pattern |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
126 string. The pattern may be either a literal, or a regular expression. If the |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
127 pattern starts with ``re:``, the remainder of the pattern is treated as a |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
128 regular expression. Otherwise, it is treated as a literal. To match a pattern |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
129 that actually starts with ``re:``, use the prefix ``literal:``. |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
130 |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
131 Matching is case-sensitive, unless otherwise noted. To perform a case- |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
132 insensitive match on a case-sensitive predicate, use a regular expression, |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
133 prefixed with ``(?i)``. |
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
134 |
32084
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
135 For example, ``tag(r're:(?i)release')`` matches "release" or "RELEASE" |
091d6b9157da
help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
30784
diff
changeset
|
136 or "Release", etc |
30784
5dd67f0993ce
help: eliminate duplicate text for revset string patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
30771
diff
changeset
|
137 |
30769
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
138 Predicates |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
139 ========== |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
140 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
141 The following predicates are supported: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
142 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
143 .. predicatesmarker |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
144 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
145 Aliases |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
146 ======= |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
147 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
148 New predicates (known as "aliases") can be defined, using any combination of |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
149 existing predicates or other aliases. An alias definition looks like:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
150 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
151 <alias> = <definition> |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
152 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
153 in the ``revsetalias`` section of a Mercurial configuration file. Arguments |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
154 of the form `a1`, `a2`, etc. are substituted from the alias into the |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
155 definition. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
156 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
157 For example, |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
158 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
159 :: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
160 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
161 [revsetalias] |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
162 h = heads() |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
163 d(s) = sort(s, date) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
164 rs(s, k) = reverse(sort(s, k)) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
165 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
166 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
167 exactly equivalent to ``reverse(sort(0:tip, author))``. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
168 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
169 Equivalents |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
170 =========== |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
171 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
172 Command line equivalents for :hg:`log`:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
173 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
174 -f -> ::. |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
175 -d x -> date(x) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
176 -k x -> keyword(x) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
177 -m -> merge() |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
178 -u x -> user(x) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
179 -b x -> branch(x) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
180 -P x -> !::x |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
181 -l x -> limit(expr, x) |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
182 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
183 Examples |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
184 ======== |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
185 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
186 Some sample queries: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
187 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
188 - Changesets on the default branch:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
189 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
190 hg log -r "branch(default)" |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
191 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
192 - Changesets on the default branch since tag 1.5 (excluding merges):: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
193 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
194 hg log -r "branch(default) and 1.5:: and not merge()" |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
195 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
196 - Open branch heads:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
197 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
198 hg log -r "head() and not closed()" |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
199 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
200 - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
201 ``hgext/*``:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
202 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
203 hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')" |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
204 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
205 - Changesets committed in May 2008, sorted by user:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
206 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
207 hg log -r "sort(date('May 2008'), user)" |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
208 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
209 - Changesets mentioning "bug" or "issue" that are not in a tagged |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
210 release:: |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
211 |
e520f0f4b1cf
help: merge revsets.txt into revisions.txt
Martin von Zweigbergk <martinvonz@google.com>
parents:
30767
diff
changeset
|
212 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())" |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
213 |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
214 - Update to commit that bookmark @ is pointing too, without activating the |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
215 bookmark (this works because the last revision of the revset is used):: |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
216 |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
217 hg update :@ |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
218 |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
219 - Show diff between tags 1.3 and 1.5 (this works because the first and the |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
220 last revisions of the revset are used):: |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
221 |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30770
diff
changeset
|
222 hg diff -r 1.3::1.5 |