##// END OF EJS Templates
help: merge revsets.txt into revisions.txt...
Martin von Zweigbergk -
r30769:e520f0f4 default
parent child Browse files
Show More
@@ -28,7 +28,6 b''
28 28 <File Name="patterns.txt" />
29 29 <File Name="phases.txt" />
30 30 <File Name="revisions.txt" />
31 <File Name="revsets.txt" />
32 31 <File Name="scripting.txt" />
33 32 <File Name="subrepos.txt" />
34 33 <File Name="templates.txt" />
@@ -210,10 +210,8 b' helptable = sorted(['
210 210 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
211 211 (['environment', 'env'], _('Environment Variables'),
212 212 loaddoc('environment')),
213 (['revisions', 'revs'], _('Specifying Single Revisions'),
214 loaddoc('revisions')),
215 (['revsets', 'revset', 'multirevs', 'mrevs'],
216 _("Specifying Revision Sets"), loaddoc('revsets')),
213 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
214 _('Specifying Revisions'), loaddoc('revisions')),
217 215 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
218 216 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
219 217 (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')),
@@ -280,7 +278,7 b' def addtopicsymbols(topic, marker, symbo'
280 278 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
281 279 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
282 280 filemerge.internalsdoc)
283 addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
281 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
284 282 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
285 283 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
286 284 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
@@ -1,4 +1,7 b''
1 Mercurial supports several ways to specify individual revisions.
1 Mercurial supports several ways to specify revisions.
2
3 Specifying single revisions
4 ===========================
2 5
3 6 A plain integer is treated as a revision number. Negative integers are
4 7 treated as sequential offsets from the tip, with -1 denoting the tip,
@@ -25,3 +28,163 b' The reserved name "." indicates the work'
25 28 working directory is checked out, it is equivalent to null. If an
26 29 uncommitted merge is in progress, "." is the revision of the first
27 30 parent.
31
32 Specifying multiple revisions
33 =============================
34
35 Mercurial supports a functional language for selecting a set of
36 revisions.
37
38 The language supports a number of predicates which are joined by infix
39 operators. Parenthesis can be used for grouping.
40
41 Identifiers such as branch names may need quoting with single or
42 double quotes if they contain characters like ``-`` or if they match
43 one of the predefined predicates.
44
45 Special characters can be used in quoted identifiers by escaping them,
46 e.g., ``\n`` is interpreted as a newline. To prevent them from being
47 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
48
49 Operators
50 =========
51
52 There is a single prefix operator:
53
54 ``not x``
55 Changesets not in x. Short form is ``! x``.
56
57 These are the supported infix operators:
58
59 ``x::y``
60 A DAG range, meaning all changesets that are descendants of x and
61 ancestors of y, including x and y themselves. If the first endpoint
62 is left out, this is equivalent to ``ancestors(y)``, if the second
63 is left out it is equivalent to ``descendants(x)``.
64
65 An alternative syntax is ``x..y``.
66
67 ``x:y``
68 All changesets with revision numbers between x and y, both
69 inclusive. Either endpoint can be left out, they default to 0 and
70 tip.
71
72 ``x and y``
73 The intersection of changesets in x and y. Short form is ``x & y``.
74
75 ``x or y``
76 The union of changesets in x and y. There are two alternative short
77 forms: ``x | y`` and ``x + y``.
78
79 ``x - y``
80 Changesets in x but not in y.
81
82 ``x % y``
83 Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
84 This is shorthand notation for ``only(x, y)`` (see below). The second
85 argument is optional and, if left out, is equivalent to ``only(x)``.
86
87 ``x^n``
88 The nth parent of x, n == 0, 1, or 2.
89 For n == 0, x; for n == 1, the first parent of each changeset in x;
90 for n == 2, the second parent of changeset in x.
91
92 ``x~n``
93 The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``.
94
95 ``x ## y``
96 Concatenate strings and identifiers into one string.
97
98 All other prefix, infix and postfix operators have lower priority than
99 ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``.
100
101 For example::
102
103 [revsetalias]
104 issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
105
106 ``issue(1234)`` is equivalent to
107 ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
108 in this case. This matches against all of "issue 1234", "issue:1234",
109 "issue1234" and "bug(1234)".
110
111 There is a single postfix operator:
112
113 ``x^``
114 Equivalent to ``x^1``, the first parent of each changeset in x.
115
116 Predicates
117 ==========
118
119 The following predicates are supported:
120
121 .. predicatesmarker
122
123 Aliases
124 =======
125
126 New predicates (known as "aliases") can be defined, using any combination of
127 existing predicates or other aliases. An alias definition looks like::
128
129 <alias> = <definition>
130
131 in the ``revsetalias`` section of a Mercurial configuration file. Arguments
132 of the form `a1`, `a2`, etc. are substituted from the alias into the
133 definition.
134
135 For example,
136
137 ::
138
139 [revsetalias]
140 h = heads()
141 d(s) = sort(s, date)
142 rs(s, k) = reverse(sort(s, k))
143
144 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
145 exactly equivalent to ``reverse(sort(0:tip, author))``.
146
147 Equivalents
148 ===========
149
150 Command line equivalents for :hg:`log`::
151
152 -f -> ::.
153 -d x -> date(x)
154 -k x -> keyword(x)
155 -m -> merge()
156 -u x -> user(x)
157 -b x -> branch(x)
158 -P x -> !::x
159 -l x -> limit(expr, x)
160
161 Examples
162 ========
163
164 Some sample queries:
165
166 - Changesets on the default branch::
167
168 hg log -r "branch(default)"
169
170 - Changesets on the default branch since tag 1.5 (excluding merges)::
171
172 hg log -r "branch(default) and 1.5:: and not merge()"
173
174 - Open branch heads::
175
176 hg log -r "head() and not closed()"
177
178 - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
179 ``hgext/*``::
180
181 hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
182
183 - Changesets committed in May 2008, sorted by user::
184
185 hg log -r "sort(date('May 2008'), user)"
186
187 - Changesets mentioning "bug" or "issue" that are not in a tagged
188 release::
189
190 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
@@ -353,8 +353,7 b' Testing -h/--help:'
353 353 merge-tools Merge Tools
354 354 patterns File Name Patterns
355 355 phases Working with Phases
356 revisions Specifying Single Revisions
357 revsets Specifying Revision Sets
356 revisions Specifying Revisions
358 357 scripting Using Mercurial from scripts and automation
359 358 subrepos Subrepositories
360 359 templating Template Usage
@@ -435,8 +434,7 b' Testing -h/--help:'
435 434 merge-tools Merge Tools
436 435 patterns File Name Patterns
437 436 phases Working with Phases
438 revisions Specifying Single Revisions
439 revsets Specifying Revision Sets
437 revisions Specifying Revisions
440 438 scripting Using Mercurial from scripts and automation
441 439 subrepos Subrepositories
442 440 templating Template Usage
@@ -115,8 +115,7 b' Short help:'
115 115 merge-tools Merge Tools
116 116 patterns File Name Patterns
117 117 phases Working with Phases
118 revisions Specifying Single Revisions
119 revsets Specifying Revision Sets
118 revisions Specifying Revisions
120 119 scripting Using Mercurial from scripts and automation
121 120 subrepos Subrepositories
122 121 templating Template Usage
@@ -191,8 +190,7 b' Short help:'
191 190 merge-tools Merge Tools
192 191 patterns File Name Patterns
193 192 phases Working with Phases
194 revisions Specifying Single Revisions
195 revsets Specifying Revision Sets
193 revisions Specifying Revisions
196 194 scripting Using Mercurial from scripts and automation
197 195 subrepos Subrepositories
198 196 templating Template Usage
@@ -831,8 +829,7 b' Test that default list of commands omits'
831 829 merge-tools Merge Tools
832 830 patterns File Name Patterns
833 831 phases Working with Phases
834 revisions Specifying Single Revisions
835 revsets Specifying Revision Sets
832 revisions Specifying Revisions
836 833 scripting Using Mercurial from scripts and automation
837 834 subrepos Subrepositories
838 835 templating Template Usage
@@ -1287,7 +1284,7 b' Test help hooks'
1287 1284 > return doc + '\nhelphook1\n'
1288 1285 >
1289 1286 > def extsetup(ui):
1290 > help.addtopichook('revsets', rewrite)
1287 > help.addtopichook('revisions', rewrite)
1291 1288 > EOF
1292 1289 $ cat > helphook2.py <<EOF
1293 1290 > from mercurial import help
@@ -1296,7 +1293,7 b' Test help hooks'
1296 1293 > return doc + '\nhelphook2\n'
1297 1294 >
1298 1295 > def extsetup(ui):
1299 > help.addtopichook('revsets', rewrite)
1296 > help.addtopichook('revisions', rewrite)
1300 1297 > EOF
1301 1298 $ echo '[extensions]' >> $HGRCPATH
1302 1299 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
@@ -1933,14 +1930,7 b' Dish up an empty repo; serve it cold.'
1933 1930 revisions
1934 1931 </a>
1935 1932 </td><td>
1936 Specifying Single Revisions
1937 </td></tr>
1938 <tr><td>
1939 <a href="/help/revsets">
1940 revsets
1941 </a>
1942 </td><td>
1943 Specifying Revision Sets
1933 Specifying Revisions
1944 1934 </td></tr>
1945 1935 <tr><td>
1946 1936 <a href="/help/scripting">
@@ -1601,14 +1601,10 b' help/ shows help topics'
1601 1601 "topic": "phases"
1602 1602 },
1603 1603 {
1604 "summary": "Specifying Single Revisions",
1604 "summary": "Specifying Revisions",
1605 1605 "topic": "revisions"
1606 1606 },
1607 1607 {
1608 "summary": "Specifying Revision Sets",
1609 "topic": "revsets"
1610 },
1611 {
1612 1608 "summary": "Using Mercurial from scripts and automation",
1613 1609 "topic": "scripting"
1614 1610 },
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now