Show More
This diff has been collapsed as it changes many lines, (1728 lines changed) Show them Hide them | |||||
@@ -1,4467 +1,2739 | |||||
1 | $ HGENCODING=utf-8 |
|
1 | $ HGENCODING=utf-8 | |
2 | $ export HGENCODING |
|
2 | $ export HGENCODING | |
3 | $ cat > testrevset.py << EOF |
|
3 | $ cat > testrevset.py << EOF | |
4 | > import mercurial.revset |
|
4 | > import mercurial.revset | |
5 | > |
|
5 | > | |
6 | > baseset = mercurial.revset.baseset |
|
6 | > baseset = mercurial.revset.baseset | |
7 | > |
|
7 | > | |
8 | > def r3232(repo, subset, x): |
|
8 | > def r3232(repo, subset, x): | |
9 | > """"simple revset that return [3,2,3,2] |
|
9 | > """"simple revset that return [3,2,3,2] | |
10 | > |
|
10 | > | |
11 | > revisions duplicated on purpose. |
|
11 | > revisions duplicated on purpose. | |
12 | > """ |
|
12 | > """ | |
13 | > if 3 not in subset: |
|
13 | > if 3 not in subset: | |
14 | > if 2 in subset: |
|
14 | > if 2 in subset: | |
15 | > return baseset([2,2]) |
|
15 | > return baseset([2,2]) | |
16 | > return baseset() |
|
16 | > return baseset() | |
17 | > return baseset([3,3,2,2]) |
|
17 | > return baseset([3,3,2,2]) | |
18 | > |
|
18 | > | |
19 | > mercurial.revset.symbols['r3232'] = r3232 |
|
19 | > mercurial.revset.symbols['r3232'] = r3232 | |
20 | > EOF |
|
20 | > EOF | |
21 | $ cat >> $HGRCPATH << EOF |
|
21 | $ cat >> $HGRCPATH << EOF | |
22 | > [extensions] |
|
22 | > [extensions] | |
23 | > drawdag=$TESTDIR/drawdag.py |
|
23 | > drawdag=$TESTDIR/drawdag.py | |
24 | > testrevset=$TESTTMP/testrevset.py |
|
24 | > testrevset=$TESTTMP/testrevset.py | |
25 | > EOF |
|
25 | > EOF | |
26 |
|
26 | |||
27 | $ try() { |
|
27 | $ try() { | |
28 | > hg debugrevspec --debug "$@" |
|
28 | > hg debugrevspec --debug "$@" | |
29 | > } |
|
29 | > } | |
30 |
|
30 | |||
31 | $ log() { |
|
31 | $ log() { | |
32 | > hg log --template '{rev}\n' -r "$1" |
|
32 | > hg log --template '{rev}\n' -r "$1" | |
33 | > } |
|
33 | > } | |
34 |
|
34 | |||
35 | extension to build '_intlist()' and '_hexlist()', which is necessary because |
|
35 | extension to build '_intlist()' and '_hexlist()', which is necessary because | |
36 | these predicates use '\0' as a separator: |
|
36 | these predicates use '\0' as a separator: | |
37 |
|
37 | |||
38 | $ cat <<EOF > debugrevlistspec.py |
|
38 | $ cat <<EOF > debugrevlistspec.py | |
39 | > from __future__ import absolute_import |
|
39 | > from __future__ import absolute_import | |
40 | > from mercurial import ( |
|
40 | > from mercurial import ( | |
41 | > node as nodemod, |
|
41 | > node as nodemod, | |
42 | > registrar, |
|
42 | > registrar, | |
43 | > revset, |
|
43 | > revset, | |
44 | > revsetlang, |
|
44 | > revsetlang, | |
45 | > smartset, |
|
45 | > smartset, | |
46 | > ) |
|
46 | > ) | |
47 | > cmdtable = {} |
|
47 | > cmdtable = {} | |
48 | > command = registrar.command(cmdtable) |
|
48 | > command = registrar.command(cmdtable) | |
49 | > @command(b'debugrevlistspec', |
|
49 | > @command(b'debugrevlistspec', | |
50 | > [('', 'optimize', None, 'print parsed tree after optimizing'), |
|
50 | > [('', 'optimize', None, 'print parsed tree after optimizing'), | |
51 | > ('', 'bin', None, 'unhexlify arguments')]) |
|
51 | > ('', 'bin', None, 'unhexlify arguments')]) | |
52 | > def debugrevlistspec(ui, repo, fmt, *args, **opts): |
|
52 | > def debugrevlistspec(ui, repo, fmt, *args, **opts): | |
53 | > if opts['bin']: |
|
53 | > if opts['bin']: | |
54 | > args = map(nodemod.bin, args) |
|
54 | > args = map(nodemod.bin, args) | |
55 | > expr = revsetlang.formatspec(fmt, list(args)) |
|
55 | > expr = revsetlang.formatspec(fmt, list(args)) | |
56 | > if ui.verbose: |
|
56 | > if ui.verbose: | |
57 | > tree = revsetlang.parse(expr, lookup=repo.__contains__) |
|
57 | > tree = revsetlang.parse(expr, lookup=repo.__contains__) | |
58 | > ui.note(revsetlang.prettyformat(tree), "\n") |
|
58 | > ui.note(revsetlang.prettyformat(tree), "\n") | |
59 | > if opts["optimize"]: |
|
59 | > if opts["optimize"]: | |
60 | > opttree = revsetlang.optimize(revsetlang.analyze(tree)) |
|
60 | > opttree = revsetlang.optimize(revsetlang.analyze(tree)) | |
61 | > ui.note("* optimized:\n", revsetlang.prettyformat(opttree), |
|
61 | > ui.note("* optimized:\n", revsetlang.prettyformat(opttree), | |
62 | > "\n") |
|
62 | > "\n") | |
63 | > func = revset.match(ui, expr, repo) |
|
63 | > func = revset.match(ui, expr, repo) | |
64 | > revs = func(repo) |
|
64 | > revs = func(repo) | |
65 | > if ui.verbose: |
|
65 | > if ui.verbose: | |
66 | > ui.note("* set:\n", smartset.prettyformat(revs), "\n") |
|
66 | > ui.note("* set:\n", smartset.prettyformat(revs), "\n") | |
67 | > for c in revs: |
|
67 | > for c in revs: | |
68 | > ui.write("%s\n" % c) |
|
68 | > ui.write("%s\n" % c) | |
69 | > EOF |
|
69 | > EOF | |
70 | $ cat <<EOF >> $HGRCPATH |
|
70 | $ cat <<EOF >> $HGRCPATH | |
71 | > [extensions] |
|
71 | > [extensions] | |
72 | > debugrevlistspec = $TESTTMP/debugrevlistspec.py |
|
72 | > debugrevlistspec = $TESTTMP/debugrevlistspec.py | |
73 | > EOF |
|
73 | > EOF | |
74 | $ trylist() { |
|
74 | $ trylist() { | |
75 | > hg debugrevlistspec --debug "$@" |
|
75 | > hg debugrevlistspec --debug "$@" | |
76 | > } |
|
76 | > } | |
77 |
|
77 | |||
78 | $ hg init repo |
|
78 | $ hg init repo | |
79 | $ cd repo |
|
79 | $ cd repo | |
80 |
|
80 | |||
81 | $ echo a > a |
|
81 | $ echo a > a | |
82 | $ hg branch a |
|
82 | $ hg branch a | |
83 | marked working directory as branch a |
|
83 | marked working directory as branch a | |
84 | (branches are permanent and global, did you want a bookmark?) |
|
84 | (branches are permanent and global, did you want a bookmark?) | |
85 | $ hg ci -Aqm0 |
|
85 | $ hg ci -Aqm0 | |
86 |
|
86 | |||
87 | $ echo b > b |
|
87 | $ echo b > b | |
88 | $ hg branch b |
|
88 | $ hg branch b | |
89 | marked working directory as branch b |
|
89 | marked working directory as branch b | |
90 | $ hg ci -Aqm1 |
|
90 | $ hg ci -Aqm1 | |
91 |
|
91 | |||
92 | $ rm a |
|
92 | $ rm a | |
93 | $ hg branch a-b-c- |
|
93 | $ hg branch a-b-c- | |
94 | marked working directory as branch a-b-c- |
|
94 | marked working directory as branch a-b-c- | |
95 | $ hg ci -Aqm2 -u Bob |
|
95 | $ hg ci -Aqm2 -u Bob | |
96 |
|
96 | |||
97 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' |
|
97 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' | |
98 | 2 |
|
98 | 2 | |
99 | $ hg log -r "extra('branch')" --template '{rev}\n' |
|
99 | $ hg log -r "extra('branch')" --template '{rev}\n' | |
100 | 0 |
|
100 | 0 | |
101 | 1 |
|
101 | 1 | |
102 | 2 |
|
102 | 2 | |
103 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' |
|
103 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' | |
104 | 0 a |
|
104 | 0 a | |
105 | 2 a-b-c- |
|
105 | 2 a-b-c- | |
106 |
|
106 | |||
107 | $ hg co 1 |
|
107 | $ hg co 1 | |
108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
109 | $ hg branch +a+b+c+ |
|
109 | $ hg branch +a+b+c+ | |
110 | marked working directory as branch +a+b+c+ |
|
110 | marked working directory as branch +a+b+c+ | |
111 | $ hg ci -Aqm3 |
|
111 | $ hg ci -Aqm3 | |
112 |
|
112 | |||
113 | $ hg co 2 # interleave |
|
113 | $ hg co 2 # interleave | |
114 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
114 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
115 | $ echo bb > b |
|
115 | $ echo bb > b | |
116 | $ hg branch -- -a-b-c- |
|
116 | $ hg branch -- -a-b-c- | |
117 | marked working directory as branch -a-b-c- |
|
117 | marked working directory as branch -a-b-c- | |
118 | $ hg ci -Aqm4 -d "May 12 2005" |
|
118 | $ hg ci -Aqm4 -d "May 12 2005" | |
119 |
|
119 | |||
120 | $ hg co 3 |
|
120 | $ hg co 3 | |
121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | $ hg branch !a/b/c/ |
|
122 | $ hg branch !a/b/c/ | |
123 | marked working directory as branch !a/b/c/ |
|
123 | marked working directory as branch !a/b/c/ | |
124 | $ hg ci -Aqm"5 bug" |
|
124 | $ hg ci -Aqm"5 bug" | |
125 |
|
125 | |||
126 | $ hg merge 4 |
|
126 | $ hg merge 4 | |
127 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
127 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
128 | (branch merge, don't forget to commit) |
|
128 | (branch merge, don't forget to commit) | |
129 | $ hg branch _a_b_c_ |
|
129 | $ hg branch _a_b_c_ | |
130 | marked working directory as branch _a_b_c_ |
|
130 | marked working directory as branch _a_b_c_ | |
131 | $ hg ci -Aqm"6 issue619" |
|
131 | $ hg ci -Aqm"6 issue619" | |
132 |
|
132 | |||
133 | $ hg branch .a.b.c. |
|
133 | $ hg branch .a.b.c. | |
134 | marked working directory as branch .a.b.c. |
|
134 | marked working directory as branch .a.b.c. | |
135 | $ hg ci -Aqm7 |
|
135 | $ hg ci -Aqm7 | |
136 |
|
136 | |||
137 | $ hg branch all |
|
137 | $ hg branch all | |
138 | marked working directory as branch all |
|
138 | marked working directory as branch all | |
139 |
|
139 | |||
140 | $ hg co 4 |
|
140 | $ hg co 4 | |
141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
142 | $ hg branch Γ© |
|
142 | $ hg branch Γ© | |
143 | marked working directory as branch \xc3\xa9 (esc) |
|
143 | marked working directory as branch \xc3\xa9 (esc) | |
144 | $ hg ci -Aqm9 |
|
144 | $ hg ci -Aqm9 | |
145 |
|
145 | |||
146 | $ hg tag -r6 1.0 |
|
146 | $ hg tag -r6 1.0 | |
147 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
147 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
148 |
|
148 | |||
149 | $ hg clone --quiet -U -r 7 . ../remote1 |
|
149 | $ hg clone --quiet -U -r 7 . ../remote1 | |
150 | $ hg clone --quiet -U -r 8 . ../remote2 |
|
150 | $ hg clone --quiet -U -r 8 . ../remote2 | |
151 | $ echo "[paths]" >> .hg/hgrc |
|
151 | $ echo "[paths]" >> .hg/hgrc | |
152 | $ echo "default = ../remote1" >> .hg/hgrc |
|
152 | $ echo "default = ../remote1" >> .hg/hgrc | |
153 |
|
153 | |||
154 | trivial |
|
154 | trivial | |
155 |
|
155 | |||
156 | $ try 0:1 |
|
156 | $ try 0:1 | |
157 | (range |
|
157 | (range | |
158 | (symbol '0') |
|
158 | (symbol '0') | |
159 | (symbol '1')) |
|
159 | (symbol '1')) | |
160 | * set: |
|
160 | * set: | |
161 | <spanset+ 0:2> |
|
161 | <spanset+ 0:2> | |
162 | 0 |
|
162 | 0 | |
163 | 1 |
|
163 | 1 | |
164 | $ try --optimize : |
|
164 | $ try --optimize : | |
165 | (rangeall |
|
165 | (rangeall | |
166 | None) |
|
166 | None) | |
167 | * optimized: |
|
167 | * optimized: | |
168 | (rangeall |
|
168 | (rangeall | |
169 | None) |
|
169 | None) | |
170 | * set: |
|
170 | * set: | |
171 | <spanset+ 0:10> |
|
171 | <spanset+ 0:10> | |
172 | 0 |
|
172 | 0 | |
173 | 1 |
|
173 | 1 | |
174 | 2 |
|
174 | 2 | |
175 | 3 |
|
175 | 3 | |
176 | 4 |
|
176 | 4 | |
177 | 5 |
|
177 | 5 | |
178 | 6 |
|
178 | 6 | |
179 | 7 |
|
179 | 7 | |
180 | 8 |
|
180 | 8 | |
181 | 9 |
|
181 | 9 | |
182 | $ try 3::6 |
|
182 | $ try 3::6 | |
183 | (dagrange |
|
183 | (dagrange | |
184 | (symbol '3') |
|
184 | (symbol '3') | |
185 | (symbol '6')) |
|
185 | (symbol '6')) | |
186 | * set: |
|
186 | * set: | |
187 | <baseset+ [3, 5, 6]> |
|
187 | <baseset+ [3, 5, 6]> | |
188 | 3 |
|
188 | 3 | |
189 | 5 |
|
189 | 5 | |
190 | 6 |
|
190 | 6 | |
191 | $ try '0|1|2' |
|
191 | $ try '0|1|2' | |
192 | (or |
|
192 | (or | |
193 | (list |
|
193 | (list | |
194 | (symbol '0') |
|
194 | (symbol '0') | |
195 | (symbol '1') |
|
195 | (symbol '1') | |
196 | (symbol '2'))) |
|
196 | (symbol '2'))) | |
197 | * set: |
|
197 | * set: | |
198 | <baseset [0, 1, 2]> |
|
198 | <baseset [0, 1, 2]> | |
199 | 0 |
|
199 | 0 | |
200 | 1 |
|
200 | 1 | |
201 | 2 |
|
201 | 2 | |
202 |
|
202 | |||
203 | names that should work without quoting |
|
203 | names that should work without quoting | |
204 |
|
204 | |||
205 | $ try a |
|
205 | $ try a | |
206 | (symbol 'a') |
|
206 | (symbol 'a') | |
207 | * set: |
|
207 | * set: | |
208 | <baseset [0]> |
|
208 | <baseset [0]> | |
209 | 0 |
|
209 | 0 | |
210 | $ try b-a |
|
210 | $ try b-a | |
211 | (minus |
|
211 | (minus | |
212 | (symbol 'b') |
|
212 | (symbol 'b') | |
213 | (symbol 'a')) |
|
213 | (symbol 'a')) | |
214 | * set: |
|
214 | * set: | |
215 | <filteredset |
|
215 | <filteredset | |
216 | <baseset [1]>, |
|
216 | <baseset [1]>, | |
217 | <not |
|
217 | <not | |
218 | <baseset [0]>>> |
|
218 | <baseset [0]>>> | |
219 | 1 |
|
219 | 1 | |
220 | $ try _a_b_c_ |
|
220 | $ try _a_b_c_ | |
221 | (symbol '_a_b_c_') |
|
221 | (symbol '_a_b_c_') | |
222 | * set: |
|
222 | * set: | |
223 | <baseset [6]> |
|
223 | <baseset [6]> | |
224 | 6 |
|
224 | 6 | |
225 | $ try _a_b_c_-a |
|
225 | $ try _a_b_c_-a | |
226 | (minus |
|
226 | (minus | |
227 | (symbol '_a_b_c_') |
|
227 | (symbol '_a_b_c_') | |
228 | (symbol 'a')) |
|
228 | (symbol 'a')) | |
229 | * set: |
|
229 | * set: | |
230 | <filteredset |
|
230 | <filteredset | |
231 | <baseset [6]>, |
|
231 | <baseset [6]>, | |
232 | <not |
|
232 | <not | |
233 | <baseset [0]>>> |
|
233 | <baseset [0]>>> | |
234 | 6 |
|
234 | 6 | |
235 | $ try .a.b.c. |
|
235 | $ try .a.b.c. | |
236 | (symbol '.a.b.c.') |
|
236 | (symbol '.a.b.c.') | |
237 | * set: |
|
237 | * set: | |
238 | <baseset [7]> |
|
238 | <baseset [7]> | |
239 | 7 |
|
239 | 7 | |
240 | $ try .a.b.c.-a |
|
240 | $ try .a.b.c.-a | |
241 | (minus |
|
241 | (minus | |
242 | (symbol '.a.b.c.') |
|
242 | (symbol '.a.b.c.') | |
243 | (symbol 'a')) |
|
243 | (symbol 'a')) | |
244 | * set: |
|
244 | * set: | |
245 | <filteredset |
|
245 | <filteredset | |
246 | <baseset [7]>, |
|
246 | <baseset [7]>, | |
247 | <not |
|
247 | <not | |
248 | <baseset [0]>>> |
|
248 | <baseset [0]>>> | |
249 | 7 |
|
249 | 7 | |
250 |
|
250 | |||
251 | names that should be caught by fallback mechanism |
|
251 | names that should be caught by fallback mechanism | |
252 |
|
252 | |||
253 | $ try -- '-a-b-c-' |
|
253 | $ try -- '-a-b-c-' | |
254 | (symbol '-a-b-c-') |
|
254 | (symbol '-a-b-c-') | |
255 | * set: |
|
255 | * set: | |
256 | <baseset [4]> |
|
256 | <baseset [4]> | |
257 | 4 |
|
257 | 4 | |
258 | $ log -a-b-c- |
|
258 | $ log -a-b-c- | |
259 | 4 |
|
259 | 4 | |
260 | $ try '+a+b+c+' |
|
260 | $ try '+a+b+c+' | |
261 | (symbol '+a+b+c+') |
|
261 | (symbol '+a+b+c+') | |
262 | * set: |
|
262 | * set: | |
263 | <baseset [3]> |
|
263 | <baseset [3]> | |
264 | 3 |
|
264 | 3 | |
265 | $ try '+a+b+c+:' |
|
265 | $ try '+a+b+c+:' | |
266 | (rangepost |
|
266 | (rangepost | |
267 | (symbol '+a+b+c+')) |
|
267 | (symbol '+a+b+c+')) | |
268 | * set: |
|
268 | * set: | |
269 | <spanset+ 3:10> |
|
269 | <spanset+ 3:10> | |
270 | 3 |
|
270 | 3 | |
271 | 4 |
|
271 | 4 | |
272 | 5 |
|
272 | 5 | |
273 | 6 |
|
273 | 6 | |
274 | 7 |
|
274 | 7 | |
275 | 8 |
|
275 | 8 | |
276 | 9 |
|
276 | 9 | |
277 | $ try ':+a+b+c+' |
|
277 | $ try ':+a+b+c+' | |
278 | (rangepre |
|
278 | (rangepre | |
279 | (symbol '+a+b+c+')) |
|
279 | (symbol '+a+b+c+')) | |
280 | * set: |
|
280 | * set: | |
281 | <spanset+ 0:4> |
|
281 | <spanset+ 0:4> | |
282 | 0 |
|
282 | 0 | |
283 | 1 |
|
283 | 1 | |
284 | 2 |
|
284 | 2 | |
285 | 3 |
|
285 | 3 | |
286 | $ try -- '-a-b-c-:+a+b+c+' |
|
286 | $ try -- '-a-b-c-:+a+b+c+' | |
287 | (range |
|
287 | (range | |
288 | (symbol '-a-b-c-') |
|
288 | (symbol '-a-b-c-') | |
289 | (symbol '+a+b+c+')) |
|
289 | (symbol '+a+b+c+')) | |
290 | * set: |
|
290 | * set: | |
291 | <spanset- 3:5> |
|
291 | <spanset- 3:5> | |
292 | 4 |
|
292 | 4 | |
293 | 3 |
|
293 | 3 | |
294 | $ log '-a-b-c-:+a+b+c+' |
|
294 | $ log '-a-b-c-:+a+b+c+' | |
295 | 4 |
|
295 | 4 | |
296 | 3 |
|
296 | 3 | |
297 |
|
297 | |||
298 | $ try -- -a-b-c--a # complains |
|
298 | $ try -- -a-b-c--a # complains | |
299 | (minus |
|
299 | (minus | |
300 | (minus |
|
300 | (minus | |
301 | (minus |
|
301 | (minus | |
302 | (negate |
|
302 | (negate | |
303 | (symbol 'a')) |
|
303 | (symbol 'a')) | |
304 | (symbol 'b')) |
|
304 | (symbol 'b')) | |
305 | (symbol 'c')) |
|
305 | (symbol 'c')) | |
306 | (negate |
|
306 | (negate | |
307 | (symbol 'a'))) |
|
307 | (symbol 'a'))) | |
308 | abort: unknown revision '-a'! |
|
308 | abort: unknown revision '-a'! | |
309 | [255] |
|
309 | [255] | |
310 | $ try Γ© |
|
310 | $ try Γ© | |
311 | (symbol '\xc3\xa9') |
|
311 | (symbol '\xc3\xa9') | |
312 | * set: |
|
312 | * set: | |
313 | <baseset [9]> |
|
313 | <baseset [9]> | |
314 | 9 |
|
314 | 9 | |
315 |
|
315 | |||
316 | no quoting needed |
|
316 | no quoting needed | |
317 |
|
317 | |||
318 | $ log ::a-b-c- |
|
318 | $ log ::a-b-c- | |
319 | 0 |
|
319 | 0 | |
320 | 1 |
|
320 | 1 | |
321 | 2 |
|
321 | 2 | |
322 |
|
322 | |||
323 | quoting needed |
|
323 | quoting needed | |
324 |
|
324 | |||
325 | $ try '"-a-b-c-"-a' |
|
325 | $ try '"-a-b-c-"-a' | |
326 | (minus |
|
326 | (minus | |
327 | (string '-a-b-c-') |
|
327 | (string '-a-b-c-') | |
328 | (symbol 'a')) |
|
328 | (symbol 'a')) | |
329 | * set: |
|
329 | * set: | |
330 | <filteredset |
|
330 | <filteredset | |
331 | <baseset [4]>, |
|
331 | <baseset [4]>, | |
332 | <not |
|
332 | <not | |
333 | <baseset [0]>>> |
|
333 | <baseset [0]>>> | |
334 | 4 |
|
334 | 4 | |
335 |
|
335 | |||
336 | $ log '1 or 2' |
|
336 | $ log '1 or 2' | |
337 | 1 |
|
337 | 1 | |
338 | 2 |
|
338 | 2 | |
339 | $ log '1|2' |
|
339 | $ log '1|2' | |
340 | 1 |
|
340 | 1 | |
341 | 2 |
|
341 | 2 | |
342 | $ log '1 and 2' |
|
342 | $ log '1 and 2' | |
343 | $ log '1&2' |
|
343 | $ log '1&2' | |
344 | $ try '1&2|3' # precedence - and is higher |
|
344 | $ try '1&2|3' # precedence - and is higher | |
345 | (or |
|
345 | (or | |
346 | (list |
|
346 | (list | |
347 | (and |
|
347 | (and | |
348 | (symbol '1') |
|
348 | (symbol '1') | |
349 | (symbol '2')) |
|
349 | (symbol '2')) | |
350 | (symbol '3'))) |
|
350 | (symbol '3'))) | |
351 | * set: |
|
351 | * set: | |
352 | <addset |
|
352 | <addset | |
353 | <baseset []>, |
|
353 | <baseset []>, | |
354 | <baseset [3]>> |
|
354 | <baseset [3]>> | |
355 | 3 |
|
355 | 3 | |
356 | $ try '1|2&3' |
|
356 | $ try '1|2&3' | |
357 | (or |
|
357 | (or | |
358 | (list |
|
358 | (list | |
359 | (symbol '1') |
|
359 | (symbol '1') | |
360 | (and |
|
360 | (and | |
361 | (symbol '2') |
|
361 | (symbol '2') | |
362 | (symbol '3')))) |
|
362 | (symbol '3')))) | |
363 | * set: |
|
363 | * set: | |
364 | <addset |
|
364 | <addset | |
365 | <baseset [1]>, |
|
365 | <baseset [1]>, | |
366 | <baseset []>> |
|
366 | <baseset []>> | |
367 | 1 |
|
367 | 1 | |
368 | $ try '1&2&3' # associativity |
|
368 | $ try '1&2&3' # associativity | |
369 | (and |
|
369 | (and | |
370 | (and |
|
370 | (and | |
371 | (symbol '1') |
|
371 | (symbol '1') | |
372 | (symbol '2')) |
|
372 | (symbol '2')) | |
373 | (symbol '3')) |
|
373 | (symbol '3')) | |
374 | * set: |
|
374 | * set: | |
375 | <baseset []> |
|
375 | <baseset []> | |
376 | $ try '1|(2|3)' |
|
376 | $ try '1|(2|3)' | |
377 | (or |
|
377 | (or | |
378 | (list |
|
378 | (list | |
379 | (symbol '1') |
|
379 | (symbol '1') | |
380 | (group |
|
380 | (group | |
381 | (or |
|
381 | (or | |
382 | (list |
|
382 | (list | |
383 | (symbol '2') |
|
383 | (symbol '2') | |
384 | (symbol '3')))))) |
|
384 | (symbol '3')))))) | |
385 | * set: |
|
385 | * set: | |
386 | <addset |
|
386 | <addset | |
387 | <baseset [1]>, |
|
387 | <baseset [1]>, | |
388 | <baseset [2, 3]>> |
|
388 | <baseset [2, 3]>> | |
389 | 1 |
|
389 | 1 | |
390 | 2 |
|
390 | 2 | |
391 | 3 |
|
391 | 3 | |
392 | $ log '1.0' # tag |
|
392 | $ log '1.0' # tag | |
393 | 6 |
|
393 | 6 | |
394 | $ log 'a' # branch |
|
394 | $ log 'a' # branch | |
395 | 0 |
|
395 | 0 | |
396 | $ log '2785f51ee' |
|
396 | $ log '2785f51ee' | |
397 | 0 |
|
397 | 0 | |
398 | $ log 'date(2005)' |
|
398 | $ log 'date(2005)' | |
399 | 4 |
|
399 | 4 | |
400 | $ log 'date(this is a test)' |
|
400 | $ log 'date(this is a test)' | |
401 | hg: parse error at 10: unexpected token: symbol |
|
401 | hg: parse error at 10: unexpected token: symbol | |
402 | [255] |
|
402 | [255] | |
403 | $ log 'date()' |
|
403 | $ log 'date()' | |
404 | hg: parse error: date requires a string |
|
404 | hg: parse error: date requires a string | |
405 | [255] |
|
405 | [255] | |
406 | $ log 'date' |
|
406 | $ log 'date' | |
407 | abort: unknown revision 'date'! |
|
407 | abort: unknown revision 'date'! | |
408 | [255] |
|
408 | [255] | |
409 | $ log 'date(' |
|
409 | $ log 'date(' | |
410 | hg: parse error at 5: not a prefix: end |
|
410 | hg: parse error at 5: not a prefix: end | |
411 | [255] |
|
411 | [255] | |
412 | $ log 'date("\xy")' |
|
412 | $ log 'date("\xy")' | |
413 | hg: parse error: invalid \x escape |
|
413 | hg: parse error: invalid \x escape | |
414 | [255] |
|
414 | [255] | |
415 | $ log 'date(tip)' |
|
415 | $ log 'date(tip)' | |
416 | hg: parse error: invalid date: 'tip' |
|
416 | hg: parse error: invalid date: 'tip' | |
417 | [255] |
|
417 | [255] | |
418 | $ log '0:date' |
|
418 | $ log '0:date' | |
419 | abort: unknown revision 'date'! |
|
419 | abort: unknown revision 'date'! | |
420 | [255] |
|
420 | [255] | |
421 | $ log '::"date"' |
|
421 | $ log '::"date"' | |
422 | abort: unknown revision 'date'! |
|
422 | abort: unknown revision 'date'! | |
423 | [255] |
|
423 | [255] | |
424 | $ hg book date -r 4 |
|
424 | $ hg book date -r 4 | |
425 | $ log '0:date' |
|
425 | $ log '0:date' | |
426 | 0 |
|
426 | 0 | |
427 | 1 |
|
427 | 1 | |
428 | 2 |
|
428 | 2 | |
429 | 3 |
|
429 | 3 | |
430 | 4 |
|
430 | 4 | |
431 | $ log '::date' |
|
431 | $ log '::date' | |
432 | 0 |
|
432 | 0 | |
433 | 1 |
|
433 | 1 | |
434 | 2 |
|
434 | 2 | |
435 | 4 |
|
435 | 4 | |
436 | $ log '::"date"' |
|
436 | $ log '::"date"' | |
437 | 0 |
|
437 | 0 | |
438 | 1 |
|
438 | 1 | |
439 | 2 |
|
439 | 2 | |
440 | 4 |
|
440 | 4 | |
441 | $ log 'date(2005) and 1::' |
|
441 | $ log 'date(2005) and 1::' | |
442 | 4 |
|
442 | 4 | |
443 | $ hg book -d date |
|
443 | $ hg book -d date | |
444 |
|
444 | |||
445 | function name should be a symbol |
|
445 | function name should be a symbol | |
446 |
|
446 | |||
447 | $ log '"date"(2005)' |
|
447 | $ log '"date"(2005)' | |
448 | hg: parse error: not a symbol |
|
448 | hg: parse error: not a symbol | |
449 | [255] |
|
449 | [255] | |
450 |
|
450 | |||
451 | keyword arguments |
|
451 | keyword arguments | |
452 |
|
452 | |||
453 | $ log 'extra(branch, value=a)' |
|
453 | $ log 'extra(branch, value=a)' | |
454 | 0 |
|
454 | 0 | |
455 |
|
455 | |||
456 | $ log 'extra(branch, a, b)' |
|
456 | $ log 'extra(branch, a, b)' | |
457 | hg: parse error: extra takes at most 2 positional arguments |
|
457 | hg: parse error: extra takes at most 2 positional arguments | |
458 | [255] |
|
458 | [255] | |
459 | $ log 'extra(a, label=b)' |
|
459 | $ log 'extra(a, label=b)' | |
460 | hg: parse error: extra got multiple values for keyword argument 'label' |
|
460 | hg: parse error: extra got multiple values for keyword argument 'label' | |
461 | [255] |
|
461 | [255] | |
462 | $ log 'extra(label=branch, default)' |
|
462 | $ log 'extra(label=branch, default)' | |
463 | hg: parse error: extra got an invalid argument |
|
463 | hg: parse error: extra got an invalid argument | |
464 | [255] |
|
464 | [255] | |
465 | $ log 'extra(branch, foo+bar=baz)' |
|
465 | $ log 'extra(branch, foo+bar=baz)' | |
466 | hg: parse error: extra got an invalid argument |
|
466 | hg: parse error: extra got an invalid argument | |
467 | [255] |
|
467 | [255] | |
468 | $ log 'extra(unknown=branch)' |
|
468 | $ log 'extra(unknown=branch)' | |
469 | hg: parse error: extra got an unexpected keyword argument 'unknown' |
|
469 | hg: parse error: extra got an unexpected keyword argument 'unknown' | |
470 | [255] |
|
470 | [255] | |
471 |
|
471 | |||
472 | $ try 'foo=bar|baz' |
|
472 | $ try 'foo=bar|baz' | |
473 | (keyvalue |
|
473 | (keyvalue | |
474 | (symbol 'foo') |
|
474 | (symbol 'foo') | |
475 | (or |
|
475 | (or | |
476 | (list |
|
476 | (list | |
477 | (symbol 'bar') |
|
477 | (symbol 'bar') | |
478 | (symbol 'baz')))) |
|
478 | (symbol 'baz')))) | |
479 | hg: parse error: can't use a key-value pair in this context |
|
479 | hg: parse error: can't use a key-value pair in this context | |
480 | [255] |
|
480 | [255] | |
481 |
|
481 | |||
482 | right-hand side should be optimized recursively |
|
482 | right-hand side should be optimized recursively | |
483 |
|
483 | |||
484 | $ try --optimize 'foo=(not public())' |
|
484 | $ try --optimize 'foo=(not public())' | |
485 | (keyvalue |
|
485 | (keyvalue | |
486 | (symbol 'foo') |
|
486 | (symbol 'foo') | |
487 | (group |
|
487 | (group | |
488 | (not |
|
488 | (not | |
489 | (func |
|
489 | (func | |
490 | (symbol 'public') |
|
490 | (symbol 'public') | |
491 | None)))) |
|
491 | None)))) | |
492 | * optimized: |
|
492 | * optimized: | |
493 | (keyvalue |
|
493 | (keyvalue | |
494 | (symbol 'foo') |
|
494 | (symbol 'foo') | |
495 | (func |
|
495 | (func | |
496 | (symbol '_notpublic') |
|
496 | (symbol '_notpublic') | |
497 | None)) |
|
497 | None)) | |
498 | hg: parse error: can't use a key-value pair in this context |
|
498 | hg: parse error: can't use a key-value pair in this context | |
499 | [255] |
|
499 | [255] | |
500 |
|
500 | |||
501 | relation-subscript operator has the highest binding strength (as function call): |
|
501 | relation-subscript operator has the highest binding strength (as function call): | |
502 |
|
502 | |||
503 | $ hg debugrevspec -p parsed 'tip:tip^#generations[-1]' |
|
503 | $ hg debugrevspec -p parsed 'tip:tip^#generations[-1]' | |
504 | * parsed: |
|
504 | * parsed: | |
505 | (range |
|
505 | (range | |
506 | (symbol 'tip') |
|
506 | (symbol 'tip') | |
507 | (relsubscript |
|
507 | (relsubscript | |
508 | (parentpost |
|
508 | (parentpost | |
509 | (symbol 'tip')) |
|
509 | (symbol 'tip')) | |
510 | (symbol 'generations') |
|
510 | (symbol 'generations') | |
511 | (negate |
|
511 | (negate | |
512 | (symbol '1')))) |
|
512 | (symbol '1')))) | |
513 | 9 |
|
513 | 9 | |
514 | 8 |
|
514 | 8 | |
515 | 7 |
|
515 | 7 | |
516 | 6 |
|
516 | 6 | |
517 | 5 |
|
517 | 5 | |
518 | 4 |
|
518 | 4 | |
519 |
|
519 | |||
520 | $ hg debugrevspec -p parsed --no-show-revs 'not public()#generations[0]' |
|
520 | $ hg debugrevspec -p parsed --no-show-revs 'not public()#generations[0]' | |
521 | * parsed: |
|
521 | * parsed: | |
522 | (not |
|
522 | (not | |
523 | (relsubscript |
|
523 | (relsubscript | |
524 | (func |
|
524 | (func | |
525 | (symbol 'public') |
|
525 | (symbol 'public') | |
526 | None) |
|
526 | None) | |
527 | (symbol 'generations') |
|
527 | (symbol 'generations') | |
528 | (symbol '0'))) |
|
528 | (symbol '0'))) | |
529 |
|
529 | |||
530 | left-hand side of relation-subscript operator should be optimized recursively: |
|
530 | left-hand side of relation-subscript operator should be optimized recursively: | |
531 |
|
531 | |||
532 | $ hg debugrevspec -p analyzed -p optimized --no-show-revs \ |
|
532 | $ hg debugrevspec -p analyzed -p optimized --no-show-revs \ | |
533 | > '(not public())#generations[0]' |
|
533 | > '(not public())#generations[0]' | |
534 | * analyzed: |
|
534 | * analyzed: | |
535 | (relsubscript |
|
535 | (relsubscript | |
536 | (not |
|
536 | (not | |
537 | (func |
|
537 | (func | |
538 | (symbol 'public') |
|
538 | (symbol 'public') | |
539 | None)) |
|
539 | None)) | |
540 | (symbol 'generations') |
|
540 | (symbol 'generations') | |
541 | (symbol '0')) |
|
541 | (symbol '0')) | |
542 | * optimized: |
|
542 | * optimized: | |
543 | (relsubscript |
|
543 | (relsubscript | |
544 | (func |
|
544 | (func | |
545 | (symbol '_notpublic') |
|
545 | (symbol '_notpublic') | |
546 | None) |
|
546 | None) | |
547 | (symbol 'generations') |
|
547 | (symbol 'generations') | |
548 | (symbol '0')) |
|
548 | (symbol '0')) | |
549 |
|
549 | |||
550 | resolution of subscript and relation-subscript ternary operators: |
|
550 | resolution of subscript and relation-subscript ternary operators: | |
551 |
|
551 | |||
552 | $ hg debugrevspec -p analyzed 'tip[0]' |
|
552 | $ hg debugrevspec -p analyzed 'tip[0]' | |
553 | * analyzed: |
|
553 | * analyzed: | |
554 | (subscript |
|
554 | (subscript | |
555 | (symbol 'tip') |
|
555 | (symbol 'tip') | |
556 | (symbol '0')) |
|
556 | (symbol '0')) | |
557 | hg: parse error: can't use a subscript in this context |
|
557 | hg: parse error: can't use a subscript in this context | |
558 | [255] |
|
558 | [255] | |
559 |
|
559 | |||
560 | $ hg debugrevspec -p analyzed 'tip#rel[0]' |
|
560 | $ hg debugrevspec -p analyzed 'tip#rel[0]' | |
561 | * analyzed: |
|
561 | * analyzed: | |
562 | (relsubscript |
|
562 | (relsubscript | |
563 | (symbol 'tip') |
|
563 | (symbol 'tip') | |
564 | (symbol 'rel') |
|
564 | (symbol 'rel') | |
565 | (symbol '0')) |
|
565 | (symbol '0')) | |
566 | hg: parse error: unknown identifier: rel |
|
566 | hg: parse error: unknown identifier: rel | |
567 | [255] |
|
567 | [255] | |
568 |
|
568 | |||
569 | $ hg debugrevspec -p analyzed '(tip#rel)[0]' |
|
569 | $ hg debugrevspec -p analyzed '(tip#rel)[0]' | |
570 | * analyzed: |
|
570 | * analyzed: | |
571 | (subscript |
|
571 | (subscript | |
572 | (relation |
|
572 | (relation | |
573 | (symbol 'tip') |
|
573 | (symbol 'tip') | |
574 | (symbol 'rel')) |
|
574 | (symbol 'rel')) | |
575 | (symbol '0')) |
|
575 | (symbol '0')) | |
576 | hg: parse error: can't use a subscript in this context |
|
576 | hg: parse error: can't use a subscript in this context | |
577 | [255] |
|
577 | [255] | |
578 |
|
578 | |||
579 | $ hg debugrevspec -p analyzed 'tip#rel[0][1]' |
|
579 | $ hg debugrevspec -p analyzed 'tip#rel[0][1]' | |
580 | * analyzed: |
|
580 | * analyzed: | |
581 | (subscript |
|
581 | (subscript | |
582 | (relsubscript |
|
582 | (relsubscript | |
583 | (symbol 'tip') |
|
583 | (symbol 'tip') | |
584 | (symbol 'rel') |
|
584 | (symbol 'rel') | |
585 | (symbol '0')) |
|
585 | (symbol '0')) | |
586 | (symbol '1')) |
|
586 | (symbol '1')) | |
587 | hg: parse error: can't use a subscript in this context |
|
587 | hg: parse error: can't use a subscript in this context | |
588 | [255] |
|
588 | [255] | |
589 |
|
589 | |||
590 | $ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]' |
|
590 | $ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]' | |
591 | * analyzed: |
|
591 | * analyzed: | |
592 | (relsubscript |
|
592 | (relsubscript | |
593 | (relation |
|
593 | (relation | |
594 | (symbol 'tip') |
|
594 | (symbol 'tip') | |
595 | (symbol 'rel0')) |
|
595 | (symbol 'rel0')) | |
596 | (symbol 'rel1') |
|
596 | (symbol 'rel1') | |
597 | (symbol '1')) |
|
597 | (symbol '1')) | |
598 | hg: parse error: unknown identifier: rel1 |
|
598 | hg: parse error: unknown identifier: rel1 | |
599 | [255] |
|
599 | [255] | |
600 |
|
600 | |||
601 | $ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]' |
|
601 | $ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]' | |
602 | * analyzed: |
|
602 | * analyzed: | |
603 | (relsubscript |
|
603 | (relsubscript | |
604 | (relsubscript |
|
604 | (relsubscript | |
605 | (symbol 'tip') |
|
605 | (symbol 'tip') | |
606 | (symbol 'rel0') |
|
606 | (symbol 'rel0') | |
607 | (symbol '0')) |
|
607 | (symbol '0')) | |
608 | (symbol 'rel1') |
|
608 | (symbol 'rel1') | |
609 | (symbol '1')) |
|
609 | (symbol '1')) | |
610 | hg: parse error: unknown identifier: rel1 |
|
610 | hg: parse error: unknown identifier: rel1 | |
611 | [255] |
|
611 | [255] | |
612 |
|
612 | |||
613 | parse errors of relation, subscript and relation-subscript operators: |
|
613 | parse errors of relation, subscript and relation-subscript operators: | |
614 |
|
614 | |||
615 | $ hg debugrevspec '[0]' |
|
615 | $ hg debugrevspec '[0]' | |
616 | hg: parse error at 0: not a prefix: [ |
|
616 | hg: parse error at 0: not a prefix: [ | |
617 | [255] |
|
617 | [255] | |
618 | $ hg debugrevspec '.#' |
|
618 | $ hg debugrevspec '.#' | |
619 | hg: parse error at 2: not a prefix: end |
|
619 | hg: parse error at 2: not a prefix: end | |
620 | [255] |
|
620 | [255] | |
621 | $ hg debugrevspec '#rel' |
|
621 | $ hg debugrevspec '#rel' | |
622 | hg: parse error at 0: not a prefix: # |
|
622 | hg: parse error at 0: not a prefix: # | |
623 | [255] |
|
623 | [255] | |
624 | $ hg debugrevspec '.#rel[0' |
|
624 | $ hg debugrevspec '.#rel[0' | |
625 | hg: parse error at 7: unexpected token: end |
|
625 | hg: parse error at 7: unexpected token: end | |
626 | [255] |
|
626 | [255] | |
627 | $ hg debugrevspec '.]' |
|
627 | $ hg debugrevspec '.]' | |
628 | hg: parse error at 1: invalid token |
|
628 | hg: parse error at 1: invalid token | |
629 | [255] |
|
629 | [255] | |
630 |
|
630 | |||
631 | $ hg debugrevspec '.#generations[a]' |
|
631 | $ hg debugrevspec '.#generations[a]' | |
632 | hg: parse error: relation subscript must be an integer |
|
632 | hg: parse error: relation subscript must be an integer | |
633 | [255] |
|
633 | [255] | |
634 | $ hg debugrevspec '.#generations[1-2]' |
|
634 | $ hg debugrevspec '.#generations[1-2]' | |
635 | hg: parse error: relation subscript must be an integer |
|
635 | hg: parse error: relation subscript must be an integer | |
636 | [255] |
|
636 | [255] | |
637 |
|
637 | |||
638 | parsed tree at stages: |
|
638 | parsed tree at stages: | |
639 |
|
639 | |||
640 | $ hg debugrevspec -p all '()' |
|
640 | $ hg debugrevspec -p all '()' | |
641 | * parsed: |
|
641 | * parsed: | |
642 | (group |
|
642 | (group | |
643 | None) |
|
643 | None) | |
644 | * expanded: |
|
644 | * expanded: | |
645 | (group |
|
645 | (group | |
646 | None) |
|
646 | None) | |
647 | * concatenated: |
|
647 | * concatenated: | |
648 | (group |
|
648 | (group | |
649 | None) |
|
649 | None) | |
650 | * analyzed: |
|
650 | * analyzed: | |
651 | None |
|
651 | None | |
652 | * optimized: |
|
652 | * optimized: | |
653 | None |
|
653 | None | |
654 | hg: parse error: missing argument |
|
654 | hg: parse error: missing argument | |
655 | [255] |
|
655 | [255] | |
656 |
|
656 | |||
657 | $ hg debugrevspec --no-optimized -p all '()' |
|
657 | $ hg debugrevspec --no-optimized -p all '()' | |
658 | * parsed: |
|
658 | * parsed: | |
659 | (group |
|
659 | (group | |
660 | None) |
|
660 | None) | |
661 | * expanded: |
|
661 | * expanded: | |
662 | (group |
|
662 | (group | |
663 | None) |
|
663 | None) | |
664 | * concatenated: |
|
664 | * concatenated: | |
665 | (group |
|
665 | (group | |
666 | None) |
|
666 | None) | |
667 | * analyzed: |
|
667 | * analyzed: | |
668 | None |
|
668 | None | |
669 | hg: parse error: missing argument |
|
669 | hg: parse error: missing argument | |
670 | [255] |
|
670 | [255] | |
671 |
|
671 | |||
672 | $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1' |
|
672 | $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1' | |
673 | * parsed: |
|
673 | * parsed: | |
674 | (minus |
|
674 | (minus | |
675 | (group |
|
675 | (group | |
676 | (or |
|
676 | (or | |
677 | (list |
|
677 | (list | |
678 | (symbol '0') |
|
678 | (symbol '0') | |
679 | (symbol '1')))) |
|
679 | (symbol '1')))) | |
680 | (symbol '1')) |
|
680 | (symbol '1')) | |
681 | * analyzed: |
|
681 | * analyzed: | |
682 | (and |
|
682 | (and | |
683 | (or |
|
683 | (or | |
684 | (list |
|
684 | (list | |
685 | (symbol '0') |
|
685 | (symbol '0') | |
686 | (symbol '1'))) |
|
686 | (symbol '1'))) | |
687 | (not |
|
687 | (not | |
688 | (symbol '1'))) |
|
688 | (symbol '1'))) | |
689 | * optimized: |
|
689 | * optimized: | |
690 | (difference |
|
690 | (difference | |
691 | (func |
|
691 | (func | |
692 | (symbol '_list') |
|
692 | (symbol '_list') | |
693 | (string '0\x001')) |
|
693 | (string '0\x001')) | |
694 | (symbol '1')) |
|
694 | (symbol '1')) | |
695 | 0 |
|
695 | 0 | |
696 |
|
696 | |||
697 | $ hg debugrevspec -p unknown '0' |
|
697 | $ hg debugrevspec -p unknown '0' | |
698 | abort: invalid stage name: unknown |
|
698 | abort: invalid stage name: unknown | |
699 | [255] |
|
699 | [255] | |
700 |
|
700 | |||
701 | $ hg debugrevspec -p all --optimize '0' |
|
701 | $ hg debugrevspec -p all --optimize '0' | |
702 | abort: cannot use --optimize with --show-stage |
|
702 | abort: cannot use --optimize with --show-stage | |
703 | [255] |
|
703 | [255] | |
704 |
|
704 | |||
705 | verify optimized tree: |
|
705 | verify optimized tree: | |
706 |
|
706 | |||
707 | $ hg debugrevspec --verify '0|1' |
|
707 | $ hg debugrevspec --verify '0|1' | |
708 |
|
708 | |||
709 | $ hg debugrevspec --verify -v -p analyzed -p optimized 'r3232() & 2' |
|
709 | $ hg debugrevspec --verify -v -p analyzed -p optimized 'r3232() & 2' | |
710 | * analyzed: |
|
710 | * analyzed: | |
711 | (and |
|
711 | (and | |
712 | (func |
|
712 | (func | |
713 | (symbol 'r3232') |
|
713 | (symbol 'r3232') | |
714 | None) |
|
714 | None) | |
715 | (symbol '2')) |
|
715 | (symbol '2')) | |
716 | * optimized: |
|
716 | * optimized: | |
717 | (andsmally |
|
717 | (andsmally | |
718 | (func |
|
718 | (func | |
719 | (symbol 'r3232') |
|
719 | (symbol 'r3232') | |
720 | None) |
|
720 | None) | |
721 | (symbol '2')) |
|
721 | (symbol '2')) | |
722 | * analyzed set: |
|
722 | * analyzed set: | |
723 | <baseset [2]> |
|
723 | <baseset [2]> | |
724 | * optimized set: |
|
724 | * optimized set: | |
725 | <baseset [2, 2]> |
|
725 | <baseset [2, 2]> | |
726 | --- analyzed |
|
726 | --- analyzed | |
727 | +++ optimized |
|
727 | +++ optimized | |
728 | 2 |
|
728 | 2 | |
729 | +2 |
|
729 | +2 | |
730 | [1] |
|
730 | [1] | |
731 |
|
731 | |||
732 | $ hg debugrevspec --no-optimized --verify-optimized '0' |
|
732 | $ hg debugrevspec --no-optimized --verify-optimized '0' | |
733 | abort: cannot use --verify-optimized with --no-optimized |
|
733 | abort: cannot use --verify-optimized with --no-optimized | |
734 | [255] |
|
734 | [255] | |
735 |
|
735 | |||
736 | Test that symbols only get parsed as functions if there's an opening |
|
736 | Test that symbols only get parsed as functions if there's an opening | |
737 | parenthesis. |
|
737 | parenthesis. | |
738 |
|
738 | |||
739 | $ hg book only -r 9 |
|
739 | $ hg book only -r 9 | |
740 | $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark |
|
740 | $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark | |
741 | 8 |
|
741 | 8 | |
742 | 9 |
|
742 | 9 | |
743 |
|
743 | |||
744 | ':y' behaves like '0:y', but can't be rewritten as such since the revision '0' |
|
744 | ':y' behaves like '0:y', but can't be rewritten as such since the revision '0' | |
745 | may be hidden (issue5385) |
|
745 | may be hidden (issue5385) | |
746 |
|
746 | |||
747 | $ try -p parsed -p analyzed ':' |
|
747 | $ try -p parsed -p analyzed ':' | |
748 | * parsed: |
|
748 | * parsed: | |
749 | (rangeall |
|
749 | (rangeall | |
750 | None) |
|
750 | None) | |
751 | * analyzed: |
|
751 | * analyzed: | |
752 | (rangeall |
|
752 | (rangeall | |
753 | None) |
|
753 | None) | |
754 | * set: |
|
754 | * set: | |
755 | <spanset+ 0:10> |
|
755 | <spanset+ 0:10> | |
756 | 0 |
|
756 | 0 | |
757 | 1 |
|
757 | 1 | |
758 | 2 |
|
758 | 2 | |
759 | 3 |
|
759 | 3 | |
760 | 4 |
|
760 | 4 | |
761 | 5 |
|
761 | 5 | |
762 | 6 |
|
762 | 6 | |
763 | 7 |
|
763 | 7 | |
764 | 8 |
|
764 | 8 | |
765 | 9 |
|
765 | 9 | |
766 | $ try -p analyzed ':1' |
|
766 | $ try -p analyzed ':1' | |
767 | * analyzed: |
|
767 | * analyzed: | |
768 | (rangepre |
|
768 | (rangepre | |
769 | (symbol '1')) |
|
769 | (symbol '1')) | |
770 | * set: |
|
770 | * set: | |
771 | <spanset+ 0:2> |
|
771 | <spanset+ 0:2> | |
772 | 0 |
|
772 | 0 | |
773 | 1 |
|
773 | 1 | |
774 | $ try -p analyzed ':(1|2)' |
|
774 | $ try -p analyzed ':(1|2)' | |
775 | * analyzed: |
|
775 | * analyzed: | |
776 | (rangepre |
|
776 | (rangepre | |
777 | (or |
|
777 | (or | |
778 | (list |
|
778 | (list | |
779 | (symbol '1') |
|
779 | (symbol '1') | |
780 | (symbol '2')))) |
|
780 | (symbol '2')))) | |
781 | * set: |
|
781 | * set: | |
782 | <spanset+ 0:3> |
|
782 | <spanset+ 0:3> | |
783 | 0 |
|
783 | 0 | |
784 | 1 |
|
784 | 1 | |
785 | 2 |
|
785 | 2 | |
786 | $ try -p analyzed ':(1&2)' |
|
786 | $ try -p analyzed ':(1&2)' | |
787 | * analyzed: |
|
787 | * analyzed: | |
788 | (rangepre |
|
788 | (rangepre | |
789 | (and |
|
789 | (and | |
790 | (symbol '1') |
|
790 | (symbol '1') | |
791 | (symbol '2'))) |
|
791 | (symbol '2'))) | |
792 | * set: |
|
792 | * set: | |
793 | <baseset []> |
|
793 | <baseset []> | |
794 |
|
794 | |||
795 | infix/suffix resolution of ^ operator (issue2884): |
|
795 | infix/suffix resolution of ^ operator (issue2884): | |
796 |
|
796 | |||
797 | x^:y means (x^):y |
|
797 | x^:y means (x^):y | |
798 |
|
798 | |||
799 | $ try '1^:2' |
|
799 | $ try '1^:2' | |
800 | (range |
|
800 | (range | |
801 | (parentpost |
|
801 | (parentpost | |
802 | (symbol '1')) |
|
802 | (symbol '1')) | |
803 | (symbol '2')) |
|
803 | (symbol '2')) | |
804 | * set: |
|
804 | * set: | |
805 | <spanset+ 0:3> |
|
805 | <spanset+ 0:3> | |
806 | 0 |
|
806 | 0 | |
807 | 1 |
|
807 | 1 | |
808 | 2 |
|
808 | 2 | |
809 |
|
809 | |||
810 | $ try '1^::2' |
|
810 | $ try '1^::2' | |
811 | (dagrange |
|
811 | (dagrange | |
812 | (parentpost |
|
812 | (parentpost | |
813 | (symbol '1')) |
|
813 | (symbol '1')) | |
814 | (symbol '2')) |
|
814 | (symbol '2')) | |
815 | * set: |
|
815 | * set: | |
816 | <baseset+ [0, 1, 2]> |
|
816 | <baseset+ [0, 1, 2]> | |
817 | 0 |
|
817 | 0 | |
818 | 1 |
|
818 | 1 | |
819 | 2 |
|
819 | 2 | |
820 |
|
820 | |||
821 | $ try '9^:' |
|
821 | $ try '9^:' | |
822 | (rangepost |
|
822 | (rangepost | |
823 | (parentpost |
|
823 | (parentpost | |
824 | (symbol '9'))) |
|
824 | (symbol '9'))) | |
825 | * set: |
|
825 | * set: | |
826 | <spanset+ 8:10> |
|
826 | <spanset+ 8:10> | |
827 | 8 |
|
827 | 8 | |
828 | 9 |
|
828 | 9 | |
829 |
|
829 | |||
830 | x^:y should be resolved before omitting group operators |
|
830 | x^:y should be resolved before omitting group operators | |
831 |
|
831 | |||
832 | $ try '1^(:2)' |
|
832 | $ try '1^(:2)' | |
833 | (parent |
|
833 | (parent | |
834 | (symbol '1') |
|
834 | (symbol '1') | |
835 | (group |
|
835 | (group | |
836 | (rangepre |
|
836 | (rangepre | |
837 | (symbol '2')))) |
|
837 | (symbol '2')))) | |
838 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
838 | hg: parse error: ^ expects a number 0, 1, or 2 | |
839 | [255] |
|
839 | [255] | |
840 |
|
840 | |||
841 | x^:y should be resolved recursively |
|
841 | x^:y should be resolved recursively | |
842 |
|
842 | |||
843 | $ try 'sort(1^:2)' |
|
843 | $ try 'sort(1^:2)' | |
844 | (func |
|
844 | (func | |
845 | (symbol 'sort') |
|
845 | (symbol 'sort') | |
846 | (range |
|
846 | (range | |
847 | (parentpost |
|
847 | (parentpost | |
848 | (symbol '1')) |
|
848 | (symbol '1')) | |
849 | (symbol '2'))) |
|
849 | (symbol '2'))) | |
850 | * set: |
|
850 | * set: | |
851 | <spanset+ 0:3> |
|
851 | <spanset+ 0:3> | |
852 | 0 |
|
852 | 0 | |
853 | 1 |
|
853 | 1 | |
854 | 2 |
|
854 | 2 | |
855 |
|
855 | |||
856 | $ try '(3^:4)^:2' |
|
856 | $ try '(3^:4)^:2' | |
857 | (range |
|
857 | (range | |
858 | (parentpost |
|
858 | (parentpost | |
859 | (group |
|
859 | (group | |
860 | (range |
|
860 | (range | |
861 | (parentpost |
|
861 | (parentpost | |
862 | (symbol '3')) |
|
862 | (symbol '3')) | |
863 | (symbol '4')))) |
|
863 | (symbol '4')))) | |
864 | (symbol '2')) |
|
864 | (symbol '2')) | |
865 | * set: |
|
865 | * set: | |
866 | <spanset+ 0:3> |
|
866 | <spanset+ 0:3> | |
867 | 0 |
|
867 | 0 | |
868 | 1 |
|
868 | 1 | |
869 | 2 |
|
869 | 2 | |
870 |
|
870 | |||
871 | $ try '(3^::4)^::2' |
|
871 | $ try '(3^::4)^::2' | |
872 | (dagrange |
|
872 | (dagrange | |
873 | (parentpost |
|
873 | (parentpost | |
874 | (group |
|
874 | (group | |
875 | (dagrange |
|
875 | (dagrange | |
876 | (parentpost |
|
876 | (parentpost | |
877 | (symbol '3')) |
|
877 | (symbol '3')) | |
878 | (symbol '4')))) |
|
878 | (symbol '4')))) | |
879 | (symbol '2')) |
|
879 | (symbol '2')) | |
880 | * set: |
|
880 | * set: | |
881 | <baseset+ [0, 1, 2]> |
|
881 | <baseset+ [0, 1, 2]> | |
882 | 0 |
|
882 | 0 | |
883 | 1 |
|
883 | 1 | |
884 | 2 |
|
884 | 2 | |
885 |
|
885 | |||
886 | $ try '(9^:)^:' |
|
886 | $ try '(9^:)^:' | |
887 | (rangepost |
|
887 | (rangepost | |
888 | (parentpost |
|
888 | (parentpost | |
889 | (group |
|
889 | (group | |
890 | (rangepost |
|
890 | (rangepost | |
891 | (parentpost |
|
891 | (parentpost | |
892 | (symbol '9')))))) |
|
892 | (symbol '9')))))) | |
893 | * set: |
|
893 | * set: | |
894 | <spanset+ 4:10> |
|
894 | <spanset+ 4:10> | |
895 | 4 |
|
895 | 4 | |
896 | 5 |
|
896 | 5 | |
897 | 6 |
|
897 | 6 | |
898 | 7 |
|
898 | 7 | |
899 | 8 |
|
899 | 8 | |
900 | 9 |
|
900 | 9 | |
901 |
|
901 | |||
902 | x^ in alias should also be resolved |
|
902 | x^ in alias should also be resolved | |
903 |
|
903 | |||
904 | $ try 'A' --config 'revsetalias.A=1^:2' |
|
904 | $ try 'A' --config 'revsetalias.A=1^:2' | |
905 | (symbol 'A') |
|
905 | (symbol 'A') | |
906 | * expanded: |
|
906 | * expanded: | |
907 | (range |
|
907 | (range | |
908 | (parentpost |
|
908 | (parentpost | |
909 | (symbol '1')) |
|
909 | (symbol '1')) | |
910 | (symbol '2')) |
|
910 | (symbol '2')) | |
911 | * set: |
|
911 | * set: | |
912 | <spanset+ 0:3> |
|
912 | <spanset+ 0:3> | |
913 | 0 |
|
913 | 0 | |
914 | 1 |
|
914 | 1 | |
915 | 2 |
|
915 | 2 | |
916 |
|
916 | |||
917 | $ try 'A:2' --config 'revsetalias.A=1^' |
|
917 | $ try 'A:2' --config 'revsetalias.A=1^' | |
918 | (range |
|
918 | (range | |
919 | (symbol 'A') |
|
919 | (symbol 'A') | |
920 | (symbol '2')) |
|
920 | (symbol '2')) | |
921 | * expanded: |
|
921 | * expanded: | |
922 | (range |
|
922 | (range | |
923 | (parentpost |
|
923 | (parentpost | |
924 | (symbol '1')) |
|
924 | (symbol '1')) | |
925 | (symbol '2')) |
|
925 | (symbol '2')) | |
926 | * set: |
|
926 | * set: | |
927 | <spanset+ 0:3> |
|
927 | <spanset+ 0:3> | |
928 | 0 |
|
928 | 0 | |
929 | 1 |
|
929 | 1 | |
930 | 2 |
|
930 | 2 | |
931 |
|
931 | |||
932 | but not beyond the boundary of alias expansion, because the resolution should |
|
932 | but not beyond the boundary of alias expansion, because the resolution should | |
933 | be made at the parsing stage |
|
933 | be made at the parsing stage | |
934 |
|
934 | |||
935 | $ try '1^A' --config 'revsetalias.A=:2' |
|
935 | $ try '1^A' --config 'revsetalias.A=:2' | |
936 | (parent |
|
936 | (parent | |
937 | (symbol '1') |
|
937 | (symbol '1') | |
938 | (symbol 'A')) |
|
938 | (symbol 'A')) | |
939 | * expanded: |
|
939 | * expanded: | |
940 | (parent |
|
940 | (parent | |
941 | (symbol '1') |
|
941 | (symbol '1') | |
942 | (rangepre |
|
942 | (rangepre | |
943 | (symbol '2'))) |
|
943 | (symbol '2'))) | |
944 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
944 | hg: parse error: ^ expects a number 0, 1, or 2 | |
945 | [255] |
|
945 | [255] | |
946 |
|
946 | |||
947 | ancestor can accept 0 or more arguments |
|
947 | ancestor can accept 0 or more arguments | |
948 |
|
948 | |||
949 | $ log 'ancestor()' |
|
949 | $ log 'ancestor()' | |
950 | $ log 'ancestor(1)' |
|
950 | $ log 'ancestor(1)' | |
951 | 1 |
|
951 | 1 | |
952 | $ log 'ancestor(4,5)' |
|
952 | $ log 'ancestor(4,5)' | |
953 | 1 |
|
953 | 1 | |
954 | $ log 'ancestor(4,5) and 4' |
|
954 | $ log 'ancestor(4,5) and 4' | |
955 | $ log 'ancestor(0,0,1,3)' |
|
955 | $ log 'ancestor(0,0,1,3)' | |
956 | 0 |
|
956 | 0 | |
957 | $ log 'ancestor(3,1,5,3,5,1)' |
|
957 | $ log 'ancestor(3,1,5,3,5,1)' | |
958 | 1 |
|
958 | 1 | |
959 | $ log 'ancestor(0,1,3,5)' |
|
959 | $ log 'ancestor(0,1,3,5)' | |
960 | 0 |
|
960 | 0 | |
961 | $ log 'ancestor(1,2,3,4,5)' |
|
961 | $ log 'ancestor(1,2,3,4,5)' | |
962 | 1 |
|
962 | 1 | |
963 |
|
963 | |||
964 | test ancestors |
|
964 | test ancestors | |
965 |
|
965 | |||
966 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True |
|
966 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True | |
967 | @ 9 |
|
967 | @ 9 | |
968 | o 8 |
|
968 | o 8 | |
969 | | o 7 |
|
969 | | o 7 | |
970 | | o 6 |
|
970 | | o 6 | |
971 | |/| |
|
971 | |/| | |
972 | | o 5 |
|
972 | | o 5 | |
973 | o | 4 |
|
973 | o | 4 | |
974 | | o 3 |
|
974 | | o 3 | |
975 | o | 2 |
|
975 | o | 2 | |
976 | |/ |
|
976 | |/ | |
977 | o 1 |
|
977 | o 1 | |
978 | o 0 |
|
978 | o 0 | |
979 |
|
979 | |||
980 | $ log 'ancestors(5)' |
|
980 | $ log 'ancestors(5)' | |
981 | 0 |
|
981 | 0 | |
982 | 1 |
|
982 | 1 | |
983 | 3 |
|
983 | 3 | |
984 | 5 |
|
984 | 5 | |
985 | $ log 'ancestor(ancestors(5))' |
|
985 | $ log 'ancestor(ancestors(5))' | |
986 | 0 |
|
986 | 0 | |
987 | $ log '::r3232()' |
|
987 | $ log '::r3232()' | |
988 | 0 |
|
988 | 0 | |
989 | 1 |
|
989 | 1 | |
990 | 2 |
|
990 | 2 | |
991 | 3 |
|
991 | 3 | |
992 |
|
992 | |||
993 | test ancestors with depth limit |
|
993 | test ancestors with depth limit | |
994 |
|
994 | |||
995 | (depth=0 selects the node itself) |
|
995 | (depth=0 selects the node itself) | |
996 |
|
996 | |||
997 | $ log 'reverse(ancestors(9, depth=0))' |
|
997 | $ log 'reverse(ancestors(9, depth=0))' | |
998 | 9 |
|
998 | 9 | |
999 |
|
999 | |||
1000 | (interleaved: '4' would be missing if heap queue were higher depth first) |
|
1000 | (interleaved: '4' would be missing if heap queue were higher depth first) | |
1001 |
|
1001 | |||
1002 | $ log 'reverse(ancestors(8:9, depth=1))' |
|
1002 | $ log 'reverse(ancestors(8:9, depth=1))' | |
1003 | 9 |
|
1003 | 9 | |
1004 | 8 |
|
1004 | 8 | |
1005 | 4 |
|
1005 | 4 | |
1006 |
|
1006 | |||
1007 | (interleaved: '2' would be missing if heap queue were higher depth first) |
|
1007 | (interleaved: '2' would be missing if heap queue were higher depth first) | |
1008 |
|
1008 | |||
1009 | $ log 'reverse(ancestors(7+8, depth=2))' |
|
1009 | $ log 'reverse(ancestors(7+8, depth=2))' | |
1010 | 8 |
|
1010 | 8 | |
1011 | 7 |
|
1011 | 7 | |
1012 | 6 |
|
1012 | 6 | |
1013 | 5 |
|
1013 | 5 | |
1014 | 4 |
|
1014 | 4 | |
1015 | 2 |
|
1015 | 2 | |
1016 |
|
1016 | |||
1017 | (walk example above by separate queries) |
|
1017 | (walk example above by separate queries) | |
1018 |
|
1018 | |||
1019 | $ log 'reverse(ancestors(8, depth=2)) + reverse(ancestors(7, depth=2))' |
|
1019 | $ log 'reverse(ancestors(8, depth=2)) + reverse(ancestors(7, depth=2))' | |
1020 | 8 |
|
1020 | 8 | |
1021 | 4 |
|
1021 | 4 | |
1022 | 2 |
|
1022 | 2 | |
1023 | 7 |
|
1023 | 7 | |
1024 | 6 |
|
1024 | 6 | |
1025 | 5 |
|
1025 | 5 | |
1026 |
|
1026 | |||
1027 | (walk 2nd and 3rd ancestors) |
|
1027 | (walk 2nd and 3rd ancestors) | |
1028 |
|
1028 | |||
1029 | $ log 'reverse(ancestors(7, depth=3, startdepth=2))' |
|
1029 | $ log 'reverse(ancestors(7, depth=3, startdepth=2))' | |
1030 | 5 |
|
1030 | 5 | |
1031 | 4 |
|
1031 | 4 | |
1032 | 3 |
|
1032 | 3 | |
1033 | 2 |
|
1033 | 2 | |
1034 |
|
1034 | |||
1035 | (interleaved: '4' would be missing if higher-depth ancestors weren't scanned) |
|
1035 | (interleaved: '4' would be missing if higher-depth ancestors weren't scanned) | |
1036 |
|
1036 | |||
1037 | $ log 'reverse(ancestors(7+8, depth=2, startdepth=2))' |
|
1037 | $ log 'reverse(ancestors(7+8, depth=2, startdepth=2))' | |
1038 | 5 |
|
1038 | 5 | |
1039 | 4 |
|
1039 | 4 | |
1040 | 2 |
|
1040 | 2 | |
1041 |
|
1041 | |||
1042 | (note that 'ancestors(x, depth=y, startdepth=z)' does not identical to |
|
1042 | (note that 'ancestors(x, depth=y, startdepth=z)' does not identical to | |
1043 | 'ancestors(x, depth=y) - ancestors(x, depth=z-1)' because a node may have |
|
1043 | 'ancestors(x, depth=y) - ancestors(x, depth=z-1)' because a node may have | |
1044 | multiple depths) |
|
1044 | multiple depths) | |
1045 |
|
1045 | |||
1046 | $ log 'reverse(ancestors(7+8, depth=2) - ancestors(7+8, depth=1))' |
|
1046 | $ log 'reverse(ancestors(7+8, depth=2) - ancestors(7+8, depth=1))' | |
1047 | 5 |
|
1047 | 5 | |
1048 | 2 |
|
1048 | 2 | |
1049 |
|
1049 | |||
1050 | test bad arguments passed to ancestors() |
|
1050 | test bad arguments passed to ancestors() | |
1051 |
|
1051 | |||
1052 | $ log 'ancestors(., depth=-1)' |
|
1052 | $ log 'ancestors(., depth=-1)' | |
1053 | hg: parse error: negative depth |
|
1053 | hg: parse error: negative depth | |
1054 | [255] |
|
1054 | [255] | |
1055 | $ log 'ancestors(., depth=foo)' |
|
1055 | $ log 'ancestors(., depth=foo)' | |
1056 | hg: parse error: ancestors expects an integer depth |
|
1056 | hg: parse error: ancestors expects an integer depth | |
1057 | [255] |
|
1057 | [255] | |
1058 |
|
1058 | |||
1059 | test descendants |
|
1059 | test descendants | |
1060 |
|
1060 | |||
1061 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True |
|
1061 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True | |
1062 | @ 9 |
|
1062 | @ 9 | |
1063 | o 8 |
|
1063 | o 8 | |
1064 | | o 7 |
|
1064 | | o 7 | |
1065 | | o 6 |
|
1065 | | o 6 | |
1066 | |/| |
|
1066 | |/| | |
1067 | | o 5 |
|
1067 | | o 5 | |
1068 | o | 4 |
|
1068 | o | 4 | |
1069 | | o 3 |
|
1069 | | o 3 | |
1070 | o | 2 |
|
1070 | o | 2 | |
1071 | |/ |
|
1071 | |/ | |
1072 | o 1 |
|
1072 | o 1 | |
1073 | o 0 |
|
1073 | o 0 | |
1074 |
|
1074 | |||
1075 | (null is ultimate root and has optimized path) |
|
1075 | (null is ultimate root and has optimized path) | |
1076 |
|
1076 | |||
1077 | $ log 'null:4 & descendants(null)' |
|
1077 | $ log 'null:4 & descendants(null)' | |
1078 | -1 |
|
1078 | -1 | |
1079 | 0 |
|
1079 | 0 | |
1080 | 1 |
|
1080 | 1 | |
1081 | 2 |
|
1081 | 2 | |
1082 | 3 |
|
1082 | 3 | |
1083 | 4 |
|
1083 | 4 | |
1084 |
|
1084 | |||
1085 | (including merge) |
|
1085 | (including merge) | |
1086 |
|
1086 | |||
1087 | $ log ':8 & descendants(2)' |
|
1087 | $ log ':8 & descendants(2)' | |
1088 | 2 |
|
1088 | 2 | |
1089 | 4 |
|
1089 | 4 | |
1090 | 6 |
|
1090 | 6 | |
1091 | 7 |
|
1091 | 7 | |
1092 | 8 |
|
1092 | 8 | |
1093 |
|
1093 | |||
1094 | (multiple roots) |
|
1094 | (multiple roots) | |
1095 |
|
1095 | |||
1096 | $ log ':8 & descendants(2+5)' |
|
1096 | $ log ':8 & descendants(2+5)' | |
1097 | 2 |
|
1097 | 2 | |
1098 | 4 |
|
1098 | 4 | |
1099 | 5 |
|
1099 | 5 | |
1100 | 6 |
|
1100 | 6 | |
1101 | 7 |
|
1101 | 7 | |
1102 | 8 |
|
1102 | 8 | |
1103 |
|
1103 | |||
1104 | test descendants with depth limit |
|
1104 | test descendants with depth limit | |
1105 |
|
1105 | |||
1106 | (depth=0 selects the node itself) |
|
1106 | (depth=0 selects the node itself) | |
1107 |
|
1107 | |||
1108 | $ log 'descendants(0, depth=0)' |
|
1108 | $ log 'descendants(0, depth=0)' | |
1109 | 0 |
|
1109 | 0 | |
1110 | $ log 'null: & descendants(null, depth=0)' |
|
1110 | $ log 'null: & descendants(null, depth=0)' | |
1111 | -1 |
|
1111 | -1 | |
1112 |
|
1112 | |||
1113 | (p2 = null should be ignored) |
|
1113 | (p2 = null should be ignored) | |
1114 |
|
1114 | |||
1115 | $ log 'null: & descendants(null, depth=2)' |
|
1115 | $ log 'null: & descendants(null, depth=2)' | |
1116 | -1 |
|
1116 | -1 | |
1117 | 0 |
|
1117 | 0 | |
1118 | 1 |
|
1118 | 1 | |
1119 |
|
1119 | |||
1120 | (multiple paths: depth(6) = (2, 3)) |
|
1120 | (multiple paths: depth(6) = (2, 3)) | |
1121 |
|
1121 | |||
1122 | $ log 'descendants(1+3, depth=2)' |
|
1122 | $ log 'descendants(1+3, depth=2)' | |
1123 | 1 |
|
1123 | 1 | |
1124 | 2 |
|
1124 | 2 | |
1125 | 3 |
|
1125 | 3 | |
1126 | 4 |
|
1126 | 4 | |
1127 | 5 |
|
1127 | 5 | |
1128 | 6 |
|
1128 | 6 | |
1129 |
|
1129 | |||
1130 | (multiple paths: depth(5) = (1, 2), depth(6) = (2, 3)) |
|
1130 | (multiple paths: depth(5) = (1, 2), depth(6) = (2, 3)) | |
1131 |
|
1131 | |||
1132 | $ log 'descendants(3+1, depth=2, startdepth=2)' |
|
1132 | $ log 'descendants(3+1, depth=2, startdepth=2)' | |
1133 | 4 |
|
1133 | 4 | |
1134 | 5 |
|
1134 | 5 | |
1135 | 6 |
|
1135 | 6 | |
1136 |
|
1136 | |||
1137 | (multiple depths: depth(6) = (0, 2, 4), search for depth=2) |
|
1137 | (multiple depths: depth(6) = (0, 2, 4), search for depth=2) | |
1138 |
|
1138 | |||
1139 | $ log 'descendants(0+3+6, depth=3, startdepth=1)' |
|
1139 | $ log 'descendants(0+3+6, depth=3, startdepth=1)' | |
1140 | 1 |
|
1140 | 1 | |
1141 | 2 |
|
1141 | 2 | |
1142 | 3 |
|
1142 | 3 | |
1143 | 4 |
|
1143 | 4 | |
1144 | 5 |
|
1144 | 5 | |
1145 | 6 |
|
1145 | 6 | |
1146 | 7 |
|
1146 | 7 | |
1147 |
|
1147 | |||
1148 | (multiple depths: depth(6) = (0, 4), no match) |
|
1148 | (multiple depths: depth(6) = (0, 4), no match) | |
1149 |
|
1149 | |||
1150 | $ log 'descendants(0+6, depth=3, startdepth=1)' |
|
1150 | $ log 'descendants(0+6, depth=3, startdepth=1)' | |
1151 | 1 |
|
1151 | 1 | |
1152 | 2 |
|
1152 | 2 | |
1153 | 3 |
|
1153 | 3 | |
1154 | 4 |
|
1154 | 4 | |
1155 | 5 |
|
1155 | 5 | |
1156 | 7 |
|
1156 | 7 | |
1157 |
|
1157 | |||
1158 | test ancestors/descendants relation subscript: |
|
1158 | test ancestors/descendants relation subscript: | |
1159 |
|
1159 | |||
1160 | $ log 'tip#generations[0]' |
|
1160 | $ log 'tip#generations[0]' | |
1161 | 9 |
|
1161 | 9 | |
1162 | $ log '.#generations[-1]' |
|
1162 | $ log '.#generations[-1]' | |
1163 | 8 |
|
1163 | 8 | |
1164 | $ log '.#g[(-1)]' |
|
1164 | $ log '.#g[(-1)]' | |
1165 | 8 |
|
1165 | 8 | |
1166 |
|
1166 | |||
1167 | $ hg debugrevspec -p parsed 'roots(:)#g[2]' |
|
1167 | $ hg debugrevspec -p parsed 'roots(:)#g[2]' | |
1168 | * parsed: |
|
1168 | * parsed: | |
1169 | (relsubscript |
|
1169 | (relsubscript | |
1170 | (func |
|
1170 | (func | |
1171 | (symbol 'roots') |
|
1171 | (symbol 'roots') | |
1172 | (rangeall |
|
1172 | (rangeall | |
1173 | None)) |
|
1173 | None)) | |
1174 | (symbol 'g') |
|
1174 | (symbol 'g') | |
1175 | (symbol '2')) |
|
1175 | (symbol '2')) | |
1176 | 2 |
|
1176 | 2 | |
1177 | 3 |
|
1177 | 3 | |
1178 |
|
1178 | |||
1179 | test author |
|
1179 | test author | |
1180 |
|
1180 | |||
1181 | $ log 'author(bob)' |
|
1181 | $ log 'author(bob)' | |
1182 | 2 |
|
1182 | 2 | |
1183 | $ log 'author("re:bob|test")' |
|
1183 | $ log 'author("re:bob|test")' | |
1184 | 0 |
|
1184 | 0 | |
1185 | 1 |
|
1185 | 1 | |
1186 | 2 |
|
1186 | 2 | |
1187 | 3 |
|
1187 | 3 | |
1188 | 4 |
|
1188 | 4 | |
1189 | 5 |
|
1189 | 5 | |
1190 | 6 |
|
1190 | 6 | |
1191 | 7 |
|
1191 | 7 | |
1192 | 8 |
|
1192 | 8 | |
1193 | 9 |
|
1193 | 9 | |
1194 | $ log 'author(r"re:\S")' |
|
1194 | $ log 'author(r"re:\S")' | |
1195 | 0 |
|
1195 | 0 | |
1196 | 1 |
|
1196 | 1 | |
1197 | 2 |
|
1197 | 2 | |
1198 | 3 |
|
1198 | 3 | |
1199 | 4 |
|
1199 | 4 | |
1200 | 5 |
|
1200 | 5 | |
1201 | 6 |
|
1201 | 6 | |
1202 | 7 |
|
1202 | 7 | |
1203 | 8 |
|
1203 | 8 | |
1204 | 9 |
|
1204 | 9 | |
1205 | $ log 'branch(Γ©)' |
|
1205 | $ log 'branch(Γ©)' | |
1206 | 8 |
|
1206 | 8 | |
1207 | 9 |
|
1207 | 9 | |
1208 | $ log 'branch(a)' |
|
1208 | $ log 'branch(a)' | |
1209 | 0 |
|
1209 | 0 | |
1210 | $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n' |
|
1210 | $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n' | |
1211 | 0 a |
|
1211 | 0 a | |
1212 | 2 a-b-c- |
|
1212 | 2 a-b-c- | |
1213 | 3 +a+b+c+ |
|
1213 | 3 +a+b+c+ | |
1214 | 4 -a-b-c- |
|
1214 | 4 -a-b-c- | |
1215 | 5 !a/b/c/ |
|
1215 | 5 !a/b/c/ | |
1216 | 6 _a_b_c_ |
|
1216 | 6 _a_b_c_ | |
1217 | 7 .a.b.c. |
|
1217 | 7 .a.b.c. | |
1218 | $ log 'children(ancestor(4,5))' |
|
1218 | $ log 'children(ancestor(4,5))' | |
1219 | 2 |
|
1219 | 2 | |
1220 | 3 |
|
1220 | 3 | |
1221 |
|
1221 | |||
1222 | $ log 'children(4)' |
|
1222 | $ log 'children(4)' | |
1223 | 6 |
|
1223 | 6 | |
1224 | 8 |
|
1224 | 8 | |
1225 | $ log 'children(null)' |
|
1225 | $ log 'children(null)' | |
1226 | 0 |
|
1226 | 0 | |
1227 |
|
1227 | |||
1228 | $ log 'closed()' |
|
1228 | $ log 'closed()' | |
1229 | $ log 'contains(a)' |
|
1229 | $ log 'contains(a)' | |
1230 | 0 |
|
1230 | 0 | |
1231 | 1 |
|
1231 | 1 | |
1232 | 3 |
|
1232 | 3 | |
1233 | 5 |
|
1233 | 5 | |
1234 | $ log 'contains("../repo/a")' |
|
1234 | $ log 'contains("../repo/a")' | |
1235 | 0 |
|
1235 | 0 | |
1236 | 1 |
|
1236 | 1 | |
1237 | 3 |
|
1237 | 3 | |
1238 | 5 |
|
1238 | 5 | |
1239 | $ log 'desc(B)' |
|
1239 | $ log 'desc(B)' | |
1240 | 5 |
|
1240 | 5 | |
1241 | $ hg log -r 'desc(r"re:S?u")' --template "{rev} {desc|firstline}\n" |
|
1241 | $ hg log -r 'desc(r"re:S?u")' --template "{rev} {desc|firstline}\n" | |
1242 | 5 5 bug |
|
1242 | 5 5 bug | |
1243 | 6 6 issue619 |
|
1243 | 6 6 issue619 | |
1244 | $ log 'descendants(2 or 3)' |
|
1244 | $ log 'descendants(2 or 3)' | |
1245 | 2 |
|
1245 | 2 | |
1246 | 3 |
|
1246 | 3 | |
1247 | 4 |
|
1247 | 4 | |
1248 | 5 |
|
1248 | 5 | |
1249 | 6 |
|
1249 | 6 | |
1250 | 7 |
|
1250 | 7 | |
1251 | 8 |
|
1251 | 8 | |
1252 | 9 |
|
1252 | 9 | |
1253 | $ log 'file("b*")' |
|
1253 | $ log 'file("b*")' | |
1254 | 1 |
|
1254 | 1 | |
1255 | 4 |
|
1255 | 4 | |
1256 | $ log 'filelog("b")' |
|
1256 | $ log 'filelog("b")' | |
1257 | 1 |
|
1257 | 1 | |
1258 | 4 |
|
1258 | 4 | |
1259 | $ log 'filelog("../repo/b")' |
|
1259 | $ log 'filelog("../repo/b")' | |
1260 | 1 |
|
1260 | 1 | |
1261 | 4 |
|
1261 | 4 | |
1262 | $ log 'follow()' |
|
1262 | $ log 'follow()' | |
1263 | 0 |
|
1263 | 0 | |
1264 | 1 |
|
1264 | 1 | |
1265 | 2 |
|
1265 | 2 | |
1266 | 4 |
|
1266 | 4 | |
1267 | 8 |
|
1267 | 8 | |
1268 | 9 |
|
1268 | 9 | |
1269 | $ log 'grep("issue\d+")' |
|
1269 | $ log 'grep("issue\d+")' | |
1270 | 6 |
|
1270 | 6 | |
1271 | $ try 'grep("(")' # invalid regular expression |
|
1271 | $ try 'grep("(")' # invalid regular expression | |
1272 | (func |
|
1272 | (func | |
1273 | (symbol 'grep') |
|
1273 | (symbol 'grep') | |
1274 | (string '(')) |
|
1274 | (string '(')) | |
1275 | hg: parse error: invalid match pattern: unbalanced parenthesis |
|
1275 | hg: parse error: invalid match pattern: unbalanced parenthesis | |
1276 | [255] |
|
1276 | [255] | |
1277 | $ try 'grep("\bissue\d+")' |
|
1277 | $ try 'grep("\bissue\d+")' | |
1278 | (func |
|
1278 | (func | |
1279 | (symbol 'grep') |
|
1279 | (symbol 'grep') | |
1280 | (string '\x08issue\\d+')) |
|
1280 | (string '\x08issue\\d+')) | |
1281 | * set: |
|
1281 | * set: | |
1282 | <filteredset |
|
1282 | <filteredset | |
1283 | <fullreposet+ 0:10>, |
|
1283 | <fullreposet+ 0:10>, | |
1284 | <grep '\x08issue\\d+'>> |
|
1284 | <grep '\x08issue\\d+'>> | |
1285 | $ try 'grep(r"\bissue\d+")' |
|
1285 | $ try 'grep(r"\bissue\d+")' | |
1286 | (func |
|
1286 | (func | |
1287 | (symbol 'grep') |
|
1287 | (symbol 'grep') | |
1288 | (string '\\bissue\\d+')) |
|
1288 | (string '\\bissue\\d+')) | |
1289 | * set: |
|
1289 | * set: | |
1290 | <filteredset |
|
1290 | <filteredset | |
1291 | <fullreposet+ 0:10>, |
|
1291 | <fullreposet+ 0:10>, | |
1292 | <grep '\\bissue\\d+'>> |
|
1292 | <grep '\\bissue\\d+'>> | |
1293 | 6 |
|
1293 | 6 | |
1294 | $ try 'grep(r"\")' |
|
1294 | $ try 'grep(r"\")' | |
1295 | hg: parse error at 7: unterminated string |
|
1295 | hg: parse error at 7: unterminated string | |
1296 | [255] |
|
1296 | [255] | |
1297 | $ log 'head()' |
|
1297 | $ log 'head()' | |
1298 | 0 |
|
1298 | 0 | |
1299 | 1 |
|
1299 | 1 | |
1300 | 2 |
|
1300 | 2 | |
1301 | 3 |
|
1301 | 3 | |
1302 | 4 |
|
1302 | 4 | |
1303 | 5 |
|
1303 | 5 | |
1304 | 6 |
|
1304 | 6 | |
1305 | 7 |
|
1305 | 7 | |
1306 | 9 |
|
1306 | 9 | |
1307 | $ log 'heads(6::)' |
|
1307 | $ log 'heads(6::)' | |
1308 | 7 |
|
1308 | 7 | |
1309 | $ log 'keyword(issue)' |
|
1309 | $ log 'keyword(issue)' | |
1310 | 6 |
|
1310 | 6 | |
1311 | $ log 'keyword("test a")' |
|
1311 | $ log 'keyword("test a")' | |
1312 |
|
1312 | |||
1313 | Test first (=limit) and last |
|
1313 | Test first (=limit) and last | |
1314 |
|
1314 | |||
1315 | $ log 'limit(head(), 1)' |
|
1315 | $ log 'limit(head(), 1)' | |
1316 | 0 |
|
1316 | 0 | |
1317 | $ log 'limit(author("re:bob|test"), 3, 5)' |
|
1317 | $ log 'limit(author("re:bob|test"), 3, 5)' | |
1318 | 5 |
|
1318 | 5 | |
1319 | 6 |
|
1319 | 6 | |
1320 | 7 |
|
1320 | 7 | |
1321 | $ log 'limit(author("re:bob|test"), offset=6)' |
|
1321 | $ log 'limit(author("re:bob|test"), offset=6)' | |
1322 | 6 |
|
1322 | 6 | |
1323 | $ log 'limit(author("re:bob|test"), offset=10)' |
|
1323 | $ log 'limit(author("re:bob|test"), offset=10)' | |
1324 | $ log 'limit(all(), 1, -1)' |
|
1324 | $ log 'limit(all(), 1, -1)' | |
1325 | hg: parse error: negative offset |
|
1325 | hg: parse error: negative offset | |
1326 | [255] |
|
1326 | [255] | |
1327 | $ log 'limit(all(), -1)' |
|
1327 | $ log 'limit(all(), -1)' | |
1328 | hg: parse error: negative number to select |
|
1328 | hg: parse error: negative number to select | |
1329 | [255] |
|
1329 | [255] | |
1330 | $ log 'limit(all(), 0)' |
|
1330 | $ log 'limit(all(), 0)' | |
1331 |
|
1331 | |||
1332 | $ log 'last(all(), -1)' |
|
1332 | $ log 'last(all(), -1)' | |
1333 | hg: parse error: negative number to select |
|
1333 | hg: parse error: negative number to select | |
1334 | [255] |
|
1334 | [255] | |
1335 | $ log 'last(all(), 0)' |
|
1335 | $ log 'last(all(), 0)' | |
1336 | $ log 'last(all(), 1)' |
|
1336 | $ log 'last(all(), 1)' | |
1337 | 9 |
|
1337 | 9 | |
1338 | $ log 'last(all(), 2)' |
|
1338 | $ log 'last(all(), 2)' | |
1339 | 8 |
|
1339 | 8 | |
1340 | 9 |
|
1340 | 9 | |
1341 |
|
1341 | |||
1342 | Test smartset.slice() by first/last() |
|
1342 | Test smartset.slice() by first/last() | |
1343 |
|
1343 | |||
1344 | (using unoptimized set, filteredset as example) |
|
1344 | (using unoptimized set, filteredset as example) | |
1345 |
|
1345 | |||
1346 | $ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")' |
|
1346 | $ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")' | |
1347 | * set: |
|
1347 | * set: | |
1348 | <filteredset |
|
1348 | <filteredset | |
1349 | <spanset+ 0:8>, |
|
1349 | <spanset+ 0:8>, | |
1350 | <branch 're:'>> |
|
1350 | <branch 're:'>> | |
1351 | $ log 'limit(0:7 & branch("re:"), 3, 4)' |
|
1351 | $ log 'limit(0:7 & branch("re:"), 3, 4)' | |
1352 | 4 |
|
1352 | 4 | |
1353 | 5 |
|
1353 | 5 | |
1354 | 6 |
|
1354 | 6 | |
1355 | $ log 'limit(7:0 & branch("re:"), 3, 4)' |
|
1355 | $ log 'limit(7:0 & branch("re:"), 3, 4)' | |
1356 | 3 |
|
1356 | 3 | |
1357 | 2 |
|
1357 | 2 | |
1358 | 1 |
|
1358 | 1 | |
1359 | $ log 'last(0:7 & branch("re:"), 2)' |
|
1359 | $ log 'last(0:7 & branch("re:"), 2)' | |
1360 | 6 |
|
1360 | 6 | |
1361 | 7 |
|
1361 | 7 | |
1362 |
|
1362 | |||
1363 | (using baseset) |
|
1363 | (using baseset) | |
1364 |
|
1364 | |||
1365 | $ hg debugrevspec --no-show-revs -s 0+1+2+3+4+5+6+7 |
|
1365 | $ hg debugrevspec --no-show-revs -s 0+1+2+3+4+5+6+7 | |
1366 | * set: |
|
1366 | * set: | |
1367 | <baseset [0, 1, 2, 3, 4, 5, 6, 7]> |
|
1367 | <baseset [0, 1, 2, 3, 4, 5, 6, 7]> | |
1368 | $ hg debugrevspec --no-show-revs -s 0::7 |
|
1368 | $ hg debugrevspec --no-show-revs -s 0::7 | |
1369 | * set: |
|
1369 | * set: | |
1370 | <baseset+ [0, 1, 2, 3, 4, 5, 6, 7]> |
|
1370 | <baseset+ [0, 1, 2, 3, 4, 5, 6, 7]> | |
1371 | $ log 'limit(0+1+2+3+4+5+6+7, 3, 4)' |
|
1371 | $ log 'limit(0+1+2+3+4+5+6+7, 3, 4)' | |
1372 | 4 |
|
1372 | 4 | |
1373 | 5 |
|
1373 | 5 | |
1374 | 6 |
|
1374 | 6 | |
1375 | $ log 'limit(sort(0::7, rev), 3, 4)' |
|
1375 | $ log 'limit(sort(0::7, rev), 3, 4)' | |
1376 | 4 |
|
1376 | 4 | |
1377 | 5 |
|
1377 | 5 | |
1378 | 6 |
|
1378 | 6 | |
1379 | $ log 'limit(sort(0::7, -rev), 3, 4)' |
|
1379 | $ log 'limit(sort(0::7, -rev), 3, 4)' | |
1380 | 3 |
|
1380 | 3 | |
1381 | 2 |
|
1381 | 2 | |
1382 | 1 |
|
1382 | 1 | |
1383 | $ log 'last(sort(0::7, rev), 2)' |
|
1383 | $ log 'last(sort(0::7, rev), 2)' | |
1384 | 6 |
|
1384 | 6 | |
1385 | 7 |
|
1385 | 7 | |
1386 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 6)' |
|
1386 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 6)' | |
1387 | * set: |
|
1387 | * set: | |
1388 | <baseset+ [6, 7]> |
|
1388 | <baseset+ [6, 7]> | |
1389 | 6 |
|
1389 | 6 | |
1390 | 7 |
|
1390 | 7 | |
1391 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 9)' |
|
1391 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 9)' | |
1392 | * set: |
|
1392 | * set: | |
1393 | <baseset+ []> |
|
1393 | <baseset+ []> | |
1394 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 6)' |
|
1394 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 6)' | |
1395 | * set: |
|
1395 | * set: | |
1396 | <baseset- [0, 1]> |
|
1396 | <baseset- [0, 1]> | |
1397 | 1 |
|
1397 | 1 | |
1398 | 0 |
|
1398 | 0 | |
1399 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 9)' |
|
1399 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 9)' | |
1400 | * set: |
|
1400 | * set: | |
1401 | <baseset- []> |
|
1401 | <baseset- []> | |
1402 | $ hg debugrevspec -s 'limit(0::7, 0)' |
|
1402 | $ hg debugrevspec -s 'limit(0::7, 0)' | |
1403 | * set: |
|
1403 | * set: | |
1404 | <baseset+ []> |
|
1404 | <baseset+ []> | |
1405 |
|
1405 | |||
1406 | (using spanset) |
|
1406 | (using spanset) | |
1407 |
|
1407 | |||
1408 | $ hg debugrevspec --no-show-revs -s 0:7 |
|
1408 | $ hg debugrevspec --no-show-revs -s 0:7 | |
1409 | * set: |
|
1409 | * set: | |
1410 | <spanset+ 0:8> |
|
1410 | <spanset+ 0:8> | |
1411 | $ log 'limit(0:7, 3, 4)' |
|
1411 | $ log 'limit(0:7, 3, 4)' | |
1412 | 4 |
|
1412 | 4 | |
1413 | 5 |
|
1413 | 5 | |
1414 | 6 |
|
1414 | 6 | |
1415 | $ log 'limit(7:0, 3, 4)' |
|
1415 | $ log 'limit(7:0, 3, 4)' | |
1416 | 3 |
|
1416 | 3 | |
1417 | 2 |
|
1417 | 2 | |
1418 | 1 |
|
1418 | 1 | |
1419 | $ log 'limit(0:7, 3, 6)' |
|
1419 | $ log 'limit(0:7, 3, 6)' | |
1420 | 6 |
|
1420 | 6 | |
1421 | 7 |
|
1421 | 7 | |
1422 | $ log 'limit(7:0, 3, 6)' |
|
1422 | $ log 'limit(7:0, 3, 6)' | |
1423 | 1 |
|
1423 | 1 | |
1424 | 0 |
|
1424 | 0 | |
1425 | $ log 'last(0:7, 2)' |
|
1425 | $ log 'last(0:7, 2)' | |
1426 | 6 |
|
1426 | 6 | |
1427 | 7 |
|
1427 | 7 | |
1428 | $ hg debugrevspec -s 'limit(0:7, 3, 6)' |
|
1428 | $ hg debugrevspec -s 'limit(0:7, 3, 6)' | |
1429 | * set: |
|
1429 | * set: | |
1430 | <spanset+ 6:8> |
|
1430 | <spanset+ 6:8> | |
1431 | 6 |
|
1431 | 6 | |
1432 | 7 |
|
1432 | 7 | |
1433 | $ hg debugrevspec -s 'limit(0:7, 3, 9)' |
|
1433 | $ hg debugrevspec -s 'limit(0:7, 3, 9)' | |
1434 | * set: |
|
1434 | * set: | |
1435 | <spanset+ 8:8> |
|
1435 | <spanset+ 8:8> | |
1436 | $ hg debugrevspec -s 'limit(7:0, 3, 6)' |
|
1436 | $ hg debugrevspec -s 'limit(7:0, 3, 6)' | |
1437 | * set: |
|
1437 | * set: | |
1438 | <spanset- 0:2> |
|
1438 | <spanset- 0:2> | |
1439 | 1 |
|
1439 | 1 | |
1440 | 0 |
|
1440 | 0 | |
1441 | $ hg debugrevspec -s 'limit(7:0, 3, 9)' |
|
1441 | $ hg debugrevspec -s 'limit(7:0, 3, 9)' | |
1442 | * set: |
|
1442 | * set: | |
1443 | <spanset- 0:0> |
|
1443 | <spanset- 0:0> | |
1444 | $ hg debugrevspec -s 'limit(0:7, 0)' |
|
1444 | $ hg debugrevspec -s 'limit(0:7, 0)' | |
1445 | * set: |
|
1445 | * set: | |
1446 | <spanset+ 0:0> |
|
1446 | <spanset+ 0:0> | |
1447 |
|
1447 | |||
1448 | Test order of first/last revisions |
|
1448 | Test order of first/last revisions | |
1449 |
|
1449 | |||
1450 | $ hg debugrevspec -s 'first(4:0, 3) & 3:' |
|
1450 | $ hg debugrevspec -s 'first(4:0, 3) & 3:' | |
1451 | * set: |
|
1451 | * set: | |
1452 | <filteredset |
|
1452 | <filteredset | |
1453 | <spanset- 2:5>, |
|
1453 | <spanset- 2:5>, | |
1454 | <spanset+ 3:10>> |
|
1454 | <spanset+ 3:10>> | |
1455 | 4 |
|
1455 | 4 | |
1456 | 3 |
|
1456 | 3 | |
1457 |
|
1457 | |||
1458 | $ hg debugrevspec -s '3: & first(4:0, 3)' |
|
1458 | $ hg debugrevspec -s '3: & first(4:0, 3)' | |
1459 | * set: |
|
1459 | * set: | |
1460 | <filteredset |
|
1460 | <filteredset | |
1461 | <spanset+ 3:10>, |
|
1461 | <spanset+ 3:10>, | |
1462 | <spanset- 2:5>> |
|
1462 | <spanset- 2:5>> | |
1463 | 3 |
|
1463 | 3 | |
1464 | 4 |
|
1464 | 4 | |
1465 |
|
1465 | |||
1466 | $ hg debugrevspec -s 'last(4:0, 3) & :1' |
|
1466 | $ hg debugrevspec -s 'last(4:0, 3) & :1' | |
1467 | * set: |
|
1467 | * set: | |
1468 | <filteredset |
|
1468 | <filteredset | |
1469 | <spanset- 0:3>, |
|
1469 | <spanset- 0:3>, | |
1470 | <spanset+ 0:2>> |
|
1470 | <spanset+ 0:2>> | |
1471 | 1 |
|
1471 | 1 | |
1472 | 0 |
|
1472 | 0 | |
1473 |
|
1473 | |||
1474 | $ hg debugrevspec -s ':1 & last(4:0, 3)' |
|
1474 | $ hg debugrevspec -s ':1 & last(4:0, 3)' | |
1475 | * set: |
|
1475 | * set: | |
1476 | <filteredset |
|
1476 | <filteredset | |
1477 | <spanset+ 0:2>, |
|
1477 | <spanset+ 0:2>, | |
1478 | <spanset+ 0:3>> |
|
1478 | <spanset+ 0:3>> | |
1479 | 0 |
|
1479 | 0 | |
1480 | 1 |
|
1480 | 1 | |
1481 |
|
1481 | |||
1482 | Test scmutil.revsingle() should return the last revision |
|
1482 | Test scmutil.revsingle() should return the last revision | |
1483 |
|
1483 | |||
1484 | $ hg debugrevspec -s 'last(0::)' |
|
1484 | $ hg debugrevspec -s 'last(0::)' | |
1485 | * set: |
|
1485 | * set: | |
1486 | <baseset slice=0:1 |
|
1486 | <baseset slice=0:1 | |
1487 | <generatorset->> |
|
1487 | <generatorset->> | |
1488 | 9 |
|
1488 | 9 | |
1489 | $ hg identify -r '0::' --num |
|
1489 | $ hg identify -r '0::' --num | |
1490 | 9 |
|
1490 | 9 | |
1491 |
|
1491 | |||
1492 | Test matching |
|
1492 | Test matching | |
1493 |
|
1493 | |||
1494 | $ log 'matching(6)' |
|
1494 | $ log 'matching(6)' | |
1495 | 6 |
|
1495 | 6 | |
1496 | $ log 'matching(6:7, "phase parents user date branch summary files description substate")' |
|
1496 | $ log 'matching(6:7, "phase parents user date branch summary files description substate")' | |
1497 | 6 |
|
1497 | 6 | |
1498 | 7 |
|
1498 | 7 | |
1499 |
|
1499 | |||
1500 | Testing min and max |
|
1500 | Testing min and max | |
1501 |
|
1501 | |||
1502 | max: simple |
|
1502 | max: simple | |
1503 |
|
1503 | |||
1504 | $ log 'max(contains(a))' |
|
1504 | $ log 'max(contains(a))' | |
1505 | 5 |
|
1505 | 5 | |
1506 |
|
1506 | |||
1507 | max: simple on unordered set) |
|
1507 | max: simple on unordered set) | |
1508 |
|
1508 | |||
1509 | $ log 'max((4+0+2+5+7) and contains(a))' |
|
1509 | $ log 'max((4+0+2+5+7) and contains(a))' | |
1510 | 5 |
|
1510 | 5 | |
1511 |
|
1511 | |||
1512 | max: no result |
|
1512 | max: no result | |
1513 |
|
1513 | |||
1514 | $ log 'max(contains(stringthatdoesnotappearanywhere))' |
|
1514 | $ log 'max(contains(stringthatdoesnotappearanywhere))' | |
1515 |
|
1515 | |||
1516 | max: no result on unordered set |
|
1516 | max: no result on unordered set | |
1517 |
|
1517 | |||
1518 | $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
1518 | $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' | |
1519 |
|
1519 | |||
1520 | min: simple |
|
1520 | min: simple | |
1521 |
|
1521 | |||
1522 | $ log 'min(contains(a))' |
|
1522 | $ log 'min(contains(a))' | |
1523 | 0 |
|
1523 | 0 | |
1524 |
|
1524 | |||
1525 | min: simple on unordered set |
|
1525 | min: simple on unordered set | |
1526 |
|
1526 | |||
1527 | $ log 'min((4+0+2+5+7) and contains(a))' |
|
1527 | $ log 'min((4+0+2+5+7) and contains(a))' | |
1528 | 0 |
|
1528 | 0 | |
1529 |
|
1529 | |||
1530 | min: empty |
|
1530 | min: empty | |
1531 |
|
1531 | |||
1532 | $ log 'min(contains(stringthatdoesnotappearanywhere))' |
|
1532 | $ log 'min(contains(stringthatdoesnotappearanywhere))' | |
1533 |
|
1533 | |||
1534 | min: empty on unordered set |
|
1534 | min: empty on unordered set | |
1535 |
|
1535 | |||
1536 | $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
1536 | $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' | |
1537 |
|
1537 | |||
1538 |
|
1538 | |||
1539 | $ log 'merge()' |
|
1539 | $ log 'merge()' | |
1540 | 6 |
|
1540 | 6 | |
1541 | $ log 'branchpoint()' |
|
1541 | $ log 'branchpoint()' | |
1542 | 1 |
|
1542 | 1 | |
1543 | 4 |
|
1543 | 4 | |
1544 | $ log 'modifies(b)' |
|
1544 | $ log 'modifies(b)' | |
1545 | 4 |
|
1545 | 4 | |
1546 | $ log 'modifies("path:b")' |
|
1546 | $ log 'modifies("path:b")' | |
1547 | 4 |
|
1547 | 4 | |
1548 | $ log 'modifies("*")' |
|
1548 | $ log 'modifies("*")' | |
1549 | 4 |
|
1549 | 4 | |
1550 | 6 |
|
1550 | 6 | |
1551 | $ log 'modifies("set:modified()")' |
|
1551 | $ log 'modifies("set:modified()")' | |
1552 | 4 |
|
1552 | 4 | |
1553 | $ log 'id(5)' |
|
1553 | $ log 'id(5)' | |
1554 | 2 |
|
1554 | 2 | |
1555 | $ log 'only(9)' |
|
1555 | $ log 'only(9)' | |
1556 | 8 |
|
1556 | 8 | |
1557 | 9 |
|
1557 | 9 | |
1558 | $ log 'only(8)' |
|
1558 | $ log 'only(8)' | |
1559 | 8 |
|
1559 | 8 | |
1560 | $ log 'only(9, 5)' |
|
1560 | $ log 'only(9, 5)' | |
1561 | 2 |
|
1561 | 2 | |
1562 | 4 |
|
1562 | 4 | |
1563 | 8 |
|
1563 | 8 | |
1564 | 9 |
|
1564 | 9 | |
1565 | $ log 'only(7 + 9, 5 + 2)' |
|
1565 | $ log 'only(7 + 9, 5 + 2)' | |
1566 | 4 |
|
1566 | 4 | |
1567 | 6 |
|
1567 | 6 | |
1568 | 7 |
|
1568 | 7 | |
1569 | 8 |
|
1569 | 8 | |
1570 | 9 |
|
1570 | 9 | |
1571 |
|
1571 | |||
1572 | Test empty set input |
|
1572 | Test empty set input | |
1573 | $ log 'only(p2())' |
|
1573 | $ log 'only(p2())' | |
1574 | $ log 'only(p1(), p2())' |
|
1574 | $ log 'only(p1(), p2())' | |
1575 | 0 |
|
1575 | 0 | |
1576 | 1 |
|
1576 | 1 | |
1577 | 2 |
|
1577 | 2 | |
1578 | 4 |
|
1578 | 4 | |
1579 | 8 |
|
1579 | 8 | |
1580 | 9 |
|
1580 | 9 | |
1581 |
|
1581 | |||
1582 | Test '%' operator |
|
1582 | Test '%' operator | |
1583 |
|
1583 | |||
1584 | $ log '9%' |
|
1584 | $ log '9%' | |
1585 | 8 |
|
1585 | 8 | |
1586 | 9 |
|
1586 | 9 | |
1587 | $ log '9%5' |
|
1587 | $ log '9%5' | |
1588 | 2 |
|
1588 | 2 | |
1589 | 4 |
|
1589 | 4 | |
1590 | 8 |
|
1590 | 8 | |
1591 | 9 |
|
1591 | 9 | |
1592 | $ log '(7 + 9)%(5 + 2)' |
|
1592 | $ log '(7 + 9)%(5 + 2)' | |
1593 | 4 |
|
1593 | 4 | |
1594 | 6 |
|
1594 | 6 | |
1595 | 7 |
|
1595 | 7 | |
1596 | 8 |
|
1596 | 8 | |
1597 | 9 |
|
1597 | 9 | |
1598 |
|
1598 | |||
1599 | Test operand of '%' is optimized recursively (issue4670) |
|
1599 | Test operand of '%' is optimized recursively (issue4670) | |
1600 |
|
1600 | |||
1601 | $ try --optimize '8:9-8%' |
|
1601 | $ try --optimize '8:9-8%' | |
1602 | (onlypost |
|
1602 | (onlypost | |
1603 | (minus |
|
1603 | (minus | |
1604 | (range |
|
1604 | (range | |
1605 | (symbol '8') |
|
1605 | (symbol '8') | |
1606 | (symbol '9')) |
|
1606 | (symbol '9')) | |
1607 | (symbol '8'))) |
|
1607 | (symbol '8'))) | |
1608 | * optimized: |
|
1608 | * optimized: | |
1609 | (func |
|
1609 | (func | |
1610 | (symbol 'only') |
|
1610 | (symbol 'only') | |
1611 | (difference |
|
1611 | (difference | |
1612 | (range |
|
1612 | (range | |
1613 | (symbol '8') |
|
1613 | (symbol '8') | |
1614 | (symbol '9')) |
|
1614 | (symbol '9')) | |
1615 | (symbol '8'))) |
|
1615 | (symbol '8'))) | |
1616 | * set: |
|
1616 | * set: | |
1617 | <baseset+ [8, 9]> |
|
1617 | <baseset+ [8, 9]> | |
1618 | 8 |
|
1618 | 8 | |
1619 | 9 |
|
1619 | 9 | |
1620 | $ try --optimize '(9)%(5)' |
|
1620 | $ try --optimize '(9)%(5)' | |
1621 | (only |
|
1621 | (only | |
1622 | (group |
|
1622 | (group | |
1623 | (symbol '9')) |
|
1623 | (symbol '9')) | |
1624 | (group |
|
1624 | (group | |
1625 | (symbol '5'))) |
|
1625 | (symbol '5'))) | |
1626 | * optimized: |
|
1626 | * optimized: | |
1627 | (func |
|
1627 | (func | |
1628 | (symbol 'only') |
|
1628 | (symbol 'only') | |
1629 | (list |
|
1629 | (list | |
1630 | (symbol '9') |
|
1630 | (symbol '9') | |
1631 | (symbol '5'))) |
|
1631 | (symbol '5'))) | |
1632 | * set: |
|
1632 | * set: | |
1633 | <baseset+ [2, 4, 8, 9]> |
|
1633 | <baseset+ [2, 4, 8, 9]> | |
1634 | 2 |
|
1634 | 2 | |
1635 | 4 |
|
1635 | 4 | |
1636 | 8 |
|
1636 | 8 | |
1637 | 9 |
|
1637 | 9 | |
1638 |
|
1638 | |||
1639 | Test the order of operations |
|
1639 | Test the order of operations | |
1640 |
|
1640 | |||
1641 | $ log '7 + 9%5 + 2' |
|
1641 | $ log '7 + 9%5 + 2' | |
1642 | 7 |
|
1642 | 7 | |
1643 | 2 |
|
1643 | 2 | |
1644 | 4 |
|
1644 | 4 | |
1645 | 8 |
|
1645 | 8 | |
1646 | 9 |
|
1646 | 9 | |
1647 |
|
1647 | |||
1648 | Test explicit numeric revision |
|
1648 | Test explicit numeric revision | |
1649 | $ log 'rev(-2)' |
|
1649 | $ log 'rev(-2)' | |
1650 | $ log 'rev(-1)' |
|
1650 | $ log 'rev(-1)' | |
1651 | -1 |
|
1651 | -1 | |
1652 | $ log 'rev(0)' |
|
1652 | $ log 'rev(0)' | |
1653 | 0 |
|
1653 | 0 | |
1654 | $ log 'rev(9)' |
|
1654 | $ log 'rev(9)' | |
1655 | 9 |
|
1655 | 9 | |
1656 | $ log 'rev(10)' |
|
1656 | $ log 'rev(10)' | |
1657 | $ log 'rev(tip)' |
|
1657 | $ log 'rev(tip)' | |
1658 | hg: parse error: rev expects a number |
|
1658 | hg: parse error: rev expects a number | |
1659 | [255] |
|
1659 | [255] | |
1660 |
|
1660 | |||
1661 | Test hexadecimal revision |
|
1661 | Test hexadecimal revision | |
1662 | $ log 'id(2)' |
|
1662 | $ log 'id(2)' | |
1663 | abort: 00changelog.i@2: ambiguous identifier! |
|
1663 | abort: 00changelog.i@2: ambiguous identifier! | |
1664 | [255] |
|
1664 | [255] | |
1665 | $ log 'id(23268)' |
|
1665 | $ log 'id(23268)' | |
1666 | 4 |
|
1666 | 4 | |
1667 | $ log 'id(2785f51eece)' |
|
1667 | $ log 'id(2785f51eece)' | |
1668 | 0 |
|
1668 | 0 | |
1669 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)' |
|
1669 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)' | |
1670 | 8 |
|
1670 | 8 | |
1671 | $ log 'id(d5d0dcbdc4a)' |
|
1671 | $ log 'id(d5d0dcbdc4a)' | |
1672 | $ log 'id(d5d0dcbdc4w)' |
|
1672 | $ log 'id(d5d0dcbdc4w)' | |
1673 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)' |
|
1673 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)' | |
1674 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)' |
|
1674 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)' | |
1675 | $ log 'id(1.0)' |
|
1675 | $ log 'id(1.0)' | |
1676 | $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)' |
|
1676 | $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)' | |
1677 |
|
1677 | |||
1678 | Test null revision |
|
1678 | Test null revision | |
1679 | $ log '(null)' |
|
1679 | $ log '(null)' | |
1680 | -1 |
|
1680 | -1 | |
1681 | $ log '(null:0)' |
|
1681 | $ log '(null:0)' | |
1682 | -1 |
|
1682 | -1 | |
1683 | 0 |
|
1683 | 0 | |
1684 | $ log '(0:null)' |
|
1684 | $ log '(0:null)' | |
1685 | 0 |
|
1685 | 0 | |
1686 | -1 |
|
1686 | -1 | |
1687 | $ log 'null::0' |
|
1687 | $ log 'null::0' | |
1688 | -1 |
|
1688 | -1 | |
1689 | 0 |
|
1689 | 0 | |
1690 | $ log 'null:tip - 0:' |
|
1690 | $ log 'null:tip - 0:' | |
1691 | -1 |
|
1691 | -1 | |
1692 | $ log 'null: and null::' | head -1 |
|
1692 | $ log 'null: and null::' | head -1 | |
1693 | -1 |
|
1693 | -1 | |
1694 | $ log 'null: or 0:' | head -2 |
|
1694 | $ log 'null: or 0:' | head -2 | |
1695 | -1 |
|
1695 | -1 | |
1696 | 0 |
|
1696 | 0 | |
1697 | $ log 'ancestors(null)' |
|
1697 | $ log 'ancestors(null)' | |
1698 | -1 |
|
1698 | -1 | |
1699 | $ log 'reverse(null:)' | tail -2 |
|
1699 | $ log 'reverse(null:)' | tail -2 | |
1700 | 0 |
|
1700 | 0 | |
1701 | -1 |
|
1701 | -1 | |
1702 | $ log 'first(null:)' |
|
1702 | $ log 'first(null:)' | |
1703 | -1 |
|
1703 | -1 | |
1704 | $ log 'min(null:)' |
|
1704 | $ log 'min(null:)' | |
1705 | BROKEN: should be '-1' |
|
1705 | BROKEN: should be '-1' | |
1706 | $ log 'tip:null and all()' | tail -2 |
|
1706 | $ log 'tip:null and all()' | tail -2 | |
1707 | 1 |
|
1707 | 1 | |
1708 | 0 |
|
1708 | 0 | |
1709 |
|
1709 | |||
1710 | Test working-directory revision |
|
1710 | Test working-directory revision | |
1711 | $ hg debugrevspec 'wdir()' |
|
1711 | $ hg debugrevspec 'wdir()' | |
1712 | 2147483647 |
|
1712 | 2147483647 | |
1713 | $ hg debugrevspec 'wdir()^' |
|
1713 | $ hg debugrevspec 'wdir()^' | |
1714 | 9 |
|
1714 | 9 | |
1715 | $ hg up 7 |
|
1715 | $ hg up 7 | |
1716 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1716 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1717 | $ hg debugrevspec 'wdir()^' |
|
1717 | $ hg debugrevspec 'wdir()^' | |
1718 | 7 |
|
1718 | 7 | |
1719 | $ hg debugrevspec 'wdir()^0' |
|
1719 | $ hg debugrevspec 'wdir()^0' | |
1720 | 2147483647 |
|
1720 | 2147483647 | |
1721 | $ hg debugrevspec 'wdir()~3' |
|
1721 | $ hg debugrevspec 'wdir()~3' | |
1722 | 5 |
|
1722 | 5 | |
1723 | $ hg debugrevspec 'ancestors(wdir())' |
|
1723 | $ hg debugrevspec 'ancestors(wdir())' | |
1724 | 0 |
|
1724 | 0 | |
1725 | 1 |
|
1725 | 1 | |
1726 | 2 |
|
1726 | 2 | |
1727 | 3 |
|
1727 | 3 | |
1728 | 4 |
|
1728 | 4 | |
1729 | 5 |
|
1729 | 5 | |
1730 | 6 |
|
1730 | 6 | |
1731 | 7 |
|
1731 | 7 | |
1732 | 2147483647 |
|
1732 | 2147483647 | |
1733 | $ hg debugrevspec 'wdir()~0' |
|
1733 | $ hg debugrevspec 'wdir()~0' | |
1734 | 2147483647 |
|
1734 | 2147483647 | |
1735 | $ hg debugrevspec 'p1(wdir())' |
|
1735 | $ hg debugrevspec 'p1(wdir())' | |
1736 | 7 |
|
1736 | 7 | |
1737 | $ hg debugrevspec 'p2(wdir())' |
|
1737 | $ hg debugrevspec 'p2(wdir())' | |
1738 | $ hg debugrevspec 'parents(wdir())' |
|
1738 | $ hg debugrevspec 'parents(wdir())' | |
1739 | 7 |
|
1739 | 7 | |
1740 | $ hg debugrevspec 'wdir()^1' |
|
1740 | $ hg debugrevspec 'wdir()^1' | |
1741 | 7 |
|
1741 | 7 | |
1742 | $ hg debugrevspec 'wdir()^2' |
|
1742 | $ hg debugrevspec 'wdir()^2' | |
1743 | $ hg debugrevspec 'wdir()^3' |
|
1743 | $ hg debugrevspec 'wdir()^3' | |
1744 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
1744 | hg: parse error: ^ expects a number 0, 1, or 2 | |
1745 | [255] |
|
1745 | [255] | |
1746 | For tests consistency |
|
1746 | For tests consistency | |
1747 | $ hg up 9 |
|
1747 | $ hg up 9 | |
1748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1749 | $ hg debugrevspec 'tip or wdir()' |
|
1749 | $ hg debugrevspec 'tip or wdir()' | |
1750 | 9 |
|
1750 | 9 | |
1751 | 2147483647 |
|
1751 | 2147483647 | |
1752 | $ hg debugrevspec '0:tip and wdir()' |
|
1752 | $ hg debugrevspec '0:tip and wdir()' | |
1753 | $ log '0:wdir()' | tail -3 |
|
1753 | $ log '0:wdir()' | tail -3 | |
1754 | 8 |
|
1754 | 8 | |
1755 | 9 |
|
1755 | 9 | |
1756 | 2147483647 |
|
1756 | 2147483647 | |
1757 | $ log 'wdir():0' | head -3 |
|
1757 | $ log 'wdir():0' | head -3 | |
1758 | 2147483647 |
|
1758 | 2147483647 | |
1759 | 9 |
|
1759 | 9 | |
1760 | 8 |
|
1760 | 8 | |
1761 | $ log 'wdir():wdir()' |
|
1761 | $ log 'wdir():wdir()' | |
1762 | 2147483647 |
|
1762 | 2147483647 | |
1763 | $ log '(all() + wdir()) & min(. + wdir())' |
|
1763 | $ log '(all() + wdir()) & min(. + wdir())' | |
1764 | 9 |
|
1764 | 9 | |
1765 | $ log '(all() + wdir()) & max(. + wdir())' |
|
1765 | $ log '(all() + wdir()) & max(. + wdir())' | |
1766 | 2147483647 |
|
1766 | 2147483647 | |
1767 | $ log 'first(wdir() + .)' |
|
1767 | $ log 'first(wdir() + .)' | |
1768 | 2147483647 |
|
1768 | 2147483647 | |
1769 | $ log 'last(. + wdir())' |
|
1769 | $ log 'last(. + wdir())' | |
1770 | 2147483647 |
|
1770 | 2147483647 | |
1771 |
|
1771 | |||
1772 | Test working-directory integer revision and node id |
|
1772 | Test working-directory integer revision and node id | |
1773 | (BUG: '0:wdir()' is still needed to populate wdir revision) |
|
1773 | (BUG: '0:wdir()' is still needed to populate wdir revision) | |
1774 |
|
1774 | |||
1775 | $ hg debugrevspec '0:wdir() & 2147483647' |
|
1775 | $ hg debugrevspec '0:wdir() & 2147483647' | |
1776 | 2147483647 |
|
1776 | 2147483647 | |
1777 | $ hg debugrevspec '0:wdir() & rev(2147483647)' |
|
1777 | $ hg debugrevspec '0:wdir() & rev(2147483647)' | |
1778 | 2147483647 |
|
1778 | 2147483647 | |
1779 | $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff' |
|
1779 | $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff' | |
1780 | 2147483647 |
|
1780 | 2147483647 | |
1781 | $ hg debugrevspec '0:wdir() & ffffffffffff' |
|
1781 | $ hg debugrevspec '0:wdir() & ffffffffffff' | |
1782 | 2147483647 |
|
1782 | 2147483647 | |
1783 | $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)' |
|
1783 | $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)' | |
1784 | 2147483647 |
|
1784 | 2147483647 | |
1785 | $ hg debugrevspec '0:wdir() & id(ffffffffffff)' |
|
1785 | $ hg debugrevspec '0:wdir() & id(ffffffffffff)' | |
1786 | 2147483647 |
|
1786 | 2147483647 | |
1787 |
|
1787 | |||
1788 | $ cd .. |
|
1788 | $ cd .. | |
1789 |
|
1789 | |||
1790 | Test short 'ff...' hash collision |
|
1790 | Test short 'ff...' hash collision | |
1791 | (BUG: '0:wdir()' is still needed to populate wdir revision) |
|
1791 | (BUG: '0:wdir()' is still needed to populate wdir revision) | |
1792 |
|
1792 | |||
1793 | $ hg init wdir-hashcollision |
|
1793 | $ hg init wdir-hashcollision | |
1794 | $ cd wdir-hashcollision |
|
1794 | $ cd wdir-hashcollision | |
1795 | $ cat <<EOF >> .hg/hgrc |
|
1795 | $ cat <<EOF >> .hg/hgrc | |
1796 | > [experimental] |
|
1796 | > [experimental] | |
1797 | > stabilization = createmarkers |
|
1797 | > stabilization = createmarkers | |
1798 | > EOF |
|
1798 | > EOF | |
1799 | $ echo 0 > a |
|
1799 | $ echo 0 > a | |
1800 | $ hg ci -qAm 0 |
|
1800 | $ hg ci -qAm 0 | |
1801 | $ for i in 2463 2961 6726 78127; do |
|
1801 | $ for i in 2463 2961 6726 78127; do | |
1802 | > hg up -q 0 |
|
1802 | > hg up -q 0 | |
1803 | > echo $i > a |
|
1803 | > echo $i > a | |
1804 | > hg ci -qm $i |
|
1804 | > hg ci -qm $i | |
1805 | > done |
|
1805 | > done | |
1806 | $ hg up -q null |
|
1806 | $ hg up -q null | |
1807 | $ hg log -r '0:wdir()' -T '{rev}:{node} {shortest(node, 3)}\n' |
|
1807 | $ hg log -r '0:wdir()' -T '{rev}:{node} {shortest(node, 3)}\n' | |
1808 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e |
|
1808 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e | |
1809 | 1:fffbae3886c8fbb2114296380d276fd37715d571 fffba |
|
1809 | 1:fffbae3886c8fbb2114296380d276fd37715d571 fffba | |
1810 | 2:fffb6093b00943f91034b9bdad069402c834e572 fffb6 |
|
1810 | 2:fffb6093b00943f91034b9bdad069402c834e572 fffb6 | |
1811 | 3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4 |
|
1811 | 3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4 | |
1812 | 4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8 |
|
1812 | 4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8 | |
1813 | 2147483647:ffffffffffffffffffffffffffffffffffffffff fffff |
|
1813 | 2147483647:ffffffffffffffffffffffffffffffffffffffff fffff | |
1814 | $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571 |
|
1814 | $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571 | |
1815 | obsoleted 1 changesets |
|
1815 | obsoleted 1 changesets | |
1816 |
|
1816 | |||
1817 | $ hg debugrevspec '0:wdir() & fff' |
|
1817 | $ hg debugrevspec '0:wdir() & fff' | |
1818 | abort: 00changelog.i@fff: ambiguous identifier! |
|
1818 | abort: 00changelog.i@fff: ambiguous identifier! | |
1819 | [255] |
|
1819 | [255] | |
1820 | $ hg debugrevspec '0:wdir() & ffff' |
|
1820 | $ hg debugrevspec '0:wdir() & ffff' | |
1821 | abort: 00changelog.i@ffff: ambiguous identifier! |
|
1821 | abort: 00changelog.i@ffff: ambiguous identifier! | |
1822 | [255] |
|
1822 | [255] | |
1823 | $ hg debugrevspec '0:wdir() & fffb' |
|
1823 | $ hg debugrevspec '0:wdir() & fffb' | |
1824 | abort: 00changelog.i@fffb: ambiguous identifier! |
|
1824 | abort: 00changelog.i@fffb: ambiguous identifier! | |
1825 | [255] |
|
1825 | [255] | |
1826 | BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) |
|
1826 | BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) | |
1827 | $ hg debugrevspec '0:wdir() & id(fffb)' |
|
1827 | $ hg debugrevspec '0:wdir() & id(fffb)' | |
1828 | 2 |
|
1828 | 2 | |
1829 | $ hg debugrevspec '0:wdir() & ffff8' |
|
1829 | $ hg debugrevspec '0:wdir() & ffff8' | |
1830 | 4 |
|
1830 | 4 | |
1831 | $ hg debugrevspec '0:wdir() & fffff' |
|
1831 | $ hg debugrevspec '0:wdir() & fffff' | |
1832 | 2147483647 |
|
1832 | 2147483647 | |
1833 |
|
1833 | |||
1834 | $ cd .. |
|
1834 | $ cd .. | |
1835 |
|
1835 | |||
1836 | Test branch() with wdir() |
|
1836 | Test branch() with wdir() | |
1837 |
|
1837 | |||
1838 | $ cd repo |
|
1838 | $ cd repo | |
1839 |
|
1839 | |||
1840 | $ log '0:wdir() & branch("literal:Γ©")' |
|
1840 | $ log '0:wdir() & branch("literal:Γ©")' | |
1841 | 8 |
|
1841 | 8 | |
1842 | 9 |
|
1842 | 9 | |
1843 | 2147483647 |
|
1843 | 2147483647 | |
1844 | $ log '0:wdir() & branch("re:Γ©")' |
|
1844 | $ log '0:wdir() & branch("re:Γ©")' | |
1845 | 8 |
|
1845 | 8 | |
1846 | 9 |
|
1846 | 9 | |
1847 | 2147483647 |
|
1847 | 2147483647 | |
1848 | $ log '0:wdir() & branch("re:^a")' |
|
1848 | $ log '0:wdir() & branch("re:^a")' | |
1849 | 0 |
|
1849 | 0 | |
1850 | 2 |
|
1850 | 2 | |
1851 | $ log '0:wdir() & branch(8)' |
|
1851 | $ log '0:wdir() & branch(8)' | |
1852 | 8 |
|
1852 | 8 | |
1853 | 9 |
|
1853 | 9 | |
1854 | 2147483647 |
|
1854 | 2147483647 | |
1855 |
|
1855 | |||
1856 | branch(wdir()) returns all revisions belonging to the working branch. The wdir |
|
1856 | branch(wdir()) returns all revisions belonging to the working branch. The wdir | |
1857 | itself isn't returned unless it is explicitly populated. |
|
1857 | itself isn't returned unless it is explicitly populated. | |
1858 |
|
1858 | |||
1859 | $ log 'branch(wdir())' |
|
1859 | $ log 'branch(wdir())' | |
1860 | 8 |
|
1860 | 8 | |
1861 | 9 |
|
1861 | 9 | |
1862 | $ log '0:wdir() & branch(wdir())' |
|
1862 | $ log '0:wdir() & branch(wdir())' | |
1863 | 8 |
|
1863 | 8 | |
1864 | 9 |
|
1864 | 9 | |
1865 | 2147483647 |
|
1865 | 2147483647 | |
1866 |
|
1866 | |||
1867 | $ log 'outgoing()' |
|
1867 | $ log 'outgoing()' | |
1868 | 8 |
|
1868 | 8 | |
1869 | 9 |
|
1869 | 9 | |
1870 | $ log 'outgoing("../remote1")' |
|
1870 | $ log 'outgoing("../remote1")' | |
1871 | 8 |
|
1871 | 8 | |
1872 | 9 |
|
1872 | 9 | |
1873 | $ log 'outgoing("../remote2")' |
|
1873 | $ log 'outgoing("../remote2")' | |
1874 | 3 |
|
1874 | 3 | |
1875 | 5 |
|
1875 | 5 | |
1876 | 6 |
|
1876 | 6 | |
1877 | 7 |
|
1877 | 7 | |
1878 | 9 |
|
1878 | 9 | |
1879 | $ log 'p1(merge())' |
|
1879 | $ log 'p1(merge())' | |
1880 | 5 |
|
1880 | 5 | |
1881 | $ log 'p2(merge())' |
|
1881 | $ log 'p2(merge())' | |
1882 | 4 |
|
1882 | 4 | |
1883 | $ log 'parents(merge())' |
|
1883 | $ log 'parents(merge())' | |
1884 | 4 |
|
1884 | 4 | |
1885 | 5 |
|
1885 | 5 | |
1886 | $ log 'p1(branchpoint())' |
|
1886 | $ log 'p1(branchpoint())' | |
1887 | 0 |
|
1887 | 0 | |
1888 | 2 |
|
1888 | 2 | |
1889 | $ log 'p2(branchpoint())' |
|
1889 | $ log 'p2(branchpoint())' | |
1890 | $ log 'parents(branchpoint())' |
|
1890 | $ log 'parents(branchpoint())' | |
1891 | 0 |
|
1891 | 0 | |
1892 | 2 |
|
1892 | 2 | |
1893 | $ log 'removes(a)' |
|
1893 | $ log 'removes(a)' | |
1894 | 2 |
|
1894 | 2 | |
1895 | 6 |
|
1895 | 6 | |
1896 | $ log 'roots(all())' |
|
1896 | $ log 'roots(all())' | |
1897 | 0 |
|
1897 | 0 | |
1898 | $ log 'reverse(2 or 3 or 4 or 5)' |
|
1898 | $ log 'reverse(2 or 3 or 4 or 5)' | |
1899 | 5 |
|
1899 | 5 | |
1900 | 4 |
|
1900 | 4 | |
1901 | 3 |
|
1901 | 3 | |
1902 | 2 |
|
1902 | 2 | |
1903 | $ log 'reverse(all())' |
|
1903 | $ log 'reverse(all())' | |
1904 | 9 |
|
1904 | 9 | |
1905 | 8 |
|
1905 | 8 | |
1906 | 7 |
|
1906 | 7 | |
1907 | 6 |
|
1907 | 6 | |
1908 | 5 |
|
1908 | 5 | |
1909 | 4 |
|
1909 | 4 | |
1910 | 3 |
|
1910 | 3 | |
1911 | 2 |
|
1911 | 2 | |
1912 | 1 |
|
1912 | 1 | |
1913 | 0 |
|
1913 | 0 | |
1914 | $ log 'reverse(all()) & filelog(b)' |
|
1914 | $ log 'reverse(all()) & filelog(b)' | |
1915 | 4 |
|
1915 | 4 | |
1916 | 1 |
|
1916 | 1 | |
1917 | $ log 'rev(5)' |
|
1917 | $ log 'rev(5)' | |
1918 | 5 |
|
1918 | 5 | |
1919 | $ log 'sort(limit(reverse(all()), 3))' |
|
1919 | $ log 'sort(limit(reverse(all()), 3))' | |
1920 | 7 |
|
1920 | 7 | |
1921 | 8 |
|
1921 | 8 | |
1922 | 9 |
|
1922 | 9 | |
1923 | $ log 'sort(2 or 3 or 4 or 5, date)' |
|
1923 | $ log 'sort(2 or 3 or 4 or 5, date)' | |
1924 | 2 |
|
1924 | 2 | |
1925 | 3 |
|
1925 | 3 | |
1926 | 5 |
|
1926 | 5 | |
1927 | 4 |
|
1927 | 4 | |
1928 | $ log 'tagged()' |
|
1928 | $ log 'tagged()' | |
1929 | 6 |
|
1929 | 6 | |
1930 | $ log 'tag()' |
|
1930 | $ log 'tag()' | |
1931 | 6 |
|
1931 | 6 | |
1932 | $ log 'tag(1.0)' |
|
1932 | $ log 'tag(1.0)' | |
1933 | 6 |
|
1933 | 6 | |
1934 | $ log 'tag(tip)' |
|
1934 | $ log 'tag(tip)' | |
1935 | 9 |
|
1935 | 9 | |
1936 |
|
1936 | |||
1937 | Test order of revisions in compound expression |
|
1937 | Test order of revisions in compound expression | |
1938 | ---------------------------------------------- |
|
1938 | ---------------------------------------------- | |
1939 |
|
1939 | |||
1940 | The general rule is that only the outermost (= leftmost) predicate can |
|
1940 | The general rule is that only the outermost (= leftmost) predicate can | |
1941 | enforce its ordering requirement. The other predicates should take the |
|
1941 | enforce its ordering requirement. The other predicates should take the | |
1942 | ordering defined by it. |
|
1942 | ordering defined by it. | |
1943 |
|
1943 | |||
1944 | 'A & B' should follow the order of 'A': |
|
1944 | 'A & B' should follow the order of 'A': | |
1945 |
|
1945 | |||
1946 | $ log '2:0 & 0::2' |
|
1946 | $ log '2:0 & 0::2' | |
1947 | 2 |
|
1947 | 2 | |
1948 | 1 |
|
1948 | 1 | |
1949 | 0 |
|
1949 | 0 | |
1950 |
|
1950 | |||
1951 | 'head()' combines sets in right order: |
|
1951 | 'head()' combines sets in right order: | |
1952 |
|
1952 | |||
1953 | $ log '2:0 & head()' |
|
1953 | $ log '2:0 & head()' | |
1954 | 2 |
|
1954 | 2 | |
1955 | 1 |
|
1955 | 1 | |
1956 | 0 |
|
1956 | 0 | |
1957 |
|
1957 | |||
1958 | 'x:y' takes ordering parameter into account: |
|
1958 | 'x:y' takes ordering parameter into account: | |
1959 |
|
1959 | |||
1960 | $ try -p optimized '3:0 & 0:3 & not 2:1' |
|
1960 | $ try -p optimized '3:0 & 0:3 & not 2:1' | |
1961 | * optimized: |
|
1961 | * optimized: | |
1962 | (difference |
|
1962 | (difference | |
1963 | (and |
|
1963 | (and | |
1964 | (range |
|
1964 | (range | |
1965 | (symbol '3') |
|
1965 | (symbol '3') | |
1966 | (symbol '0')) |
|
1966 | (symbol '0')) | |
1967 | (range |
|
1967 | (range | |
1968 | (symbol '0') |
|
1968 | (symbol '0') | |
1969 | (symbol '3'))) |
|
1969 | (symbol '3'))) | |
1970 | (range |
|
1970 | (range | |
1971 | (symbol '2') |
|
1971 | (symbol '2') | |
1972 | (symbol '1'))) |
|
1972 | (symbol '1'))) | |
1973 | * set: |
|
1973 | * set: | |
1974 | <filteredset |
|
1974 | <filteredset | |
1975 | <filteredset |
|
1975 | <filteredset | |
1976 | <spanset- 0:4>, |
|
1976 | <spanset- 0:4>, | |
1977 | <spanset+ 0:4>>, |
|
1977 | <spanset+ 0:4>>, | |
1978 | <not |
|
1978 | <not | |
1979 | <spanset+ 1:3>>> |
|
1979 | <spanset+ 1:3>>> | |
1980 | 3 |
|
1980 | 3 | |
1981 | 0 |
|
1981 | 0 | |
1982 |
|
1982 | |||
1983 | 'a + b', which is optimized to '_list(a b)', should take the ordering of |
|
1983 | 'a + b', which is optimized to '_list(a b)', should take the ordering of | |
1984 | the left expression: |
|
1984 | the left expression: | |
1985 |
|
1985 | |||
1986 | $ try --optimize '2:0 & (0 + 1 + 2)' |
|
1986 | $ try --optimize '2:0 & (0 + 1 + 2)' | |
1987 | (and |
|
1987 | (and | |
1988 | (range |
|
1988 | (range | |
1989 | (symbol '2') |
|
1989 | (symbol '2') | |
1990 | (symbol '0')) |
|
1990 | (symbol '0')) | |
1991 | (group |
|
1991 | (group | |
1992 | (or |
|
1992 | (or | |
1993 | (list |
|
1993 | (list | |
1994 | (symbol '0') |
|
1994 | (symbol '0') | |
1995 | (symbol '1') |
|
1995 | (symbol '1') | |
1996 | (symbol '2'))))) |
|
1996 | (symbol '2'))))) | |
1997 | * optimized: |
|
1997 | * optimized: | |
1998 | (and |
|
1998 | (and | |
1999 | (range |
|
1999 | (range | |
2000 | (symbol '2') |
|
2000 | (symbol '2') | |
2001 | (symbol '0')) |
|
2001 | (symbol '0')) | |
2002 | (func |
|
2002 | (func | |
2003 | (symbol '_list') |
|
2003 | (symbol '_list') | |
2004 | (string '0\x001\x002'))) |
|
2004 | (string '0\x001\x002'))) | |
2005 | * set: |
|
2005 | * set: | |
2006 | <filteredset |
|
2006 | <filteredset | |
2007 | <spanset- 0:3>, |
|
2007 | <spanset- 0:3>, | |
2008 | <baseset [0, 1, 2]>> |
|
2008 | <baseset [0, 1, 2]>> | |
2009 | 2 |
|
2009 | 2 | |
2010 | 1 |
|
2010 | 1 | |
2011 | 0 |
|
2011 | 0 | |
2012 |
|
2012 | |||
2013 | 'A + B' should take the ordering of the left expression: |
|
2013 | 'A + B' should take the ordering of the left expression: | |
2014 |
|
2014 | |||
2015 | $ try --optimize '2:0 & (0:1 + 2)' |
|
2015 | $ try --optimize '2:0 & (0:1 + 2)' | |
2016 | (and |
|
2016 | (and | |
2017 | (range |
|
2017 | (range | |
2018 | (symbol '2') |
|
2018 | (symbol '2') | |
2019 | (symbol '0')) |
|
2019 | (symbol '0')) | |
2020 | (group |
|
2020 | (group | |
2021 | (or |
|
2021 | (or | |
2022 | (list |
|
2022 | (list | |
2023 | (range |
|
2023 | (range | |
2024 | (symbol '0') |
|
2024 | (symbol '0') | |
2025 | (symbol '1')) |
|
2025 | (symbol '1')) | |
2026 | (symbol '2'))))) |
|
2026 | (symbol '2'))))) | |
2027 | * optimized: |
|
2027 | * optimized: | |
2028 | (and |
|
2028 | (and | |
2029 | (range |
|
2029 | (range | |
2030 | (symbol '2') |
|
2030 | (symbol '2') | |
2031 | (symbol '0')) |
|
2031 | (symbol '0')) | |
2032 | (or |
|
2032 | (or | |
2033 | (list |
|
2033 | (list | |
2034 | (range |
|
2034 | (range | |
2035 | (symbol '0') |
|
2035 | (symbol '0') | |
2036 | (symbol '1')) |
|
2036 | (symbol '1')) | |
2037 | (symbol '2')))) |
|
2037 | (symbol '2')))) | |
2038 | * set: |
|
2038 | * set: | |
2039 | <filteredset |
|
2039 | <filteredset | |
2040 | <spanset- 0:3>, |
|
2040 | <spanset- 0:3>, | |
2041 | <addset |
|
2041 | <addset | |
2042 | <spanset+ 0:2>, |
|
2042 | <spanset+ 0:2>, | |
2043 | <baseset [2]>>> |
|
2043 | <baseset [2]>>> | |
2044 | 2 |
|
2044 | 2 | |
2045 | 1 |
|
2045 | 1 | |
2046 | 0 |
|
2046 | 0 | |
2047 |
|
2047 | |||
2048 | '_intlist(a b)' should behave like 'a + b': |
|
2048 | '_intlist(a b)' should behave like 'a + b': | |
2049 |
|
2049 | |||
2050 | $ trylist --optimize '2:0 & %ld' 0 1 2 |
|
2050 | $ trylist --optimize '2:0 & %ld' 0 1 2 | |
2051 | (and |
|
2051 | (and | |
2052 | (range |
|
2052 | (range | |
2053 | (symbol '2') |
|
2053 | (symbol '2') | |
2054 | (symbol '0')) |
|
2054 | (symbol '0')) | |
2055 | (func |
|
2055 | (func | |
2056 | (symbol '_intlist') |
|
2056 | (symbol '_intlist') | |
2057 | (string '0\x001\x002'))) |
|
2057 | (string '0\x001\x002'))) | |
2058 | * optimized: |
|
2058 | * optimized: | |
2059 | (andsmally |
|
2059 | (andsmally | |
2060 | (range |
|
2060 | (range | |
2061 | (symbol '2') |
|
2061 | (symbol '2') | |
2062 | (symbol '0')) |
|
2062 | (symbol '0')) | |
2063 | (func |
|
2063 | (func | |
2064 | (symbol '_intlist') |
|
2064 | (symbol '_intlist') | |
2065 | (string '0\x001\x002'))) |
|
2065 | (string '0\x001\x002'))) | |
2066 | * set: |
|
2066 | * set: | |
2067 | <filteredset |
|
2067 | <filteredset | |
2068 | <spanset- 0:3>, |
|
2068 | <spanset- 0:3>, | |
2069 | <baseset+ [0, 1, 2]>> |
|
2069 | <baseset+ [0, 1, 2]>> | |
2070 | 2 |
|
2070 | 2 | |
2071 | 1 |
|
2071 | 1 | |
2072 | 0 |
|
2072 | 0 | |
2073 |
|
2073 | |||
2074 | $ trylist --optimize '%ld & 2:0' 0 2 1 |
|
2074 | $ trylist --optimize '%ld & 2:0' 0 2 1 | |
2075 | (and |
|
2075 | (and | |
2076 | (func |
|
2076 | (func | |
2077 | (symbol '_intlist') |
|
2077 | (symbol '_intlist') | |
2078 | (string '0\x002\x001')) |
|
2078 | (string '0\x002\x001')) | |
2079 | (range |
|
2079 | (range | |
2080 | (symbol '2') |
|
2080 | (symbol '2') | |
2081 | (symbol '0'))) |
|
2081 | (symbol '0'))) | |
2082 | * optimized: |
|
2082 | * optimized: | |
2083 | (and |
|
2083 | (and | |
2084 | (func |
|
2084 | (func | |
2085 | (symbol '_intlist') |
|
2085 | (symbol '_intlist') | |
2086 | (string '0\x002\x001')) |
|
2086 | (string '0\x002\x001')) | |
2087 | (range |
|
2087 | (range | |
2088 | (symbol '2') |
|
2088 | (symbol '2') | |
2089 | (symbol '0'))) |
|
2089 | (symbol '0'))) | |
2090 | * set: |
|
2090 | * set: | |
2091 | <filteredset |
|
2091 | <filteredset | |
2092 | <baseset [0, 2, 1]>, |
|
2092 | <baseset [0, 2, 1]>, | |
2093 | <spanset- 0:3>> |
|
2093 | <spanset- 0:3>> | |
2094 | 0 |
|
2094 | 0 | |
2095 | 2 |
|
2095 | 2 | |
2096 | 1 |
|
2096 | 1 | |
2097 |
|
2097 | |||
2098 | '_hexlist(a b)' should behave like 'a + b': |
|
2098 | '_hexlist(a b)' should behave like 'a + b': | |
2099 |
|
2099 | |||
2100 | $ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2` |
|
2100 | $ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2` | |
2101 | (and |
|
2101 | (and | |
2102 | (range |
|
2102 | (range | |
2103 | (symbol '2') |
|
2103 | (symbol '2') | |
2104 | (symbol '0')) |
|
2104 | (symbol '0')) | |
2105 | (func |
|
2105 | (func | |
2106 | (symbol '_hexlist') |
|
2106 | (symbol '_hexlist') | |
2107 | (string '*'))) (glob) |
|
2107 | (string '*'))) (glob) | |
2108 | * optimized: |
|
2108 | * optimized: | |
2109 | (and |
|
2109 | (and | |
2110 | (range |
|
2110 | (range | |
2111 | (symbol '2') |
|
2111 | (symbol '2') | |
2112 | (symbol '0')) |
|
2112 | (symbol '0')) | |
2113 | (func |
|
2113 | (func | |
2114 | (symbol '_hexlist') |
|
2114 | (symbol '_hexlist') | |
2115 | (string '*'))) (glob) |
|
2115 | (string '*'))) (glob) | |
2116 | * set: |
|
2116 | * set: | |
2117 | <filteredset |
|
2117 | <filteredset | |
2118 | <spanset- 0:3>, |
|
2118 | <spanset- 0:3>, | |
2119 | <baseset [0, 1, 2]>> |
|
2119 | <baseset [0, 1, 2]>> | |
2120 | 2 |
|
2120 | 2 | |
2121 | 1 |
|
2121 | 1 | |
2122 | 0 |
|
2122 | 0 | |
2123 |
|
2123 | |||
2124 | $ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1` |
|
2124 | $ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1` | |
2125 | (and |
|
2125 | (and | |
2126 | (func |
|
2126 | (func | |
2127 | (symbol '_hexlist') |
|
2127 | (symbol '_hexlist') | |
2128 | (string '*')) (glob) |
|
2128 | (string '*')) (glob) | |
2129 | (range |
|
2129 | (range | |
2130 | (symbol '2') |
|
2130 | (symbol '2') | |
2131 | (symbol '0'))) |
|
2131 | (symbol '0'))) | |
2132 | * optimized: |
|
2132 | * optimized: | |
2133 | (andsmally |
|
2133 | (andsmally | |
2134 | (func |
|
2134 | (func | |
2135 | (symbol '_hexlist') |
|
2135 | (symbol '_hexlist') | |
2136 | (string '*')) (glob) |
|
2136 | (string '*')) (glob) | |
2137 | (range |
|
2137 | (range | |
2138 | (symbol '2') |
|
2138 | (symbol '2') | |
2139 | (symbol '0'))) |
|
2139 | (symbol '0'))) | |
2140 | * set: |
|
2140 | * set: | |
2141 | <baseset [0, 2, 1]> |
|
2141 | <baseset [0, 2, 1]> | |
2142 | 0 |
|
2142 | 0 | |
2143 | 2 |
|
2143 | 2 | |
2144 | 1 |
|
2144 | 1 | |
2145 |
|
2145 | |||
2146 | '_list' should not go through the slow follow-order path if order doesn't |
|
2146 | '_list' should not go through the slow follow-order path if order doesn't | |
2147 | matter: |
|
2147 | matter: | |
2148 |
|
2148 | |||
2149 | $ try -p optimized '2:0 & not (0 + 1)' |
|
2149 | $ try -p optimized '2:0 & not (0 + 1)' | |
2150 | * optimized: |
|
2150 | * optimized: | |
2151 | (difference |
|
2151 | (difference | |
2152 | (range |
|
2152 | (range | |
2153 | (symbol '2') |
|
2153 | (symbol '2') | |
2154 | (symbol '0')) |
|
2154 | (symbol '0')) | |
2155 | (func |
|
2155 | (func | |
2156 | (symbol '_list') |
|
2156 | (symbol '_list') | |
2157 | (string '0\x001'))) |
|
2157 | (string '0\x001'))) | |
2158 | * set: |
|
2158 | * set: | |
2159 | <filteredset |
|
2159 | <filteredset | |
2160 | <spanset- 0:3>, |
|
2160 | <spanset- 0:3>, | |
2161 | <not |
|
2161 | <not | |
2162 | <baseset [0, 1]>>> |
|
2162 | <baseset [0, 1]>>> | |
2163 | 2 |
|
2163 | 2 | |
2164 |
|
2164 | |||
2165 | $ try -p optimized '2:0 & not (0:2 & (0 + 1))' |
|
2165 | $ try -p optimized '2:0 & not (0:2 & (0 + 1))' | |
2166 | * optimized: |
|
2166 | * optimized: | |
2167 | (difference |
|
2167 | (difference | |
2168 | (range |
|
2168 | (range | |
2169 | (symbol '2') |
|
2169 | (symbol '2') | |
2170 | (symbol '0')) |
|
2170 | (symbol '0')) | |
2171 | (and |
|
2171 | (and | |
2172 | (range |
|
2172 | (range | |
2173 | (symbol '0') |
|
2173 | (symbol '0') | |
2174 | (symbol '2')) |
|
2174 | (symbol '2')) | |
2175 | (func |
|
2175 | (func | |
2176 | (symbol '_list') |
|
2176 | (symbol '_list') | |
2177 | (string '0\x001')))) |
|
2177 | (string '0\x001')))) | |
2178 | * set: |
|
2178 | * set: | |
2179 | <filteredset |
|
2179 | <filteredset | |
2180 | <spanset- 0:3>, |
|
2180 | <spanset- 0:3>, | |
2181 | <not |
|
2181 | <not | |
2182 | <baseset [0, 1]>>> |
|
2182 | <baseset [0, 1]>>> | |
2183 | 2 |
|
2183 | 2 | |
2184 |
|
2184 | |||
2185 | because 'present()' does nothing other than suppressing an error, the |
|
2185 | because 'present()' does nothing other than suppressing an error, the | |
2186 | ordering requirement should be forwarded to the nested expression |
|
2186 | ordering requirement should be forwarded to the nested expression | |
2187 |
|
2187 | |||
2188 | $ try -p optimized 'present(2 + 0 + 1)' |
|
2188 | $ try -p optimized 'present(2 + 0 + 1)' | |
2189 | * optimized: |
|
2189 | * optimized: | |
2190 | (func |
|
2190 | (func | |
2191 | (symbol 'present') |
|
2191 | (symbol 'present') | |
2192 | (func |
|
2192 | (func | |
2193 | (symbol '_list') |
|
2193 | (symbol '_list') | |
2194 | (string '2\x000\x001'))) |
|
2194 | (string '2\x000\x001'))) | |
2195 | * set: |
|
2195 | * set: | |
2196 | <baseset [2, 0, 1]> |
|
2196 | <baseset [2, 0, 1]> | |
2197 | 2 |
|
2197 | 2 | |
2198 | 0 |
|
2198 | 0 | |
2199 | 1 |
|
2199 | 1 | |
2200 |
|
2200 | |||
2201 | $ try --optimize '2:0 & present(0 + 1 + 2)' |
|
2201 | $ try --optimize '2:0 & present(0 + 1 + 2)' | |
2202 | (and |
|
2202 | (and | |
2203 | (range |
|
2203 | (range | |
2204 | (symbol '2') |
|
2204 | (symbol '2') | |
2205 | (symbol '0')) |
|
2205 | (symbol '0')) | |
2206 | (func |
|
2206 | (func | |
2207 | (symbol 'present') |
|
2207 | (symbol 'present') | |
2208 | (or |
|
2208 | (or | |
2209 | (list |
|
2209 | (list | |
2210 | (symbol '0') |
|
2210 | (symbol '0') | |
2211 | (symbol '1') |
|
2211 | (symbol '1') | |
2212 | (symbol '2'))))) |
|
2212 | (symbol '2'))))) | |
2213 | * optimized: |
|
2213 | * optimized: | |
2214 | (and |
|
2214 | (and | |
2215 | (range |
|
2215 | (range | |
2216 | (symbol '2') |
|
2216 | (symbol '2') | |
2217 | (symbol '0')) |
|
2217 | (symbol '0')) | |
2218 | (func |
|
2218 | (func | |
2219 | (symbol 'present') |
|
2219 | (symbol 'present') | |
2220 | (func |
|
2220 | (func | |
2221 | (symbol '_list') |
|
2221 | (symbol '_list') | |
2222 | (string '0\x001\x002')))) |
|
2222 | (string '0\x001\x002')))) | |
2223 | * set: |
|
2223 | * set: | |
2224 | <filteredset |
|
2224 | <filteredset | |
2225 | <spanset- 0:3>, |
|
2225 | <spanset- 0:3>, | |
2226 | <baseset [0, 1, 2]>> |
|
2226 | <baseset [0, 1, 2]>> | |
2227 | 2 |
|
2227 | 2 | |
2228 | 1 |
|
2228 | 1 | |
2229 | 0 |
|
2229 | 0 | |
2230 |
|
2230 | |||
2231 | 'reverse()' should take effect only if it is the outermost expression: |
|
2231 | 'reverse()' should take effect only if it is the outermost expression: | |
2232 |
|
2232 | |||
2233 | $ try --optimize '0:2 & reverse(all())' |
|
2233 | $ try --optimize '0:2 & reverse(all())' | |
2234 | (and |
|
2234 | (and | |
2235 | (range |
|
2235 | (range | |
2236 | (symbol '0') |
|
2236 | (symbol '0') | |
2237 | (symbol '2')) |
|
2237 | (symbol '2')) | |
2238 | (func |
|
2238 | (func | |
2239 | (symbol 'reverse') |
|
2239 | (symbol 'reverse') | |
2240 | (func |
|
2240 | (func | |
2241 | (symbol 'all') |
|
2241 | (symbol 'all') | |
2242 | None))) |
|
2242 | None))) | |
2243 | * optimized: |
|
2243 | * optimized: | |
2244 | (and |
|
2244 | (and | |
2245 | (range |
|
2245 | (range | |
2246 | (symbol '0') |
|
2246 | (symbol '0') | |
2247 | (symbol '2')) |
|
2247 | (symbol '2')) | |
2248 | (func |
|
2248 | (func | |
2249 | (symbol 'reverse') |
|
2249 | (symbol 'reverse') | |
2250 | (func |
|
2250 | (func | |
2251 | (symbol 'all') |
|
2251 | (symbol 'all') | |
2252 | None))) |
|
2252 | None))) | |
2253 | * set: |
|
2253 | * set: | |
2254 | <filteredset |
|
2254 | <filteredset | |
2255 | <spanset+ 0:3>, |
|
2255 | <spanset+ 0:3>, | |
2256 | <spanset+ 0:10>> |
|
2256 | <spanset+ 0:10>> | |
2257 | 0 |
|
2257 | 0 | |
2258 | 1 |
|
2258 | 1 | |
2259 | 2 |
|
2259 | 2 | |
2260 |
|
2260 | |||
2261 | 'sort()' should take effect only if it is the outermost expression: |
|
2261 | 'sort()' should take effect only if it is the outermost expression: | |
2262 |
|
2262 | |||
2263 | $ try --optimize '0:2 & sort(all(), -rev)' |
|
2263 | $ try --optimize '0:2 & sort(all(), -rev)' | |
2264 | (and |
|
2264 | (and | |
2265 | (range |
|
2265 | (range | |
2266 | (symbol '0') |
|
2266 | (symbol '0') | |
2267 | (symbol '2')) |
|
2267 | (symbol '2')) | |
2268 | (func |
|
2268 | (func | |
2269 | (symbol 'sort') |
|
2269 | (symbol 'sort') | |
2270 | (list |
|
2270 | (list | |
2271 | (func |
|
2271 | (func | |
2272 | (symbol 'all') |
|
2272 | (symbol 'all') | |
2273 | None) |
|
2273 | None) | |
2274 | (negate |
|
2274 | (negate | |
2275 | (symbol 'rev'))))) |
|
2275 | (symbol 'rev'))))) | |
2276 | * optimized: |
|
2276 | * optimized: | |
2277 | (and |
|
2277 | (and | |
2278 | (range |
|
2278 | (range | |
2279 | (symbol '0') |
|
2279 | (symbol '0') | |
2280 | (symbol '2')) |
|
2280 | (symbol '2')) | |
2281 | (func |
|
2281 | (func | |
2282 | (symbol 'sort') |
|
2282 | (symbol 'sort') | |
2283 | (list |
|
2283 | (list | |
2284 | (func |
|
2284 | (func | |
2285 | (symbol 'all') |
|
2285 | (symbol 'all') | |
2286 | None) |
|
2286 | None) | |
2287 | (string '-rev')))) |
|
2287 | (string '-rev')))) | |
2288 | * set: |
|
2288 | * set: | |
2289 | <filteredset |
|
2289 | <filteredset | |
2290 | <spanset+ 0:3>, |
|
2290 | <spanset+ 0:3>, | |
2291 | <spanset+ 0:10>> |
|
2291 | <spanset+ 0:10>> | |
2292 | 0 |
|
2292 | 0 | |
2293 | 1 |
|
2293 | 1 | |
2294 | 2 |
|
2294 | 2 | |
2295 |
|
2295 | |||
2296 | invalid argument passed to noop sort(): |
|
2296 | invalid argument passed to noop sort(): | |
2297 |
|
2297 | |||
2298 | $ log '0:2 & sort()' |
|
2298 | $ log '0:2 & sort()' | |
2299 | hg: parse error: sort requires one or two arguments |
|
2299 | hg: parse error: sort requires one or two arguments | |
2300 | [255] |
|
2300 | [255] | |
2301 | $ log '0:2 & sort(all(), -invalid)' |
|
2301 | $ log '0:2 & sort(all(), -invalid)' | |
2302 | hg: parse error: unknown sort key '-invalid' |
|
2302 | hg: parse error: unknown sort key '-invalid' | |
2303 | [255] |
|
2303 | [255] | |
2304 |
|
2304 | |||
2305 | for 'A & f(B)', 'B' should not be affected by the order of 'A': |
|
2305 | for 'A & f(B)', 'B' should not be affected by the order of 'A': | |
2306 |
|
2306 | |||
2307 | $ try --optimize '2:0 & first(1 + 0 + 2)' |
|
2307 | $ try --optimize '2:0 & first(1 + 0 + 2)' | |
2308 | (and |
|
2308 | (and | |
2309 | (range |
|
2309 | (range | |
2310 | (symbol '2') |
|
2310 | (symbol '2') | |
2311 | (symbol '0')) |
|
2311 | (symbol '0')) | |
2312 | (func |
|
2312 | (func | |
2313 | (symbol 'first') |
|
2313 | (symbol 'first') | |
2314 | (or |
|
2314 | (or | |
2315 | (list |
|
2315 | (list | |
2316 | (symbol '1') |
|
2316 | (symbol '1') | |
2317 | (symbol '0') |
|
2317 | (symbol '0') | |
2318 | (symbol '2'))))) |
|
2318 | (symbol '2'))))) | |
2319 | * optimized: |
|
2319 | * optimized: | |
2320 | (and |
|
2320 | (and | |
2321 | (range |
|
2321 | (range | |
2322 | (symbol '2') |
|
2322 | (symbol '2') | |
2323 | (symbol '0')) |
|
2323 | (symbol '0')) | |
2324 | (func |
|
2324 | (func | |
2325 | (symbol 'first') |
|
2325 | (symbol 'first') | |
2326 | (func |
|
2326 | (func | |
2327 | (symbol '_list') |
|
2327 | (symbol '_list') | |
2328 | (string '1\x000\x002')))) |
|
2328 | (string '1\x000\x002')))) | |
2329 | * set: |
|
2329 | * set: | |
2330 | <filteredset |
|
2330 | <filteredset | |
2331 | <baseset [1]>, |
|
2331 | <baseset [1]>, | |
2332 | <spanset- 0:3>> |
|
2332 | <spanset- 0:3>> | |
2333 | 1 |
|
2333 | 1 | |
2334 |
|
2334 | |||
2335 | $ try --optimize '2:0 & not last(0 + 2 + 1)' |
|
2335 | $ try --optimize '2:0 & not last(0 + 2 + 1)' | |
2336 | (and |
|
2336 | (and | |
2337 | (range |
|
2337 | (range | |
2338 | (symbol '2') |
|
2338 | (symbol '2') | |
2339 | (symbol '0')) |
|
2339 | (symbol '0')) | |
2340 | (not |
|
2340 | (not | |
2341 | (func |
|
2341 | (func | |
2342 | (symbol 'last') |
|
2342 | (symbol 'last') | |
2343 | (or |
|
2343 | (or | |
2344 | (list |
|
2344 | (list | |
2345 | (symbol '0') |
|
2345 | (symbol '0') | |
2346 | (symbol '2') |
|
2346 | (symbol '2') | |
2347 | (symbol '1')))))) |
|
2347 | (symbol '1')))))) | |
2348 | * optimized: |
|
2348 | * optimized: | |
2349 | (difference |
|
2349 | (difference | |
2350 | (range |
|
2350 | (range | |
2351 | (symbol '2') |
|
2351 | (symbol '2') | |
2352 | (symbol '0')) |
|
2352 | (symbol '0')) | |
2353 | (func |
|
2353 | (func | |
2354 | (symbol 'last') |
|
2354 | (symbol 'last') | |
2355 | (func |
|
2355 | (func | |
2356 | (symbol '_list') |
|
2356 | (symbol '_list') | |
2357 | (string '0\x002\x001')))) |
|
2357 | (string '0\x002\x001')))) | |
2358 | * set: |
|
2358 | * set: | |
2359 | <filteredset |
|
2359 | <filteredset | |
2360 | <spanset- 0:3>, |
|
2360 | <spanset- 0:3>, | |
2361 | <not |
|
2361 | <not | |
2362 | <baseset [1]>>> |
|
2362 | <baseset [1]>>> | |
2363 | 2 |
|
2363 | 2 | |
2364 | 0 |
|
2364 | 0 | |
2365 |
|
2365 | |||
2366 | for 'A & (op)(B)', 'B' should not be affected by the order of 'A': |
|
2366 | for 'A & (op)(B)', 'B' should not be affected by the order of 'A': | |
2367 |
|
2367 | |||
2368 | $ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)' |
|
2368 | $ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)' | |
2369 | (and |
|
2369 | (and | |
2370 | (range |
|
2370 | (range | |
2371 | (symbol '2') |
|
2371 | (symbol '2') | |
2372 | (symbol '0')) |
|
2372 | (symbol '0')) | |
2373 | (range |
|
2373 | (range | |
2374 | (group |
|
2374 | (group | |
2375 | (or |
|
2375 | (or | |
2376 | (list |
|
2376 | (list | |
2377 | (symbol '1') |
|
2377 | (symbol '1') | |
2378 | (symbol '0') |
|
2378 | (symbol '0') | |
2379 | (symbol '2')))) |
|
2379 | (symbol '2')))) | |
2380 | (group |
|
2380 | (group | |
2381 | (or |
|
2381 | (or | |
2382 | (list |
|
2382 | (list | |
2383 | (symbol '0') |
|
2383 | (symbol '0') | |
2384 | (symbol '2') |
|
2384 | (symbol '2') | |
2385 | (symbol '1')))))) |
|
2385 | (symbol '1')))))) | |
2386 | * optimized: |
|
2386 | * optimized: | |
2387 | (and |
|
2387 | (and | |
2388 | (range |
|
2388 | (range | |
2389 | (symbol '2') |
|
2389 | (symbol '2') | |
2390 | (symbol '0')) |
|
2390 | (symbol '0')) | |
2391 | (range |
|
2391 | (range | |
2392 | (func |
|
2392 | (func | |
2393 | (symbol '_list') |
|
2393 | (symbol '_list') | |
2394 | (string '1\x000\x002')) |
|
2394 | (string '1\x000\x002')) | |
2395 | (func |
|
2395 | (func | |
2396 | (symbol '_list') |
|
2396 | (symbol '_list') | |
2397 | (string '0\x002\x001')))) |
|
2397 | (string '0\x002\x001')))) | |
2398 | * set: |
|
2398 | * set: | |
2399 | <filteredset |
|
2399 | <filteredset | |
2400 | <spanset- 0:3>, |
|
2400 | <spanset- 0:3>, | |
2401 | <baseset [1]>> |
|
2401 | <baseset [1]>> | |
2402 | 1 |
|
2402 | 1 | |
2403 |
|
2403 | |||
2404 | 'A & B' can be rewritten as 'flipand(B, A)' by weight. |
|
2404 | 'A & B' can be rewritten as 'flipand(B, A)' by weight. | |
2405 |
|
2405 | |||
2406 | $ try --optimize 'contains("glob:*") & (2 + 0 + 1)' |
|
2406 | $ try --optimize 'contains("glob:*") & (2 + 0 + 1)' | |
2407 | (and |
|
2407 | (and | |
2408 | (func |
|
2408 | (func | |
2409 | (symbol 'contains') |
|
2409 | (symbol 'contains') | |
2410 | (string 'glob:*')) |
|
2410 | (string 'glob:*')) | |
2411 | (group |
|
2411 | (group | |
2412 | (or |
|
2412 | (or | |
2413 | (list |
|
2413 | (list | |
2414 | (symbol '2') |
|
2414 | (symbol '2') | |
2415 | (symbol '0') |
|
2415 | (symbol '0') | |
2416 | (symbol '1'))))) |
|
2416 | (symbol '1'))))) | |
2417 | * optimized: |
|
2417 | * optimized: | |
2418 | (andsmally |
|
2418 | (andsmally | |
2419 | (func |
|
2419 | (func | |
2420 | (symbol 'contains') |
|
2420 | (symbol 'contains') | |
2421 | (string 'glob:*')) |
|
2421 | (string 'glob:*')) | |
2422 | (func |
|
2422 | (func | |
2423 | (symbol '_list') |
|
2423 | (symbol '_list') | |
2424 | (string '2\x000\x001'))) |
|
2424 | (string '2\x000\x001'))) | |
2425 | * set: |
|
2425 | * set: | |
2426 | <filteredset |
|
2426 | <filteredset | |
2427 | <baseset+ [0, 1, 2]>, |
|
2427 | <baseset+ [0, 1, 2]>, | |
2428 | <contains 'glob:*'>> |
|
2428 | <contains 'glob:*'>> | |
2429 | 0 |
|
2429 | 0 | |
2430 | 1 |
|
2430 | 1 | |
2431 | 2 |
|
2431 | 2 | |
2432 |
|
2432 | |||
2433 | and in this example, 'A & B' is rewritten as 'B & A', but 'A' overrides |
|
2433 | and in this example, 'A & B' is rewritten as 'B & A', but 'A' overrides | |
2434 | the order appropriately: |
|
2434 | the order appropriately: | |
2435 |
|
2435 | |||
2436 | $ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)' |
|
2436 | $ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)' | |
2437 | (and |
|
2437 | (and | |
2438 | (func |
|
2438 | (func | |
2439 | (symbol 'reverse') |
|
2439 | (symbol 'reverse') | |
2440 | (func |
|
2440 | (func | |
2441 | (symbol 'contains') |
|
2441 | (symbol 'contains') | |
2442 | (string 'glob:*'))) |
|
2442 | (string 'glob:*'))) | |
2443 | (group |
|
2443 | (group | |
2444 | (or |
|
2444 | (or | |
2445 | (list |
|
2445 | (list | |
2446 | (symbol '0') |
|
2446 | (symbol '0') | |
2447 | (symbol '2') |
|
2447 | (symbol '2') | |
2448 | (symbol '1'))))) |
|
2448 | (symbol '1'))))) | |
2449 | * optimized: |
|
2449 | * optimized: | |
2450 | (andsmally |
|
2450 | (andsmally | |
2451 | (func |
|
2451 | (func | |
2452 | (symbol 'reverse') |
|
2452 | (symbol 'reverse') | |
2453 | (func |
|
2453 | (func | |
2454 | (symbol 'contains') |
|
2454 | (symbol 'contains') | |
2455 | (string 'glob:*'))) |
|
2455 | (string 'glob:*'))) | |
2456 | (func |
|
2456 | (func | |
2457 | (symbol '_list') |
|
2457 | (symbol '_list') | |
2458 | (string '0\x002\x001'))) |
|
2458 | (string '0\x002\x001'))) | |
2459 | * set: |
|
2459 | * set: | |
2460 | <filteredset |
|
2460 | <filteredset | |
2461 | <baseset- [0, 1, 2]>, |
|
2461 | <baseset- [0, 1, 2]>, | |
2462 | <contains 'glob:*'>> |
|
2462 | <contains 'glob:*'>> | |
2463 | 2 |
|
2463 | 2 | |
2464 | 1 |
|
2464 | 1 | |
2465 | 0 |
|
2465 | 0 | |
2466 |
|
2466 | |||
2467 | test sort revset |
|
2467 | test sort revset | |
2468 | -------------------------------------------- |
|
2468 | -------------------------------------------- | |
2469 |
|
2469 | |||
2470 | test when adding two unordered revsets |
|
2470 | test when adding two unordered revsets | |
2471 |
|
2471 | |||
2472 | $ log 'sort(keyword(issue) or modifies(b))' |
|
2472 | $ log 'sort(keyword(issue) or modifies(b))' | |
2473 | 4 |
|
2473 | 4 | |
2474 | 6 |
|
2474 | 6 | |
2475 |
|
2475 | |||
2476 | test when sorting a reversed collection in the same way it is |
|
2476 | test when sorting a reversed collection in the same way it is | |
2477 |
|
2477 | |||
2478 | $ log 'sort(reverse(all()), -rev)' |
|
2478 | $ log 'sort(reverse(all()), -rev)' | |
2479 | 9 |
|
2479 | 9 | |
2480 | 8 |
|
2480 | 8 | |
2481 | 7 |
|
2481 | 7 | |
2482 | 6 |
|
2482 | 6 | |
2483 | 5 |
|
2483 | 5 | |
2484 | 4 |
|
2484 | 4 | |
2485 | 3 |
|
2485 | 3 | |
2486 | 2 |
|
2486 | 2 | |
2487 | 1 |
|
2487 | 1 | |
2488 | 0 |
|
2488 | 0 | |
2489 |
|
2489 | |||
2490 | test when sorting a reversed collection |
|
2490 | test when sorting a reversed collection | |
2491 |
|
2491 | |||
2492 | $ log 'sort(reverse(all()), rev)' |
|
2492 | $ log 'sort(reverse(all()), rev)' | |
2493 | 0 |
|
2493 | 0 | |
2494 | 1 |
|
2494 | 1 | |
2495 | 2 |
|
2495 | 2 | |
2496 | 3 |
|
2496 | 3 | |
2497 | 4 |
|
2497 | 4 | |
2498 | 5 |
|
2498 | 5 | |
2499 | 6 |
|
2499 | 6 | |
2500 | 7 |
|
2500 | 7 | |
2501 | 8 |
|
2501 | 8 | |
2502 | 9 |
|
2502 | 9 | |
2503 |
|
2503 | |||
2504 |
|
2504 | |||
2505 | test sorting two sorted collections in different orders |
|
2505 | test sorting two sorted collections in different orders | |
2506 |
|
2506 | |||
2507 | $ log 'sort(outgoing() or reverse(removes(a)), rev)' |
|
2507 | $ log 'sort(outgoing() or reverse(removes(a)), rev)' | |
2508 | 2 |
|
2508 | 2 | |
2509 | 6 |
|
2509 | 6 | |
2510 | 8 |
|
2510 | 8 | |
2511 | 9 |
|
2511 | 9 | |
2512 |
|
2512 | |||
2513 | test sorting two sorted collections in different orders backwards |
|
2513 | test sorting two sorted collections in different orders backwards | |
2514 |
|
2514 | |||
2515 | $ log 'sort(outgoing() or reverse(removes(a)), -rev)' |
|
2515 | $ log 'sort(outgoing() or reverse(removes(a)), -rev)' | |
2516 | 9 |
|
2516 | 9 | |
2517 | 8 |
|
2517 | 8 | |
2518 | 6 |
|
2518 | 6 | |
2519 | 2 |
|
2519 | 2 | |
2520 |
|
2520 | |||
2521 | test empty sort key which is noop |
|
2521 | test empty sort key which is noop | |
2522 |
|
2522 | |||
2523 | $ log 'sort(0 + 2 + 1, "")' |
|
2523 | $ log 'sort(0 + 2 + 1, "")' | |
2524 | 0 |
|
2524 | 0 | |
2525 | 2 |
|
2525 | 2 | |
2526 | 1 |
|
2526 | 1 | |
2527 |
|
2527 | |||
2528 | test invalid sort keys |
|
2528 | test invalid sort keys | |
2529 |
|
2529 | |||
2530 | $ log 'sort(all(), -invalid)' |
|
2530 | $ log 'sort(all(), -invalid)' | |
2531 | hg: parse error: unknown sort key '-invalid' |
|
2531 | hg: parse error: unknown sort key '-invalid' | |
2532 | [255] |
|
2532 | [255] | |
2533 |
|
2533 | |||
2534 | $ cd .. |
|
2534 | $ cd .. | |
2535 |
|
2535 | |||
2536 | test sorting by multiple keys including variable-length strings |
|
2536 | test sorting by multiple keys including variable-length strings | |
2537 |
|
2537 | |||
2538 | $ hg init sorting |
|
2538 | $ hg init sorting | |
2539 | $ cd sorting |
|
2539 | $ cd sorting | |
2540 | $ cat <<EOF >> .hg/hgrc |
|
2540 | $ cat <<EOF >> .hg/hgrc | |
2541 | > [ui] |
|
2541 | > [ui] | |
2542 | > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n' |
|
2542 | > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n' | |
2543 | > [templatealias] |
|
2543 | > [templatealias] | |
2544 | > p5(s) = pad(s, 5) |
|
2544 | > p5(s) = pad(s, 5) | |
2545 | > EOF |
|
2545 | > EOF | |
2546 | $ hg branch -qf b12 |
|
2546 | $ hg branch -qf b12 | |
2547 | $ hg ci -m m111 -u u112 -d '111 10800' |
|
2547 | $ hg ci -m m111 -u u112 -d '111 10800' | |
2548 | $ hg branch -qf b11 |
|
2548 | $ hg branch -qf b11 | |
2549 | $ hg ci -m m12 -u u111 -d '112 7200' |
|
2549 | $ hg ci -m m12 -u u111 -d '112 7200' | |
2550 | $ hg branch -qf b111 |
|
2550 | $ hg branch -qf b111 | |
2551 | $ hg ci -m m11 -u u12 -d '111 3600' |
|
2551 | $ hg ci -m m11 -u u12 -d '111 3600' | |
2552 | $ hg branch -qf b112 |
|
2552 | $ hg branch -qf b112 | |
2553 | $ hg ci -m m111 -u u11 -d '120 0' |
|
2553 | $ hg ci -m m111 -u u11 -d '120 0' | |
2554 | $ hg branch -qf b111 |
|
2554 | $ hg branch -qf b111 | |
2555 | $ hg ci -m m112 -u u111 -d '110 14400' |
|
2555 | $ hg ci -m m112 -u u111 -d '110 14400' | |
2556 | created new head |
|
2556 | created new head | |
2557 |
|
2557 | |||
2558 | compare revisions (has fast path): |
|
2558 | compare revisions (has fast path): | |
2559 |
|
2559 | |||
2560 | $ hg log -r 'sort(all(), rev)' |
|
2560 | $ hg log -r 'sort(all(), rev)' | |
2561 | 0 b12 m111 u112 111 10800 |
|
2561 | 0 b12 m111 u112 111 10800 | |
2562 | 1 b11 m12 u111 112 7200 |
|
2562 | 1 b11 m12 u111 112 7200 | |
2563 | 2 b111 m11 u12 111 3600 |
|
2563 | 2 b111 m11 u12 111 3600 | |
2564 | 3 b112 m111 u11 120 0 |
|
2564 | 3 b112 m111 u11 120 0 | |
2565 | 4 b111 m112 u111 110 14400 |
|
2565 | 4 b111 m112 u111 110 14400 | |
2566 |
|
2566 | |||
2567 | $ hg log -r 'sort(all(), -rev)' |
|
2567 | $ hg log -r 'sort(all(), -rev)' | |
2568 | 4 b111 m112 u111 110 14400 |
|
2568 | 4 b111 m112 u111 110 14400 | |
2569 | 3 b112 m111 u11 120 0 |
|
2569 | 3 b112 m111 u11 120 0 | |
2570 | 2 b111 m11 u12 111 3600 |
|
2570 | 2 b111 m11 u12 111 3600 | |
2571 | 1 b11 m12 u111 112 7200 |
|
2571 | 1 b11 m12 u111 112 7200 | |
2572 | 0 b12 m111 u112 111 10800 |
|
2572 | 0 b12 m111 u112 111 10800 | |
2573 |
|
2573 | |||
2574 | compare variable-length strings (issue5218): |
|
2574 | compare variable-length strings (issue5218): | |
2575 |
|
2575 | |||
2576 | $ hg log -r 'sort(all(), branch)' |
|
2576 | $ hg log -r 'sort(all(), branch)' | |
2577 | 1 b11 m12 u111 112 7200 |
|
2577 | 1 b11 m12 u111 112 7200 | |
2578 | 2 b111 m11 u12 111 3600 |
|
2578 | 2 b111 m11 u12 111 3600 | |
2579 | 4 b111 m112 u111 110 14400 |
|
2579 | 4 b111 m112 u111 110 14400 | |
2580 | 3 b112 m111 u11 120 0 |
|
2580 | 3 b112 m111 u11 120 0 | |
2581 | 0 b12 m111 u112 111 10800 |
|
2581 | 0 b12 m111 u112 111 10800 | |
2582 |
|
2582 | |||
2583 | $ hg log -r 'sort(all(), -branch)' |
|
2583 | $ hg log -r 'sort(all(), -branch)' | |
2584 | 0 b12 m111 u112 111 10800 |
|
2584 | 0 b12 m111 u112 111 10800 | |
2585 | 3 b112 m111 u11 120 0 |
|
2585 | 3 b112 m111 u11 120 0 | |
2586 | 2 b111 m11 u12 111 3600 |
|
2586 | 2 b111 m11 u12 111 3600 | |
2587 | 4 b111 m112 u111 110 14400 |
|
2587 | 4 b111 m112 u111 110 14400 | |
2588 | 1 b11 m12 u111 112 7200 |
|
2588 | 1 b11 m12 u111 112 7200 | |
2589 |
|
2589 | |||
2590 | $ hg log -r 'sort(all(), desc)' |
|
2590 | $ hg log -r 'sort(all(), desc)' | |
2591 | 2 b111 m11 u12 111 3600 |
|
2591 | 2 b111 m11 u12 111 3600 | |
2592 | 0 b12 m111 u112 111 10800 |
|
2592 | 0 b12 m111 u112 111 10800 | |
2593 | 3 b112 m111 u11 120 0 |
|
2593 | 3 b112 m111 u11 120 0 | |
2594 | 4 b111 m112 u111 110 14400 |
|
2594 | 4 b111 m112 u111 110 14400 | |
2595 | 1 b11 m12 u111 112 7200 |
|
2595 | 1 b11 m12 u111 112 7200 | |
2596 |
|
2596 | |||
2597 | $ hg log -r 'sort(all(), -desc)' |
|
2597 | $ hg log -r 'sort(all(), -desc)' | |
2598 | 1 b11 m12 u111 112 7200 |
|
2598 | 1 b11 m12 u111 112 7200 | |
2599 | 4 b111 m112 u111 110 14400 |
|
2599 | 4 b111 m112 u111 110 14400 | |
2600 | 0 b12 m111 u112 111 10800 |
|
2600 | 0 b12 m111 u112 111 10800 | |
2601 | 3 b112 m111 u11 120 0 |
|
2601 | 3 b112 m111 u11 120 0 | |
2602 | 2 b111 m11 u12 111 3600 |
|
2602 | 2 b111 m11 u12 111 3600 | |
2603 |
|
2603 | |||
2604 | $ hg log -r 'sort(all(), user)' |
|
2604 | $ hg log -r 'sort(all(), user)' | |
2605 | 3 b112 m111 u11 120 0 |
|
2605 | 3 b112 m111 u11 120 0 | |
2606 | 1 b11 m12 u111 112 7200 |
|
2606 | 1 b11 m12 u111 112 7200 | |
2607 | 4 b111 m112 u111 110 14400 |
|
2607 | 4 b111 m112 u111 110 14400 | |
2608 | 0 b12 m111 u112 111 10800 |
|
2608 | 0 b12 m111 u112 111 10800 | |
2609 | 2 b111 m11 u12 111 3600 |
|
2609 | 2 b111 m11 u12 111 3600 | |
2610 |
|
2610 | |||
2611 | $ hg log -r 'sort(all(), -user)' |
|
2611 | $ hg log -r 'sort(all(), -user)' | |
2612 | 2 b111 m11 u12 111 3600 |
|
2612 | 2 b111 m11 u12 111 3600 | |
2613 | 0 b12 m111 u112 111 10800 |
|
2613 | 0 b12 m111 u112 111 10800 | |
2614 | 1 b11 m12 u111 112 7200 |
|
2614 | 1 b11 m12 u111 112 7200 | |
2615 | 4 b111 m112 u111 110 14400 |
|
2615 | 4 b111 m112 u111 110 14400 | |
2616 | 3 b112 m111 u11 120 0 |
|
2616 | 3 b112 m111 u11 120 0 | |
2617 |
|
2617 | |||
2618 | compare dates (tz offset should have no effect): |
|
2618 | compare dates (tz offset should have no effect): | |
2619 |
|
2619 | |||
2620 | $ hg log -r 'sort(all(), date)' |
|
2620 | $ hg log -r 'sort(all(), date)' | |
2621 | 4 b111 m112 u111 110 14400 |
|
2621 | 4 b111 m112 u111 110 14400 | |
2622 | 0 b12 m111 u112 111 10800 |
|
2622 | 0 b12 m111 u112 111 10800 | |
2623 | 2 b111 m11 u12 111 3600 |
|
2623 | 2 b111 m11 u12 111 3600 | |
2624 | 1 b11 m12 u111 112 7200 |
|
2624 | 1 b11 m12 u111 112 7200 | |
2625 | 3 b112 m111 u11 120 0 |
|
2625 | 3 b112 m111 u11 120 0 | |
2626 |
|
2626 | |||
2627 | $ hg log -r 'sort(all(), -date)' |
|
2627 | $ hg log -r 'sort(all(), -date)' | |
2628 | 3 b112 m111 u11 120 0 |
|
2628 | 3 b112 m111 u11 120 0 | |
2629 | 1 b11 m12 u111 112 7200 |
|
2629 | 1 b11 m12 u111 112 7200 | |
2630 | 0 b12 m111 u112 111 10800 |
|
2630 | 0 b12 m111 u112 111 10800 | |
2631 | 2 b111 m11 u12 111 3600 |
|
2631 | 2 b111 m11 u12 111 3600 | |
2632 | 4 b111 m112 u111 110 14400 |
|
2632 | 4 b111 m112 u111 110 14400 | |
2633 |
|
2633 | |||
2634 | be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))' |
|
2634 | be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))' | |
2635 | because '-k' reverses the comparison, not the list itself: |
|
2635 | because '-k' reverses the comparison, not the list itself: | |
2636 |
|
2636 | |||
2637 | $ hg log -r 'sort(0 + 2, date)' |
|
2637 | $ hg log -r 'sort(0 + 2, date)' | |
2638 | 0 b12 m111 u112 111 10800 |
|
2638 | 0 b12 m111 u112 111 10800 | |
2639 | 2 b111 m11 u12 111 3600 |
|
2639 | 2 b111 m11 u12 111 3600 | |
2640 |
|
2640 | |||
2641 | $ hg log -r 'sort(0 + 2, -date)' |
|
2641 | $ hg log -r 'sort(0 + 2, -date)' | |
2642 | 0 b12 m111 u112 111 10800 |
|
2642 | 0 b12 m111 u112 111 10800 | |
2643 | 2 b111 m11 u12 111 3600 |
|
2643 | 2 b111 m11 u12 111 3600 | |
2644 |
|
2644 | |||
2645 | $ hg log -r 'reverse(sort(0 + 2, date))' |
|
2645 | $ hg log -r 'reverse(sort(0 + 2, date))' | |
2646 | 2 b111 m11 u12 111 3600 |
|
2646 | 2 b111 m11 u12 111 3600 | |
2647 | 0 b12 m111 u112 111 10800 |
|
2647 | 0 b12 m111 u112 111 10800 | |
2648 |
|
2648 | |||
2649 | sort by multiple keys: |
|
2649 | sort by multiple keys: | |
2650 |
|
2650 | |||
2651 | $ hg log -r 'sort(all(), "branch -rev")' |
|
2651 | $ hg log -r 'sort(all(), "branch -rev")' | |
2652 | 1 b11 m12 u111 112 7200 |
|
2652 | 1 b11 m12 u111 112 7200 | |
2653 | 4 b111 m112 u111 110 14400 |
|
2653 | 4 b111 m112 u111 110 14400 | |
2654 | 2 b111 m11 u12 111 3600 |
|
2654 | 2 b111 m11 u12 111 3600 | |
2655 | 3 b112 m111 u11 120 0 |
|
2655 | 3 b112 m111 u11 120 0 | |
2656 | 0 b12 m111 u112 111 10800 |
|
2656 | 0 b12 m111 u112 111 10800 | |
2657 |
|
2657 | |||
2658 | $ hg log -r 'sort(all(), "-desc -date")' |
|
2658 | $ hg log -r 'sort(all(), "-desc -date")' | |
2659 | 1 b11 m12 u111 112 7200 |
|
2659 | 1 b11 m12 u111 112 7200 | |
2660 | 4 b111 m112 u111 110 14400 |
|
2660 | 4 b111 m112 u111 110 14400 | |
2661 | 3 b112 m111 u11 120 0 |
|
2661 | 3 b112 m111 u11 120 0 | |
2662 | 0 b12 m111 u112 111 10800 |
|
2662 | 0 b12 m111 u112 111 10800 | |
2663 | 2 b111 m11 u12 111 3600 |
|
2663 | 2 b111 m11 u12 111 3600 | |
2664 |
|
2664 | |||
2665 | $ hg log -r 'sort(all(), "user -branch date rev")' |
|
2665 | $ hg log -r 'sort(all(), "user -branch date rev")' | |
2666 | 3 b112 m111 u11 120 0 |
|
2666 | 3 b112 m111 u11 120 0 | |
2667 | 4 b111 m112 u111 110 14400 |
|
2667 | 4 b111 m112 u111 110 14400 | |
2668 | 1 b11 m12 u111 112 7200 |
|
2668 | 1 b11 m12 u111 112 7200 | |
2669 | 0 b12 m111 u112 111 10800 |
|
2669 | 0 b12 m111 u112 111 10800 | |
2670 | 2 b111 m11 u12 111 3600 |
|
2670 | 2 b111 m11 u12 111 3600 | |
2671 |
|
2671 | |||
2672 | toposort prioritises graph branches |
|
2672 | toposort prioritises graph branches | |
2673 |
|
2673 | |||
2674 | $ hg up 2 |
|
2674 | $ hg up 2 | |
2675 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2675 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2676 | $ touch a |
|
2676 | $ touch a | |
2677 | $ hg addremove |
|
2677 | $ hg addremove | |
2678 | adding a |
|
2678 | adding a | |
2679 | $ hg ci -m 't1' -u 'tu' -d '130 0' |
|
2679 | $ hg ci -m 't1' -u 'tu' -d '130 0' | |
2680 | created new head |
|
2680 | created new head | |
2681 | $ echo 'a' >> a |
|
2681 | $ echo 'a' >> a | |
2682 | $ hg ci -m 't2' -u 'tu' -d '130 0' |
|
2682 | $ hg ci -m 't2' -u 'tu' -d '130 0' | |
2683 | $ hg book book1 |
|
2683 | $ hg book book1 | |
2684 | $ hg up 4 |
|
2684 | $ hg up 4 | |
2685 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
2685 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
2686 | (leaving bookmark book1) |
|
2686 | (leaving bookmark book1) | |
2687 | $ touch a |
|
2687 | $ touch a | |
2688 | $ hg addremove |
|
2688 | $ hg addremove | |
2689 | adding a |
|
2689 | adding a | |
2690 | $ hg ci -m 't3' -u 'tu' -d '130 0' |
|
2690 | $ hg ci -m 't3' -u 'tu' -d '130 0' | |
2691 |
|
2691 | |||
2692 | $ hg log -r 'sort(all(), topo)' |
|
2692 | $ hg log -r 'sort(all(), topo)' | |
2693 | 7 b111 t3 tu 130 0 |
|
2693 | 7 b111 t3 tu 130 0 | |
2694 | 4 b111 m112 u111 110 14400 |
|
2694 | 4 b111 m112 u111 110 14400 | |
2695 | 3 b112 m111 u11 120 0 |
|
2695 | 3 b112 m111 u11 120 0 | |
2696 | 6 b111 t2 tu 130 0 |
|
2696 | 6 b111 t2 tu 130 0 | |
2697 | 5 b111 t1 tu 130 0 |
|
2697 | 5 b111 t1 tu 130 0 | |
2698 | 2 b111 m11 u12 111 3600 |
|
2698 | 2 b111 m11 u12 111 3600 | |
2699 | 1 b11 m12 u111 112 7200 |
|
2699 | 1 b11 m12 u111 112 7200 | |
2700 | 0 b12 m111 u112 111 10800 |
|
2700 | 0 b12 m111 u112 111 10800 | |
2701 |
|
2701 | |||
2702 | $ hg log -r 'sort(all(), -topo)' |
|
2702 | $ hg log -r 'sort(all(), -topo)' | |
2703 | 0 b12 m111 u112 111 10800 |
|
2703 | 0 b12 m111 u112 111 10800 | |
2704 | 1 b11 m12 u111 112 7200 |
|
2704 | 1 b11 m12 u111 112 7200 | |
2705 | 2 b111 m11 u12 111 3600 |
|
2705 | 2 b111 m11 u12 111 3600 | |
2706 | 5 b111 t1 tu 130 0 |
|
2706 | 5 b111 t1 tu 130 0 | |
2707 | 6 b111 t2 tu 130 0 |
|
2707 | 6 b111 t2 tu 130 0 | |
2708 | 3 b112 m111 u11 120 0 |
|
2708 | 3 b112 m111 u11 120 0 | |
2709 | 4 b111 m112 u111 110 14400 |
|
2709 | 4 b111 m112 u111 110 14400 | |
2710 | 7 b111 t3 tu 130 0 |
|
2710 | 7 b111 t3 tu 130 0 | |
2711 |
|
2711 | |||
2712 | $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)' |
|
2712 | $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)' | |
2713 | 6 b111 t2 tu 130 0 |
|
2713 | 6 b111 t2 tu 130 0 | |
2714 | 5 b111 t1 tu 130 0 |
|
2714 | 5 b111 t1 tu 130 0 | |
2715 | 7 b111 t3 tu 130 0 |
|
2715 | 7 b111 t3 tu 130 0 | |
2716 | 4 b111 m112 u111 110 14400 |
|
2716 | 4 b111 m112 u111 110 14400 | |
2717 | 3 b112 m111 u11 120 0 |
|
2717 | 3 b112 m111 u11 120 0 | |
2718 | 2 b111 m11 u12 111 3600 |
|
2718 | 2 b111 m11 u12 111 3600 | |
2719 | 1 b11 m12 u111 112 7200 |
|
2719 | 1 b11 m12 u111 112 7200 | |
2720 | 0 b12 m111 u112 111 10800 |
|
2720 | 0 b12 m111 u112 111 10800 | |
2721 |
|
2721 | |||
2722 | topographical sorting can't be combined with other sort keys, and you can't |
|
2722 | topographical sorting can't be combined with other sort keys, and you can't | |
2723 | use the topo.firstbranch option when topo sort is not active: |
|
2723 | use the topo.firstbranch option when topo sort is not active: | |
2724 |
|
2724 | |||
2725 | $ hg log -r 'sort(all(), "topo user")' |
|
2725 | $ hg log -r 'sort(all(), "topo user")' | |
2726 | hg: parse error: topo sort order cannot be combined with other sort keys |
|
2726 | hg: parse error: topo sort order cannot be combined with other sort keys | |
2727 | [255] |
|
2727 | [255] | |
2728 |
|
2728 | |||
2729 | $ hg log -r 'sort(all(), user, topo.firstbranch=book1)' |
|
2729 | $ hg log -r 'sort(all(), user, topo.firstbranch=book1)' | |
2730 | hg: parse error: topo.firstbranch can only be used when using the topo sort key |
|
2730 | hg: parse error: topo.firstbranch can only be used when using the topo sort key | |
2731 | [255] |
|
2731 | [255] | |
2732 |
|
2732 | |||
2733 | topo.firstbranch should accept any kind of expressions: |
|
2733 | topo.firstbranch should accept any kind of expressions: | |
2734 |
|
2734 | |||
2735 | $ hg log -r 'sort(0, topo, topo.firstbranch=(book1))' |
|
2735 | $ hg log -r 'sort(0, topo, topo.firstbranch=(book1))' | |
2736 | 0 b12 m111 u112 111 10800 |
|
2736 | 0 b12 m111 u112 111 10800 | |
2737 |
|
2737 | |||
2738 | $ cd .. |
|
2738 | $ cd .. | |
2739 | $ cd repo |
|
2739 | $ cd repo | |
2740 |
|
||||
2741 | test subtracting something from an addset |
|
|||
2742 |
|
||||
2743 | $ log '(outgoing() or removes(a)) - removes(a)' |
|
|||
2744 | 8 |
|
|||
2745 | 9 |
|
|||
2746 |
|
||||
2747 | test intersecting something with an addset |
|
|||
2748 |
|
||||
2749 | $ log 'parents(outgoing() or removes(a))' |
|
|||
2750 | 1 |
|
|||
2751 | 4 |
|
|||
2752 | 5 |
|
|||
2753 | 8 |
|
|||
2754 |
|
||||
2755 | test that `or` operation combines elements in the right order: |
|
|||
2756 |
|
||||
2757 | $ log '3:4 or 2:5' |
|
|||
2758 | 3 |
|
|||
2759 | 4 |
|
|||
2760 | 2 |
|
|||
2761 | 5 |
|
|||
2762 | $ log '3:4 or 5:2' |
|
|||
2763 | 3 |
|
|||
2764 | 4 |
|
|||
2765 | 5 |
|
|||
2766 | 2 |
|
|||
2767 | $ log 'sort(3:4 or 2:5)' |
|
|||
2768 | 2 |
|
|||
2769 | 3 |
|
|||
2770 | 4 |
|
|||
2771 | 5 |
|
|||
2772 | $ log 'sort(3:4 or 5:2)' |
|
|||
2773 | 2 |
|
|||
2774 | 3 |
|
|||
2775 | 4 |
|
|||
2776 | 5 |
|
|||
2777 |
|
||||
2778 | test that more than one `-r`s are combined in the right order and deduplicated: |
|
|||
2779 |
|
||||
2780 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' |
|
|||
2781 | 3 |
|
|||
2782 | 4 |
|
|||
2783 | 5 |
|
|||
2784 | 2 |
|
|||
2785 | 0 |
|
|||
2786 | 1 |
|
|||
2787 |
|
||||
2788 | test that `or` operation skips duplicated revisions from right-hand side |
|
|||
2789 |
|
||||
2790 | $ try 'reverse(1::5) or ancestors(4)' |
|
|||
2791 | (or |
|
|||
2792 | (list |
|
|||
2793 | (func |
|
|||
2794 | (symbol 'reverse') |
|
|||
2795 | (dagrange |
|
|||
2796 | (symbol '1') |
|
|||
2797 | (symbol '5'))) |
|
|||
2798 | (func |
|
|||
2799 | (symbol 'ancestors') |
|
|||
2800 | (symbol '4')))) |
|
|||
2801 | * set: |
|
|||
2802 | <addset |
|
|||
2803 | <baseset- [1, 3, 5]>, |
|
|||
2804 | <generatorset+>> |
|
|||
2805 | 5 |
|
|||
2806 | 3 |
|
|||
2807 | 1 |
|
|||
2808 | 0 |
|
|||
2809 | 2 |
|
|||
2810 | 4 |
|
|||
2811 | $ try 'sort(ancestors(4) or reverse(1::5))' |
|
|||
2812 | (func |
|
|||
2813 | (symbol 'sort') |
|
|||
2814 | (or |
|
|||
2815 | (list |
|
|||
2816 | (func |
|
|||
2817 | (symbol 'ancestors') |
|
|||
2818 | (symbol '4')) |
|
|||
2819 | (func |
|
|||
2820 | (symbol 'reverse') |
|
|||
2821 | (dagrange |
|
|||
2822 | (symbol '1') |
|
|||
2823 | (symbol '5')))))) |
|
|||
2824 | * set: |
|
|||
2825 | <addset+ |
|
|||
2826 | <generatorset+>, |
|
|||
2827 | <baseset- [1, 3, 5]>> |
|
|||
2828 | 0 |
|
|||
2829 | 1 |
|
|||
2830 | 2 |
|
|||
2831 | 3 |
|
|||
2832 | 4 |
|
|||
2833 | 5 |
|
|||
2834 |
|
||||
2835 | test optimization of trivial `or` operation |
|
|||
2836 |
|
||||
2837 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
|||
2838 | (or |
|
|||
2839 | (list |
|
|||
2840 | (symbol '0') |
|
|||
2841 | (group |
|
|||
2842 | (symbol '1')) |
|
|||
2843 | (string '2') |
|
|||
2844 | (negate |
|
|||
2845 | (symbol '2')) |
|
|||
2846 | (symbol 'tip') |
|
|||
2847 | (symbol 'null'))) |
|
|||
2848 | * optimized: |
|
|||
2849 | (func |
|
|||
2850 | (symbol '_list') |
|
|||
2851 | (string '0\x001\x002\x00-2\x00tip\x00null')) |
|
|||
2852 | * set: |
|
|||
2853 | <baseset [0, 1, 2, 8, 9, -1]> |
|
|||
2854 | 0 |
|
|||
2855 | 1 |
|
|||
2856 | 2 |
|
|||
2857 | 8 |
|
|||
2858 | 9 |
|
|||
2859 | -1 |
|
|||
2860 |
|
||||
2861 | $ try --optimize '0|1|2:3' |
|
|||
2862 | (or |
|
|||
2863 | (list |
|
|||
2864 | (symbol '0') |
|
|||
2865 | (symbol '1') |
|
|||
2866 | (range |
|
|||
2867 | (symbol '2') |
|
|||
2868 | (symbol '3')))) |
|
|||
2869 | * optimized: |
|
|||
2870 | (or |
|
|||
2871 | (list |
|
|||
2872 | (func |
|
|||
2873 | (symbol '_list') |
|
|||
2874 | (string '0\x001')) |
|
|||
2875 | (range |
|
|||
2876 | (symbol '2') |
|
|||
2877 | (symbol '3')))) |
|
|||
2878 | * set: |
|
|||
2879 | <addset |
|
|||
2880 | <baseset [0, 1]>, |
|
|||
2881 | <spanset+ 2:4>> |
|
|||
2882 | 0 |
|
|||
2883 | 1 |
|
|||
2884 | 2 |
|
|||
2885 | 3 |
|
|||
2886 |
|
||||
2887 | $ try --optimize '0:1|2|3:4|5|6' |
|
|||
2888 | (or |
|
|||
2889 | (list |
|
|||
2890 | (range |
|
|||
2891 | (symbol '0') |
|
|||
2892 | (symbol '1')) |
|
|||
2893 | (symbol '2') |
|
|||
2894 | (range |
|
|||
2895 | (symbol '3') |
|
|||
2896 | (symbol '4')) |
|
|||
2897 | (symbol '5') |
|
|||
2898 | (symbol '6'))) |
|
|||
2899 | * optimized: |
|
|||
2900 | (or |
|
|||
2901 | (list |
|
|||
2902 | (range |
|
|||
2903 | (symbol '0') |
|
|||
2904 | (symbol '1')) |
|
|||
2905 | (symbol '2') |
|
|||
2906 | (range |
|
|||
2907 | (symbol '3') |
|
|||
2908 | (symbol '4')) |
|
|||
2909 | (func |
|
|||
2910 | (symbol '_list') |
|
|||
2911 | (string '5\x006')))) |
|
|||
2912 | * set: |
|
|||
2913 | <addset |
|
|||
2914 | <addset |
|
|||
2915 | <spanset+ 0:2>, |
|
|||
2916 | <baseset [2]>>, |
|
|||
2917 | <addset |
|
|||
2918 | <spanset+ 3:5>, |
|
|||
2919 | <baseset [5, 6]>>> |
|
|||
2920 | 0 |
|
|||
2921 | 1 |
|
|||
2922 | 2 |
|
|||
2923 | 3 |
|
|||
2924 | 4 |
|
|||
2925 | 5 |
|
|||
2926 | 6 |
|
|||
2927 |
|
||||
2928 | unoptimized `or` looks like this |
|
|||
2929 |
|
||||
2930 | $ try --no-optimized -p analyzed '0|1|2|3|4' |
|
|||
2931 | * analyzed: |
|
|||
2932 | (or |
|
|||
2933 | (list |
|
|||
2934 | (symbol '0') |
|
|||
2935 | (symbol '1') |
|
|||
2936 | (symbol '2') |
|
|||
2937 | (symbol '3') |
|
|||
2938 | (symbol '4'))) |
|
|||
2939 | * set: |
|
|||
2940 | <addset |
|
|||
2941 | <addset |
|
|||
2942 | <baseset [0]>, |
|
|||
2943 | <baseset [1]>>, |
|
|||
2944 | <addset |
|
|||
2945 | <baseset [2]>, |
|
|||
2946 | <addset |
|
|||
2947 | <baseset [3]>, |
|
|||
2948 | <baseset [4]>>>> |
|
|||
2949 | 0 |
|
|||
2950 | 1 |
|
|||
2951 | 2 |
|
|||
2952 | 3 |
|
|||
2953 | 4 |
|
|||
2954 |
|
||||
2955 | test that `_list` should be narrowed by provided `subset` |
|
|||
2956 |
|
||||
2957 | $ log '0:2 and (null|1|2|3)' |
|
|||
2958 | 1 |
|
|||
2959 | 2 |
|
|||
2960 |
|
||||
2961 | test that `_list` should remove duplicates |
|
|||
2962 |
|
||||
2963 | $ log '0|1|2|1|2|-1|tip' |
|
|||
2964 | 0 |
|
|||
2965 | 1 |
|
|||
2966 | 2 |
|
|||
2967 | 9 |
|
|||
2968 |
|
||||
2969 | test unknown revision in `_list` |
|
|||
2970 |
|
||||
2971 | $ log '0|unknown' |
|
|||
2972 | abort: unknown revision 'unknown'! |
|
|||
2973 | [255] |
|
|||
2974 |
|
||||
2975 | test integer range in `_list` |
|
|||
2976 |
|
||||
2977 | $ log '-1|-10' |
|
|||
2978 | 9 |
|
|||
2979 | 0 |
|
|||
2980 |
|
||||
2981 | $ log '-10|-11' |
|
|||
2982 | abort: unknown revision '-11'! |
|
|||
2983 | [255] |
|
|||
2984 |
|
||||
2985 | $ log '9|10' |
|
|||
2986 | abort: unknown revision '10'! |
|
|||
2987 | [255] |
|
|||
2988 |
|
||||
2989 | test '0000' != '0' in `_list` |
|
|||
2990 |
|
||||
2991 | $ log '0|0000' |
|
|||
2992 | 0 |
|
|||
2993 | -1 |
|
|||
2994 |
|
||||
2995 | test ',' in `_list` |
|
|||
2996 | $ log '0,1' |
|
|||
2997 | hg: parse error: can't use a list in this context |
|
|||
2998 | (see hg help "revsets.x or y") |
|
|||
2999 | [255] |
|
|||
3000 | $ try '0,1,2' |
|
|||
3001 | (list |
|
|||
3002 | (symbol '0') |
|
|||
3003 | (symbol '1') |
|
|||
3004 | (symbol '2')) |
|
|||
3005 | hg: parse error: can't use a list in this context |
|
|||
3006 | (see hg help "revsets.x or y") |
|
|||
3007 | [255] |
|
|||
3008 |
|
||||
3009 | test that chained `or` operations make balanced addsets |
|
|||
3010 |
|
||||
3011 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
|||
3012 | (or |
|
|||
3013 | (list |
|
|||
3014 | (range |
|
|||
3015 | (symbol '0') |
|
|||
3016 | (symbol '1')) |
|
|||
3017 | (range |
|
|||
3018 | (symbol '1') |
|
|||
3019 | (symbol '2')) |
|
|||
3020 | (range |
|
|||
3021 | (symbol '2') |
|
|||
3022 | (symbol '3')) |
|
|||
3023 | (range |
|
|||
3024 | (symbol '3') |
|
|||
3025 | (symbol '4')) |
|
|||
3026 | (range |
|
|||
3027 | (symbol '4') |
|
|||
3028 | (symbol '5')))) |
|
|||
3029 | * set: |
|
|||
3030 | <addset |
|
|||
3031 | <addset |
|
|||
3032 | <spanset+ 0:2>, |
|
|||
3033 | <spanset+ 1:3>>, |
|
|||
3034 | <addset |
|
|||
3035 | <spanset+ 2:4>, |
|
|||
3036 | <addset |
|
|||
3037 | <spanset+ 3:5>, |
|
|||
3038 | <spanset+ 4:6>>>> |
|
|||
3039 | 0 |
|
|||
3040 | 1 |
|
|||
3041 | 2 |
|
|||
3042 | 3 |
|
|||
3043 | 4 |
|
|||
3044 | 5 |
|
|||
3045 |
|
||||
3046 | no crash by empty group "()" while optimizing `or` operations |
|
|||
3047 |
|
||||
3048 | $ try --optimize '0|()' |
|
|||
3049 | (or |
|
|||
3050 | (list |
|
|||
3051 | (symbol '0') |
|
|||
3052 | (group |
|
|||
3053 | None))) |
|
|||
3054 | * optimized: |
|
|||
3055 | (or |
|
|||
3056 | (list |
|
|||
3057 | (symbol '0') |
|
|||
3058 | None)) |
|
|||
3059 | hg: parse error: missing argument |
|
|||
3060 | [255] |
|
|||
3061 |
|
||||
3062 | test that chained `or` operations never eat up stack (issue4624) |
|
|||
3063 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) |
|
|||
3064 |
|
||||
3065 | $ hg log -T '{rev}\n' -r `$PYTHON -c "print '+'.join(['0:1'] * 500)"` |
|
|||
3066 | 0 |
|
|||
3067 | 1 |
|
|||
3068 |
|
||||
3069 | test that repeated `-r` options never eat up stack (issue4565) |
|
|||
3070 | (uses `-r 0::1` to avoid possible optimization at old-style parser) |
|
|||
3071 |
|
||||
3072 | $ hg log -T '{rev}\n' `$PYTHON -c "for i in xrange(500): print '-r 0::1 ',"` |
|
|||
3073 | 0 |
|
|||
3074 | 1 |
|
|||
3075 |
|
||||
3076 | check that conversion to only works |
|
|||
3077 | $ try --optimize '::3 - ::1' |
|
|||
3078 | (minus |
|
|||
3079 | (dagrangepre |
|
|||
3080 | (symbol '3')) |
|
|||
3081 | (dagrangepre |
|
|||
3082 | (symbol '1'))) |
|
|||
3083 | * optimized: |
|
|||
3084 | (func |
|
|||
3085 | (symbol 'only') |
|
|||
3086 | (list |
|
|||
3087 | (symbol '3') |
|
|||
3088 | (symbol '1'))) |
|
|||
3089 | * set: |
|
|||
3090 | <baseset+ [3]> |
|
|||
3091 | 3 |
|
|||
3092 | $ try --optimize 'ancestors(1) - ancestors(3)' |
|
|||
3093 | (minus |
|
|||
3094 | (func |
|
|||
3095 | (symbol 'ancestors') |
|
|||
3096 | (symbol '1')) |
|
|||
3097 | (func |
|
|||
3098 | (symbol 'ancestors') |
|
|||
3099 | (symbol '3'))) |
|
|||
3100 | * optimized: |
|
|||
3101 | (func |
|
|||
3102 | (symbol 'only') |
|
|||
3103 | (list |
|
|||
3104 | (symbol '1') |
|
|||
3105 | (symbol '3'))) |
|
|||
3106 | * set: |
|
|||
3107 | <baseset+ []> |
|
|||
3108 | $ try --optimize 'not ::2 and ::6' |
|
|||
3109 | (and |
|
|||
3110 | (not |
|
|||
3111 | (dagrangepre |
|
|||
3112 | (symbol '2'))) |
|
|||
3113 | (dagrangepre |
|
|||
3114 | (symbol '6'))) |
|
|||
3115 | * optimized: |
|
|||
3116 | (func |
|
|||
3117 | (symbol 'only') |
|
|||
3118 | (list |
|
|||
3119 | (symbol '6') |
|
|||
3120 | (symbol '2'))) |
|
|||
3121 | * set: |
|
|||
3122 | <baseset+ [3, 4, 5, 6]> |
|
|||
3123 | 3 |
|
|||
3124 | 4 |
|
|||
3125 | 5 |
|
|||
3126 | 6 |
|
|||
3127 | $ try --optimize 'ancestors(6) and not ancestors(4)' |
|
|||
3128 | (and |
|
|||
3129 | (func |
|
|||
3130 | (symbol 'ancestors') |
|
|||
3131 | (symbol '6')) |
|
|||
3132 | (not |
|
|||
3133 | (func |
|
|||
3134 | (symbol 'ancestors') |
|
|||
3135 | (symbol '4')))) |
|
|||
3136 | * optimized: |
|
|||
3137 | (func |
|
|||
3138 | (symbol 'only') |
|
|||
3139 | (list |
|
|||
3140 | (symbol '6') |
|
|||
3141 | (symbol '4'))) |
|
|||
3142 | * set: |
|
|||
3143 | <baseset+ [3, 5, 6]> |
|
|||
3144 | 3 |
|
|||
3145 | 5 |
|
|||
3146 | 6 |
|
|||
3147 |
|
||||
3148 | no crash by empty group "()" while optimizing to "only()" |
|
|||
3149 |
|
||||
3150 | $ try --optimize '::1 and ()' |
|
|||
3151 | (and |
|
|||
3152 | (dagrangepre |
|
|||
3153 | (symbol '1')) |
|
|||
3154 | (group |
|
|||
3155 | None)) |
|
|||
3156 | * optimized: |
|
|||
3157 | (andsmally |
|
|||
3158 | (func |
|
|||
3159 | (symbol 'ancestors') |
|
|||
3160 | (symbol '1')) |
|
|||
3161 | None) |
|
|||
3162 | hg: parse error: missing argument |
|
|||
3163 | [255] |
|
|||
3164 |
|
||||
3165 | optimization to only() works only if ancestors() takes only one argument |
|
|||
3166 |
|
||||
3167 | $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' |
|
|||
3168 | * optimized: |
|
|||
3169 | (difference |
|
|||
3170 | (func |
|
|||
3171 | (symbol 'ancestors') |
|
|||
3172 | (symbol '6')) |
|
|||
3173 | (func |
|
|||
3174 | (symbol 'ancestors') |
|
|||
3175 | (list |
|
|||
3176 | (symbol '4') |
|
|||
3177 | (symbol '1')))) |
|
|||
3178 | 0 |
|
|||
3179 | 1 |
|
|||
3180 | 3 |
|
|||
3181 | 5 |
|
|||
3182 | 6 |
|
|||
3183 | $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' |
|
|||
3184 | * optimized: |
|
|||
3185 | (difference |
|
|||
3186 | (func |
|
|||
3187 | (symbol 'ancestors') |
|
|||
3188 | (list |
|
|||
3189 | (symbol '6') |
|
|||
3190 | (symbol '1'))) |
|
|||
3191 | (func |
|
|||
3192 | (symbol 'ancestors') |
|
|||
3193 | (symbol '4'))) |
|
|||
3194 | 5 |
|
|||
3195 | 6 |
|
|||
3196 |
|
||||
3197 | optimization disabled if keyword arguments passed (because we're too lazy |
|
|||
3198 | to support it) |
|
|||
3199 |
|
||||
3200 | $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' |
|
|||
3201 | * optimized: |
|
|||
3202 | (difference |
|
|||
3203 | (func |
|
|||
3204 | (symbol 'ancestors') |
|
|||
3205 | (keyvalue |
|
|||
3206 | (symbol 'set') |
|
|||
3207 | (symbol '6'))) |
|
|||
3208 | (func |
|
|||
3209 | (symbol 'ancestors') |
|
|||
3210 | (keyvalue |
|
|||
3211 | (symbol 'set') |
|
|||
3212 | (symbol '4')))) |
|
|||
3213 | 3 |
|
|||
3214 | 5 |
|
|||
3215 | 6 |
|
|||
3216 |
|
||||
3217 | invalid function call should not be optimized to only() |
|
|||
3218 |
|
||||
3219 | $ log '"ancestors"(6) and not ancestors(4)' |
|
|||
3220 | hg: parse error: not a symbol |
|
|||
3221 | [255] |
|
|||
3222 |
|
||||
3223 | $ log 'ancestors(6) and not "ancestors"(4)' |
|
|||
3224 | hg: parse error: not a symbol |
|
|||
3225 | [255] |
|
|||
3226 |
|
||||
3227 | we can use patterns when searching for tags |
|
|||
3228 |
|
||||
3229 | $ log 'tag("1..*")' |
|
|||
3230 | abort: tag '1..*' does not exist! |
|
|||
3231 | [255] |
|
|||
3232 | $ log 'tag("re:1..*")' |
|
|||
3233 | 6 |
|
|||
3234 | $ log 'tag("re:[0-9].[0-9]")' |
|
|||
3235 | 6 |
|
|||
3236 | $ log 'tag("literal:1.0")' |
|
|||
3237 | 6 |
|
|||
3238 | $ log 'tag("re:0..*")' |
|
|||
3239 |
|
||||
3240 | $ log 'tag(unknown)' |
|
|||
3241 | abort: tag 'unknown' does not exist! |
|
|||
3242 | [255] |
|
|||
3243 | $ log 'tag("re:unknown")' |
|
|||
3244 | $ log 'present(tag("unknown"))' |
|
|||
3245 | $ log 'present(tag("re:unknown"))' |
|
|||
3246 | $ log 'branch(unknown)' |
|
|||
3247 | abort: unknown revision 'unknown'! |
|
|||
3248 | [255] |
|
|||
3249 | $ log 'branch("literal:unknown")' |
|
|||
3250 | abort: branch 'unknown' does not exist! |
|
|||
3251 | [255] |
|
|||
3252 | $ log 'branch("re:unknown")' |
|
|||
3253 | $ log 'present(branch("unknown"))' |
|
|||
3254 | $ log 'present(branch("re:unknown"))' |
|
|||
3255 | $ log 'user(bob)' |
|
|||
3256 | 2 |
|
|||
3257 |
|
||||
3258 | $ log '4::8' |
|
|||
3259 | 4 |
|
|||
3260 | 8 |
|
|||
3261 | $ log '4:8' |
|
|||
3262 | 4 |
|
|||
3263 | 5 |
|
|||
3264 | 6 |
|
|||
3265 | 7 |
|
|||
3266 | 8 |
|
|||
3267 |
|
||||
3268 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' |
|
|||
3269 | 4 |
|
|||
3270 | 2 |
|
|||
3271 | 5 |
|
|||
3272 |
|
||||
3273 | $ log 'not 0 and 0:2' |
|
|||
3274 | 1 |
|
|||
3275 | 2 |
|
|||
3276 | $ log 'not 1 and 0:2' |
|
|||
3277 | 0 |
|
|||
3278 | 2 |
|
|||
3279 | $ log 'not 2 and 0:2' |
|
|||
3280 | 0 |
|
|||
3281 | 1 |
|
|||
3282 | $ log '(1 and 2)::' |
|
|||
3283 | $ log '(1 and 2):' |
|
|||
3284 | $ log '(1 and 2):3' |
|
|||
3285 | $ log 'sort(head(), -rev)' |
|
|||
3286 | 9 |
|
|||
3287 | 7 |
|
|||
3288 | 6 |
|
|||
3289 | 5 |
|
|||
3290 | 4 |
|
|||
3291 | 3 |
|
|||
3292 | 2 |
|
|||
3293 | 1 |
|
|||
3294 | 0 |
|
|||
3295 | $ log '4::8 - 8' |
|
|||
3296 | 4 |
|
|||
3297 |
|
||||
3298 | matching() should preserve the order of the input set: |
|
|||
3299 |
|
||||
3300 | $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' |
|
|||
3301 | 2 |
|
|||
3302 | 3 |
|
|||
3303 | 1 |
|
|||
3304 |
|
||||
3305 | $ log 'named("unknown")' |
|
|||
3306 | abort: namespace 'unknown' does not exist! |
|
|||
3307 | [255] |
|
|||
3308 | $ log 'named("re:unknown")' |
|
|||
3309 | abort: no namespace exists that match 'unknown'! |
|
|||
3310 | [255] |
|
|||
3311 | $ log 'present(named("unknown"))' |
|
|||
3312 | $ log 'present(named("re:unknown"))' |
|
|||
3313 |
|
||||
3314 | $ log 'tag()' |
|
|||
3315 | 6 |
|
|||
3316 | $ log 'named("tags")' |
|
|||
3317 | 6 |
|
|||
3318 |
|
||||
3319 | issue2437 |
|
|||
3320 |
|
||||
3321 | $ log '3 and p1(5)' |
|
|||
3322 | 3 |
|
|||
3323 | $ log '4 and p2(6)' |
|
|||
3324 | 4 |
|
|||
3325 | $ log '1 and parents(:2)' |
|
|||
3326 | 1 |
|
|||
3327 | $ log '2 and children(1:)' |
|
|||
3328 | 2 |
|
|||
3329 | $ log 'roots(all()) or roots(all())' |
|
|||
3330 | 0 |
|
|||
3331 | $ hg debugrevspec 'roots(all()) or roots(all())' |
|
|||
3332 | 0 |
|
|||
3333 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' |
|
|||
3334 | 9 |
|
|||
3335 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' |
|
|||
3336 | 4 |
|
|||
3337 |
|
||||
3338 | issue2654: report a parse error if the revset was not completely parsed |
|
|||
3339 |
|
||||
3340 | $ log '1 OR 2' |
|
|||
3341 | hg: parse error at 2: invalid token |
|
|||
3342 | [255] |
|
|||
3343 |
|
||||
3344 | or operator should preserve ordering: |
|
|||
3345 | $ log 'reverse(2::4) or tip' |
|
|||
3346 | 4 |
|
|||
3347 | 2 |
|
|||
3348 | 9 |
|
|||
3349 |
|
||||
3350 | parentrevspec |
|
|||
3351 |
|
||||
3352 | $ log 'merge()^0' |
|
|||
3353 | 6 |
|
|||
3354 | $ log 'merge()^' |
|
|||
3355 | 5 |
|
|||
3356 | $ log 'merge()^1' |
|
|||
3357 | 5 |
|
|||
3358 | $ log 'merge()^2' |
|
|||
3359 | 4 |
|
|||
3360 | $ log '(not merge())^2' |
|
|||
3361 | $ log 'merge()^^' |
|
|||
3362 | 3 |
|
|||
3363 | $ log 'merge()^1^' |
|
|||
3364 | 3 |
|
|||
3365 | $ log 'merge()^^^' |
|
|||
3366 | 1 |
|
|||
3367 |
|
||||
3368 | $ hg debugrevspec -s '(merge() | 0)~-1' |
|
|||
3369 | * set: |
|
|||
3370 | <baseset+ [1, 7]> |
|
|||
3371 | 1 |
|
|||
3372 | 7 |
|
|||
3373 | $ log 'merge()~-1' |
|
|||
3374 | 7 |
|
|||
3375 | $ log 'tip~-1' |
|
|||
3376 | $ log '(tip | merge())~-1' |
|
|||
3377 | 7 |
|
|||
3378 | $ log 'merge()~0' |
|
|||
3379 | 6 |
|
|||
3380 | $ log 'merge()~1' |
|
|||
3381 | 5 |
|
|||
3382 | $ log 'merge()~2' |
|
|||
3383 | 3 |
|
|||
3384 | $ log 'merge()~2^1' |
|
|||
3385 | 1 |
|
|||
3386 | $ log 'merge()~3' |
|
|||
3387 | 1 |
|
|||
3388 |
|
||||
3389 | $ log '(-3:tip)^' |
|
|||
3390 | 4 |
|
|||
3391 | 6 |
|
|||
3392 | 8 |
|
|||
3393 |
|
||||
3394 | $ log 'tip^foo' |
|
|||
3395 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
|||
3396 | [255] |
|
|||
3397 |
|
||||
3398 | $ log 'branchpoint()~-1' |
|
|||
3399 | abort: revision in set has more than one child! |
|
|||
3400 | [255] |
|
|||
3401 |
|
||||
3402 | Bogus function gets suggestions |
|
|||
3403 | $ log 'add()' |
|
|||
3404 | hg: parse error: unknown identifier: add |
|
|||
3405 | (did you mean adds?) |
|
|||
3406 | [255] |
|
|||
3407 | $ log 'added()' |
|
|||
3408 | hg: parse error: unknown identifier: added |
|
|||
3409 | (did you mean adds?) |
|
|||
3410 | [255] |
|
|||
3411 | $ log 'remo()' |
|
|||
3412 | hg: parse error: unknown identifier: remo |
|
|||
3413 | (did you mean one of remote, removes?) |
|
|||
3414 | [255] |
|
|||
3415 | $ log 'babar()' |
|
|||
3416 | hg: parse error: unknown identifier: babar |
|
|||
3417 | [255] |
|
|||
3418 |
|
||||
3419 | Bogus function with a similar internal name doesn't suggest the internal name |
|
|||
3420 | $ log 'matches()' |
|
|||
3421 | hg: parse error: unknown identifier: matches |
|
|||
3422 | (did you mean matching?) |
|
|||
3423 | [255] |
|
|||
3424 |
|
||||
3425 | Undocumented functions aren't suggested as similar either |
|
|||
3426 | $ log 'tagged2()' |
|
|||
3427 | hg: parse error: unknown identifier: tagged2 |
|
|||
3428 | [255] |
|
|||
3429 |
|
||||
3430 | multiple revspecs |
|
|||
3431 |
|
||||
3432 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' |
|
|||
3433 | 8 |
|
|||
3434 | 9 |
|
|||
3435 | 4 |
|
|||
3436 | 5 |
|
|||
3437 | 6 |
|
|||
3438 | 7 |
|
|||
3439 |
|
||||
3440 | test usage in revpair (with "+") |
|
|||
3441 |
|
||||
3442 | (real pair) |
|
|||
3443 |
|
||||
3444 | $ hg diff -r 'tip^^' -r 'tip' |
|
|||
3445 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
|||
3446 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3447 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3448 | @@ -0,0 +1,1 @@ |
|
|||
3449 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
|||
3450 | $ hg diff -r 'tip^^::tip' |
|
|||
3451 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
|||
3452 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3453 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3454 | @@ -0,0 +1,1 @@ |
|
|||
3455 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
|||
3456 |
|
||||
3457 | (single rev) |
|
|||
3458 |
|
||||
3459 | $ hg diff -r 'tip^' -r 'tip^' |
|
|||
3460 | $ hg diff -r 'tip^:tip^' |
|
|||
3461 |
|
||||
3462 | (single rev that does not looks like a range) |
|
|||
3463 |
|
||||
3464 | $ hg diff -r 'tip^::tip^ or tip^' |
|
|||
3465 | diff -r d5d0dcbdc4d9 .hgtags |
|
|||
3466 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3467 | +++ b/.hgtags * (glob) |
|
|||
3468 | @@ -0,0 +1,1 @@ |
|
|||
3469 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
|||
3470 | $ hg diff -r 'tip^ or tip^' |
|
|||
3471 | diff -r d5d0dcbdc4d9 .hgtags |
|
|||
3472 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
3473 | +++ b/.hgtags * (glob) |
|
|||
3474 | @@ -0,0 +1,1 @@ |
|
|||
3475 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
|||
3476 |
|
||||
3477 | (no rev) |
|
|||
3478 |
|
||||
3479 | $ hg diff -r 'author("babar") or author("celeste")' |
|
|||
3480 | abort: empty revision range |
|
|||
3481 | [255] |
|
|||
3482 |
|
||||
3483 | aliases: |
|
|||
3484 |
|
||||
3485 | $ echo '[revsetalias]' >> .hg/hgrc |
|
|||
3486 | $ echo 'm = merge()' >> .hg/hgrc |
|
|||
3487 | (revset aliases can override builtin revsets) |
|
|||
3488 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc |
|
|||
3489 | $ echo 'sincem = descendants(m)' >> .hg/hgrc |
|
|||
3490 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc |
|
|||
3491 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
|||
3492 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
|||
3493 |
|
||||
3494 | $ try m |
|
|||
3495 | (symbol 'm') |
|
|||
3496 | * expanded: |
|
|||
3497 | (func |
|
|||
3498 | (symbol 'merge') |
|
|||
3499 | None) |
|
|||
3500 | * set: |
|
|||
3501 | <filteredset |
|
|||
3502 | <fullreposet+ 0:10>, |
|
|||
3503 | <merge>> |
|
|||
3504 | 6 |
|
|||
3505 |
|
||||
3506 | $ HGPLAIN=1 |
|
|||
3507 | $ export HGPLAIN |
|
|||
3508 | $ try m |
|
|||
3509 | (symbol 'm') |
|
|||
3510 | abort: unknown revision 'm'! |
|
|||
3511 | [255] |
|
|||
3512 |
|
||||
3513 | $ HGPLAINEXCEPT=revsetalias |
|
|||
3514 | $ export HGPLAINEXCEPT |
|
|||
3515 | $ try m |
|
|||
3516 | (symbol 'm') |
|
|||
3517 | * expanded: |
|
|||
3518 | (func |
|
|||
3519 | (symbol 'merge') |
|
|||
3520 | None) |
|
|||
3521 | * set: |
|
|||
3522 | <filteredset |
|
|||
3523 | <fullreposet+ 0:10>, |
|
|||
3524 | <merge>> |
|
|||
3525 | 6 |
|
|||
3526 |
|
||||
3527 | $ unset HGPLAIN |
|
|||
3528 | $ unset HGPLAINEXCEPT |
|
|||
3529 |
|
||||
3530 | $ try 'p2(.)' |
|
|||
3531 | (func |
|
|||
3532 | (symbol 'p2') |
|
|||
3533 | (symbol '.')) |
|
|||
3534 | * expanded: |
|
|||
3535 | (func |
|
|||
3536 | (symbol 'p1') |
|
|||
3537 | (symbol '.')) |
|
|||
3538 | * set: |
|
|||
3539 | <baseset+ [8]> |
|
|||
3540 | 8 |
|
|||
3541 |
|
||||
3542 | $ HGPLAIN=1 |
|
|||
3543 | $ export HGPLAIN |
|
|||
3544 | $ try 'p2(.)' |
|
|||
3545 | (func |
|
|||
3546 | (symbol 'p2') |
|
|||
3547 | (symbol '.')) |
|
|||
3548 | * set: |
|
|||
3549 | <baseset+ []> |
|
|||
3550 |
|
||||
3551 | $ HGPLAINEXCEPT=revsetalias |
|
|||
3552 | $ export HGPLAINEXCEPT |
|
|||
3553 | $ try 'p2(.)' |
|
|||
3554 | (func |
|
|||
3555 | (symbol 'p2') |
|
|||
3556 | (symbol '.')) |
|
|||
3557 | * expanded: |
|
|||
3558 | (func |
|
|||
3559 | (symbol 'p1') |
|
|||
3560 | (symbol '.')) |
|
|||
3561 | * set: |
|
|||
3562 | <baseset+ [8]> |
|
|||
3563 | 8 |
|
|||
3564 |
|
||||
3565 | $ unset HGPLAIN |
|
|||
3566 | $ unset HGPLAINEXCEPT |
|
|||
3567 |
|
||||
3568 | test alias recursion |
|
|||
3569 |
|
||||
3570 | $ try sincem |
|
|||
3571 | (symbol 'sincem') |
|
|||
3572 | * expanded: |
|
|||
3573 | (func |
|
|||
3574 | (symbol 'descendants') |
|
|||
3575 | (func |
|
|||
3576 | (symbol 'merge') |
|
|||
3577 | None)) |
|
|||
3578 | * set: |
|
|||
3579 | <generatorset+> |
|
|||
3580 | 6 |
|
|||
3581 | 7 |
|
|||
3582 |
|
||||
3583 | test infinite recursion |
|
|||
3584 |
|
||||
3585 | $ echo 'recurse1 = recurse2' >> .hg/hgrc |
|
|||
3586 | $ echo 'recurse2 = recurse1' >> .hg/hgrc |
|
|||
3587 | $ try recurse1 |
|
|||
3588 | (symbol 'recurse1') |
|
|||
3589 | hg: parse error: infinite expansion of revset alias "recurse1" detected |
|
|||
3590 | [255] |
|
|||
3591 |
|
||||
3592 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc |
|
|||
3593 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc |
|
|||
3594 | $ try "level2(level1(1, 2), 3)" |
|
|||
3595 | (func |
|
|||
3596 | (symbol 'level2') |
|
|||
3597 | (list |
|
|||
3598 | (func |
|
|||
3599 | (symbol 'level1') |
|
|||
3600 | (list |
|
|||
3601 | (symbol '1') |
|
|||
3602 | (symbol '2'))) |
|
|||
3603 | (symbol '3'))) |
|
|||
3604 | * expanded: |
|
|||
3605 | (or |
|
|||
3606 | (list |
|
|||
3607 | (symbol '3') |
|
|||
3608 | (or |
|
|||
3609 | (list |
|
|||
3610 | (symbol '1') |
|
|||
3611 | (symbol '2'))))) |
|
|||
3612 | * set: |
|
|||
3613 | <addset |
|
|||
3614 | <baseset [3]>, |
|
|||
3615 | <baseset [1, 2]>> |
|
|||
3616 | 3 |
|
|||
3617 | 1 |
|
|||
3618 | 2 |
|
|||
3619 |
|
||||
3620 | test nesting and variable passing |
|
|||
3621 |
|
||||
3622 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc |
|
|||
3623 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc |
|
|||
3624 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc |
|
|||
3625 | $ try 'nested(2:5)' |
|
|||
3626 | (func |
|
|||
3627 | (symbol 'nested') |
|
|||
3628 | (range |
|
|||
3629 | (symbol '2') |
|
|||
3630 | (symbol '5'))) |
|
|||
3631 | * expanded: |
|
|||
3632 | (func |
|
|||
3633 | (symbol 'max') |
|
|||
3634 | (range |
|
|||
3635 | (symbol '2') |
|
|||
3636 | (symbol '5'))) |
|
|||
3637 | * set: |
|
|||
3638 | <baseset |
|
|||
3639 | <max |
|
|||
3640 | <fullreposet+ 0:10>, |
|
|||
3641 | <spanset+ 2:6>>> |
|
|||
3642 | 5 |
|
|||
3643 |
|
||||
3644 | test chained `or` operations are flattened at parsing phase |
|
|||
3645 |
|
||||
3646 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc |
|
|||
3647 | $ try 'chainedorops(0:1, 1:2, 2:3)' |
|
|||
3648 | (func |
|
|||
3649 | (symbol 'chainedorops') |
|
|||
3650 | (list |
|
|||
3651 | (range |
|
|||
3652 | (symbol '0') |
|
|||
3653 | (symbol '1')) |
|
|||
3654 | (range |
|
|||
3655 | (symbol '1') |
|
|||
3656 | (symbol '2')) |
|
|||
3657 | (range |
|
|||
3658 | (symbol '2') |
|
|||
3659 | (symbol '3')))) |
|
|||
3660 | * expanded: |
|
|||
3661 | (or |
|
|||
3662 | (list |
|
|||
3663 | (range |
|
|||
3664 | (symbol '0') |
|
|||
3665 | (symbol '1')) |
|
|||
3666 | (range |
|
|||
3667 | (symbol '1') |
|
|||
3668 | (symbol '2')) |
|
|||
3669 | (range |
|
|||
3670 | (symbol '2') |
|
|||
3671 | (symbol '3')))) |
|
|||
3672 | * set: |
|
|||
3673 | <addset |
|
|||
3674 | <spanset+ 0:2>, |
|
|||
3675 | <addset |
|
|||
3676 | <spanset+ 1:3>, |
|
|||
3677 | <spanset+ 2:4>>> |
|
|||
3678 | 0 |
|
|||
3679 | 1 |
|
|||
3680 | 2 |
|
|||
3681 | 3 |
|
|||
3682 |
|
||||
3683 | test variable isolation, variable placeholders are rewritten as string |
|
|||
3684 | then parsed and matched again as string. Check they do not leak too |
|
|||
3685 | far away. |
|
|||
3686 |
|
||||
3687 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc |
|
|||
3688 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc |
|
|||
3689 | $ try 'callinjection(2:5)' |
|
|||
3690 | (func |
|
|||
3691 | (symbol 'callinjection') |
|
|||
3692 | (range |
|
|||
3693 | (symbol '2') |
|
|||
3694 | (symbol '5'))) |
|
|||
3695 | * expanded: |
|
|||
3696 | (func |
|
|||
3697 | (symbol 'descendants') |
|
|||
3698 | (func |
|
|||
3699 | (symbol 'max') |
|
|||
3700 | (string '$1'))) |
|
|||
3701 | abort: unknown revision '$1'! |
|
|||
3702 | [255] |
|
|||
3703 |
|
||||
3704 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', |
|
|||
3705 | but 'all()' should never be substituted to '0()'. |
|
|||
3706 |
|
||||
3707 | $ echo 'universe = all()' >> .hg/hgrc |
|
|||
3708 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc |
|
|||
3709 | $ try 'shadowall(0)' |
|
|||
3710 | (func |
|
|||
3711 | (symbol 'shadowall') |
|
|||
3712 | (symbol '0')) |
|
|||
3713 | * expanded: |
|
|||
3714 | (and |
|
|||
3715 | (symbol '0') |
|
|||
3716 | (func |
|
|||
3717 | (symbol 'all') |
|
|||
3718 | None)) |
|
|||
3719 | * set: |
|
|||
3720 | <filteredset |
|
|||
3721 | <baseset [0]>, |
|
|||
3722 | <spanset+ 0:10>> |
|
|||
3723 | 0 |
|
|||
3724 |
|
||||
3725 | test unknown reference: |
|
|||
3726 |
|
||||
3727 | $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' |
|
|||
3728 | (func |
|
|||
3729 | (symbol 'unknownref') |
|
|||
3730 | (symbol '0')) |
|
|||
3731 | abort: bad definition of revset alias "unknownref": invalid symbol '$2' |
|
|||
3732 | [255] |
|
|||
3733 |
|
||||
3734 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
|
|||
3735 | (symbol 'tip') |
|
|||
3736 | warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end |
|
|||
3737 | * set: |
|
|||
3738 | <baseset [9]> |
|
|||
3739 | 9 |
|
|||
3740 |
|
||||
3741 | $ try 'tip' |
|
|||
3742 | (symbol 'tip') |
|
|||
3743 | * set: |
|
|||
3744 | <baseset [9]> |
|
|||
3745 | 9 |
|
|||
3746 |
|
||||
3747 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" |
|
|||
3748 | (symbol 'tip') |
|
|||
3749 | warning: bad declaration of revset alias "bad name": at 4: invalid token |
|
|||
3750 | * set: |
|
|||
3751 | <baseset [9]> |
|
|||
3752 | 9 |
|
|||
3753 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc |
|
|||
3754 | $ try 'strictreplacing("foo", tip)' |
|
|||
3755 | (func |
|
|||
3756 | (symbol 'strictreplacing') |
|
|||
3757 | (list |
|
|||
3758 | (string 'foo') |
|
|||
3759 | (symbol 'tip'))) |
|
|||
3760 | * expanded: |
|
|||
3761 | (or |
|
|||
3762 | (list |
|
|||
3763 | (symbol 'tip') |
|
|||
3764 | (func |
|
|||
3765 | (symbol 'desc') |
|
|||
3766 | (string '$1')))) |
|
|||
3767 | * set: |
|
|||
3768 | <addset |
|
|||
3769 | <baseset [9]>, |
|
|||
3770 | <filteredset |
|
|||
3771 | <fullreposet+ 0:10>, |
|
|||
3772 | <desc '$1'>>> |
|
|||
3773 | 9 |
|
|||
3774 |
|
||||
3775 | $ try 'd(2:5)' |
|
|||
3776 | (func |
|
|||
3777 | (symbol 'd') |
|
|||
3778 | (range |
|
|||
3779 | (symbol '2') |
|
|||
3780 | (symbol '5'))) |
|
|||
3781 | * expanded: |
|
|||
3782 | (func |
|
|||
3783 | (symbol 'reverse') |
|
|||
3784 | (func |
|
|||
3785 | (symbol 'sort') |
|
|||
3786 | (list |
|
|||
3787 | (range |
|
|||
3788 | (symbol '2') |
|
|||
3789 | (symbol '5')) |
|
|||
3790 | (symbol 'date')))) |
|
|||
3791 | * set: |
|
|||
3792 | <baseset [4, 5, 3, 2]> |
|
|||
3793 | 4 |
|
|||
3794 | 5 |
|
|||
3795 | 3 |
|
|||
3796 | 2 |
|
|||
3797 | $ try 'rs(2 or 3, date)' |
|
|||
3798 | (func |
|
|||
3799 | (symbol 'rs') |
|
|||
3800 | (list |
|
|||
3801 | (or |
|
|||
3802 | (list |
|
|||
3803 | (symbol '2') |
|
|||
3804 | (symbol '3'))) |
|
|||
3805 | (symbol 'date'))) |
|
|||
3806 | * expanded: |
|
|||
3807 | (func |
|
|||
3808 | (symbol 'reverse') |
|
|||
3809 | (func |
|
|||
3810 | (symbol 'sort') |
|
|||
3811 | (list |
|
|||
3812 | (or |
|
|||
3813 | (list |
|
|||
3814 | (symbol '2') |
|
|||
3815 | (symbol '3'))) |
|
|||
3816 | (symbol 'date')))) |
|
|||
3817 | * set: |
|
|||
3818 | <baseset [3, 2]> |
|
|||
3819 | 3 |
|
|||
3820 | 2 |
|
|||
3821 | $ try 'rs()' |
|
|||
3822 | (func |
|
|||
3823 | (symbol 'rs') |
|
|||
3824 | None) |
|
|||
3825 | hg: parse error: invalid number of arguments: 0 |
|
|||
3826 | [255] |
|
|||
3827 | $ try 'rs(2)' |
|
|||
3828 | (func |
|
|||
3829 | (symbol 'rs') |
|
|||
3830 | (symbol '2')) |
|
|||
3831 | hg: parse error: invalid number of arguments: 1 |
|
|||
3832 | [255] |
|
|||
3833 | $ try 'rs(2, data, 7)' |
|
|||
3834 | (func |
|
|||
3835 | (symbol 'rs') |
|
|||
3836 | (list |
|
|||
3837 | (symbol '2') |
|
|||
3838 | (symbol 'data') |
|
|||
3839 | (symbol '7'))) |
|
|||
3840 | hg: parse error: invalid number of arguments: 3 |
|
|||
3841 | [255] |
|
|||
3842 | $ try 'rs4(2 or 3, x, x, date)' |
|
|||
3843 | (func |
|
|||
3844 | (symbol 'rs4') |
|
|||
3845 | (list |
|
|||
3846 | (or |
|
|||
3847 | (list |
|
|||
3848 | (symbol '2') |
|
|||
3849 | (symbol '3'))) |
|
|||
3850 | (symbol 'x') |
|
|||
3851 | (symbol 'x') |
|
|||
3852 | (symbol 'date'))) |
|
|||
3853 | * expanded: |
|
|||
3854 | (func |
|
|||
3855 | (symbol 'reverse') |
|
|||
3856 | (func |
|
|||
3857 | (symbol 'sort') |
|
|||
3858 | (list |
|
|||
3859 | (or |
|
|||
3860 | (list |
|
|||
3861 | (symbol '2') |
|
|||
3862 | (symbol '3'))) |
|
|||
3863 | (symbol 'date')))) |
|
|||
3864 | * set: |
|
|||
3865 | <baseset [3, 2]> |
|
|||
3866 | 3 |
|
|||
3867 | 2 |
|
|||
3868 |
|
||||
3869 | issue4553: check that revset aliases override existing hash prefix |
|
|||
3870 |
|
||||
3871 | $ hg log -qr e |
|
|||
3872 | 6:e0cc66ef77e8 |
|
|||
3873 |
|
||||
3874 | $ hg log -qr e --config revsetalias.e="all()" |
|
|||
3875 | 0:2785f51eece5 |
|
|||
3876 | 1:d75937da8da0 |
|
|||
3877 | 2:5ed5505e9f1c |
|
|||
3878 | 3:8528aa5637f2 |
|
|||
3879 | 4:2326846efdab |
|
|||
3880 | 5:904fa392b941 |
|
|||
3881 | 6:e0cc66ef77e8 |
|
|||
3882 | 7:013af1973af4 |
|
|||
3883 | 8:d5d0dcbdc4d9 |
|
|||
3884 | 9:24286f4ae135 |
|
|||
3885 |
|
||||
3886 | $ hg log -qr e: --config revsetalias.e="0" |
|
|||
3887 | 0:2785f51eece5 |
|
|||
3888 | 1:d75937da8da0 |
|
|||
3889 | 2:5ed5505e9f1c |
|
|||
3890 | 3:8528aa5637f2 |
|
|||
3891 | 4:2326846efdab |
|
|||
3892 | 5:904fa392b941 |
|
|||
3893 | 6:e0cc66ef77e8 |
|
|||
3894 | 7:013af1973af4 |
|
|||
3895 | 8:d5d0dcbdc4d9 |
|
|||
3896 | 9:24286f4ae135 |
|
|||
3897 |
|
||||
3898 | $ hg log -qr :e --config revsetalias.e="9" |
|
|||
3899 | 0:2785f51eece5 |
|
|||
3900 | 1:d75937da8da0 |
|
|||
3901 | 2:5ed5505e9f1c |
|
|||
3902 | 3:8528aa5637f2 |
|
|||
3903 | 4:2326846efdab |
|
|||
3904 | 5:904fa392b941 |
|
|||
3905 | 6:e0cc66ef77e8 |
|
|||
3906 | 7:013af1973af4 |
|
|||
3907 | 8:d5d0dcbdc4d9 |
|
|||
3908 | 9:24286f4ae135 |
|
|||
3909 |
|
||||
3910 | $ hg log -qr e: |
|
|||
3911 | 6:e0cc66ef77e8 |
|
|||
3912 | 7:013af1973af4 |
|
|||
3913 | 8:d5d0dcbdc4d9 |
|
|||
3914 | 9:24286f4ae135 |
|
|||
3915 |
|
||||
3916 | $ hg log -qr :e |
|
|||
3917 | 0:2785f51eece5 |
|
|||
3918 | 1:d75937da8da0 |
|
|||
3919 | 2:5ed5505e9f1c |
|
|||
3920 | 3:8528aa5637f2 |
|
|||
3921 | 4:2326846efdab |
|
|||
3922 | 5:904fa392b941 |
|
|||
3923 | 6:e0cc66ef77e8 |
|
|||
3924 |
|
||||
3925 | issue2549 - correct optimizations |
|
|||
3926 |
|
||||
3927 | $ try 'limit(1 or 2 or 3, 2) and not 2' |
|
|||
3928 | (and |
|
|||
3929 | (func |
|
|||
3930 | (symbol 'limit') |
|
|||
3931 | (list |
|
|||
3932 | (or |
|
|||
3933 | (list |
|
|||
3934 | (symbol '1') |
|
|||
3935 | (symbol '2') |
|
|||
3936 | (symbol '3'))) |
|
|||
3937 | (symbol '2'))) |
|
|||
3938 | (not |
|
|||
3939 | (symbol '2'))) |
|
|||
3940 | * set: |
|
|||
3941 | <filteredset |
|
|||
3942 | <baseset [1, 2]>, |
|
|||
3943 | <not |
|
|||
3944 | <baseset [2]>>> |
|
|||
3945 | 1 |
|
|||
3946 | $ try 'max(1 or 2) and not 2' |
|
|||
3947 | (and |
|
|||
3948 | (func |
|
|||
3949 | (symbol 'max') |
|
|||
3950 | (or |
|
|||
3951 | (list |
|
|||
3952 | (symbol '1') |
|
|||
3953 | (symbol '2')))) |
|
|||
3954 | (not |
|
|||
3955 | (symbol '2'))) |
|
|||
3956 | * set: |
|
|||
3957 | <filteredset |
|
|||
3958 | <baseset |
|
|||
3959 | <max |
|
|||
3960 | <fullreposet+ 0:10>, |
|
|||
3961 | <baseset [1, 2]>>>, |
|
|||
3962 | <not |
|
|||
3963 | <baseset [2]>>> |
|
|||
3964 | $ try 'min(1 or 2) and not 1' |
|
|||
3965 | (and |
|
|||
3966 | (func |
|
|||
3967 | (symbol 'min') |
|
|||
3968 | (or |
|
|||
3969 | (list |
|
|||
3970 | (symbol '1') |
|
|||
3971 | (symbol '2')))) |
|
|||
3972 | (not |
|
|||
3973 | (symbol '1'))) |
|
|||
3974 | * set: |
|
|||
3975 | <filteredset |
|
|||
3976 | <baseset |
|
|||
3977 | <min |
|
|||
3978 | <fullreposet+ 0:10>, |
|
|||
3979 | <baseset [1, 2]>>>, |
|
|||
3980 | <not |
|
|||
3981 | <baseset [1]>>> |
|
|||
3982 | $ try 'last(1 or 2, 1) and not 2' |
|
|||
3983 | (and |
|
|||
3984 | (func |
|
|||
3985 | (symbol 'last') |
|
|||
3986 | (list |
|
|||
3987 | (or |
|
|||
3988 | (list |
|
|||
3989 | (symbol '1') |
|
|||
3990 | (symbol '2'))) |
|
|||
3991 | (symbol '1'))) |
|
|||
3992 | (not |
|
|||
3993 | (symbol '2'))) |
|
|||
3994 | * set: |
|
|||
3995 | <filteredset |
|
|||
3996 | <baseset [2]>, |
|
|||
3997 | <not |
|
|||
3998 | <baseset [2]>>> |
|
|||
3999 |
|
||||
4000 | issue4289 - ordering of built-ins |
|
|||
4001 | $ hg log -M -q -r 3:2 |
|
|||
4002 | 3:8528aa5637f2 |
|
|||
4003 | 2:5ed5505e9f1c |
|
|||
4004 |
|
||||
4005 | test revsets started with 40-chars hash (issue3669) |
|
|||
4006 |
|
||||
4007 | $ ISSUE3669_TIP=`hg tip --template '{node}'` |
|
|||
4008 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' |
|
|||
4009 | 9 |
|
|||
4010 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' |
|
|||
4011 | 8 |
|
|||
4012 |
|
||||
4013 | test or-ed indirect predicates (issue3775) |
|
|||
4014 |
|
||||
4015 | $ log '6 or 6^1' | sort |
|
|||
4016 | 5 |
|
|||
4017 | 6 |
|
|||
4018 | $ log '6^1 or 6' | sort |
|
|||
4019 | 5 |
|
|||
4020 | 6 |
|
|||
4021 | $ log '4 or 4~1' | sort |
|
|||
4022 | 2 |
|
|||
4023 | 4 |
|
|||
4024 | $ log '4~1 or 4' | sort |
|
|||
4025 | 2 |
|
|||
4026 | 4 |
|
|||
4027 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort |
|
|||
4028 | 0 |
|
|||
4029 | 1 |
|
|||
4030 | 2 |
|
|||
4031 | 3 |
|
|||
4032 | 4 |
|
|||
4033 | 5 |
|
|||
4034 | 6 |
|
|||
4035 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort |
|
|||
4036 | 0 |
|
|||
4037 | 1 |
|
|||
4038 | 2 |
|
|||
4039 | 3 |
|
|||
4040 | 4 |
|
|||
4041 | 5 |
|
|||
4042 | 6 |
|
|||
4043 |
|
||||
4044 | tests for 'remote()' predicate: |
|
|||
4045 | #. (csets in remote) (id) (remote) |
|
|||
4046 | 1. less than local current branch "default" |
|
|||
4047 | 2. same with local specified "default" |
|
|||
4048 | 3. more than local specified specified |
|
|||
4049 |
|
||||
4050 | $ hg clone --quiet -U . ../remote3 |
|
|||
4051 | $ cd ../remote3 |
|
|||
4052 | $ hg update -q 7 |
|
|||
4053 | $ echo r > r |
|
|||
4054 | $ hg ci -Aqm 10 |
|
|||
4055 | $ log 'remote()' |
|
|||
4056 | 7 |
|
|||
4057 | $ log 'remote("a-b-c-")' |
|
|||
4058 | 2 |
|
|||
4059 | $ cd ../repo |
|
|||
4060 | $ log 'remote(".a.b.c.", "../remote3")' |
|
|||
4061 |
|
||||
4062 | tests for concatenation of strings/symbols by "##" |
|
|||
4063 |
|
||||
4064 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" |
|
|||
4065 | (_concat |
|
|||
4066 | (_concat |
|
|||
4067 | (_concat |
|
|||
4068 | (symbol '278') |
|
|||
4069 | (string '5f5')) |
|
|||
4070 | (symbol '1ee')) |
|
|||
4071 | (string 'ce5')) |
|
|||
4072 | * concatenated: |
|
|||
4073 | (string '2785f51eece5') |
|
|||
4074 | * set: |
|
|||
4075 | <baseset [0]> |
|
|||
4076 | 0 |
|
|||
4077 |
|
||||
4078 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc |
|
|||
4079 | $ try "cat4(278, '5f5', 1ee, 'ce5')" |
|
|||
4080 | (func |
|
|||
4081 | (symbol 'cat4') |
|
|||
4082 | (list |
|
|||
4083 | (symbol '278') |
|
|||
4084 | (string '5f5') |
|
|||
4085 | (symbol '1ee') |
|
|||
4086 | (string 'ce5'))) |
|
|||
4087 | * expanded: |
|
|||
4088 | (_concat |
|
|||
4089 | (_concat |
|
|||
4090 | (_concat |
|
|||
4091 | (symbol '278') |
|
|||
4092 | (string '5f5')) |
|
|||
4093 | (symbol '1ee')) |
|
|||
4094 | (string 'ce5')) |
|
|||
4095 | * concatenated: |
|
|||
4096 | (string '2785f51eece5') |
|
|||
4097 | * set: |
|
|||
4098 | <baseset [0]> |
|
|||
4099 | 0 |
|
|||
4100 |
|
||||
4101 | (check concatenation in alias nesting) |
|
|||
4102 |
|
||||
4103 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc |
|
|||
4104 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc |
|
|||
4105 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" |
|
|||
4106 | 0 |
|
|||
4107 |
|
||||
4108 | (check operator priority) |
|
|||
4109 |
|
||||
4110 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc |
|
|||
4111 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" |
|
|||
4112 | 0 |
|
|||
4113 | 4 |
|
|||
4114 |
|
||||
4115 | $ cd .. |
|
|||
4116 |
|
||||
4117 | prepare repository that has "default" branches of multiple roots |
|
|||
4118 |
|
||||
4119 | $ hg init namedbranch |
|
|||
4120 | $ cd namedbranch |
|
|||
4121 |
|
||||
4122 | $ echo default0 >> a |
|
|||
4123 | $ hg ci -Aqm0 |
|
|||
4124 | $ echo default1 >> a |
|
|||
4125 | $ hg ci -m1 |
|
|||
4126 |
|
||||
4127 | $ hg branch -q stable |
|
|||
4128 | $ echo stable2 >> a |
|
|||
4129 | $ hg ci -m2 |
|
|||
4130 | $ echo stable3 >> a |
|
|||
4131 | $ hg ci -m3 |
|
|||
4132 |
|
||||
4133 | $ hg update -q null |
|
|||
4134 | $ echo default4 >> a |
|
|||
4135 | $ hg ci -Aqm4 |
|
|||
4136 | $ echo default5 >> a |
|
|||
4137 | $ hg ci -m5 |
|
|||
4138 |
|
||||
4139 | "null" revision belongs to "default" branch (issue4683) |
|
|||
4140 |
|
||||
4141 | $ log 'branch(null)' |
|
|||
4142 | 0 |
|
|||
4143 | 1 |
|
|||
4144 | 4 |
|
|||
4145 | 5 |
|
|||
4146 |
|
||||
4147 | "null" revision belongs to "default" branch, but it shouldn't appear in set |
|
|||
4148 | unless explicitly specified (issue4682) |
|
|||
4149 |
|
||||
4150 | $ log 'children(branch(default))' |
|
|||
4151 | 1 |
|
|||
4152 | 2 |
|
|||
4153 | 5 |
|
|||
4154 |
|
||||
4155 | $ cd .. |
|
|||
4156 |
|
||||
4157 | test author/desc/keyword in problematic encoding |
|
|||
4158 | # unicode: cp932: |
|
|||
4159 | # u30A2 0x83 0x41(= 'A') |
|
|||
4160 | # u30C2 0x83 0x61(= 'a') |
|
|||
4161 |
|
||||
4162 | $ hg init problematicencoding |
|
|||
4163 | $ cd problematicencoding |
|
|||
4164 |
|
||||
4165 | $ $PYTHON > setup.sh <<EOF |
|
|||
4166 | > print u''' |
|
|||
4167 | > echo a > text |
|
|||
4168 | > hg add text |
|
|||
4169 | > hg --encoding utf-8 commit -u '\u30A2' -m none |
|
|||
4170 | > echo b > text |
|
|||
4171 | > hg --encoding utf-8 commit -u '\u30C2' -m none |
|
|||
4172 | > echo c > text |
|
|||
4173 | > hg --encoding utf-8 commit -u none -m '\u30A2' |
|
|||
4174 | > echo d > text |
|
|||
4175 | > hg --encoding utf-8 commit -u none -m '\u30C2' |
|
|||
4176 | > '''.encode('utf-8') |
|
|||
4177 | > EOF |
|
|||
4178 | $ sh < setup.sh |
|
|||
4179 |
|
||||
4180 | test in problematic encoding |
|
|||
4181 | $ $PYTHON > test.sh <<EOF |
|
|||
4182 | > print u''' |
|
|||
4183 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' |
|
|||
4184 | > echo ==== |
|
|||
4185 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' |
|
|||
4186 | > echo ==== |
|
|||
4187 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' |
|
|||
4188 | > echo ==== |
|
|||
4189 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' |
|
|||
4190 | > echo ==== |
|
|||
4191 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' |
|
|||
4192 | > echo ==== |
|
|||
4193 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' |
|
|||
4194 | > '''.encode('cp932') |
|
|||
4195 | > EOF |
|
|||
4196 | $ sh < test.sh |
|
|||
4197 | 0 |
|
|||
4198 | ==== |
|
|||
4199 | 1 |
|
|||
4200 | ==== |
|
|||
4201 | 2 |
|
|||
4202 | ==== |
|
|||
4203 | 3 |
|
|||
4204 | ==== |
|
|||
4205 | 0 |
|
|||
4206 | 2 |
|
|||
4207 | ==== |
|
|||
4208 | 1 |
|
|||
4209 | 3 |
|
|||
4210 |
|
||||
4211 | test error message of bad revset |
|
|||
4212 | $ hg log -r 'foo\\' |
|
|||
4213 | hg: parse error at 3: syntax error in revset 'foo\\' |
|
|||
4214 | [255] |
|
|||
4215 |
|
||||
4216 | $ cd .. |
|
|||
4217 |
|
||||
4218 | Test that revset predicate of extension isn't loaded at failure of |
|
|||
4219 | loading it |
|
|||
4220 |
|
||||
4221 | $ cd repo |
|
|||
4222 |
|
||||
4223 | $ cat <<EOF > $TESTTMP/custompredicate.py |
|
|||
4224 | > from mercurial import error, registrar, revset |
|
|||
4225 | > |
|
|||
4226 | > revsetpredicate = registrar.revsetpredicate() |
|
|||
4227 | > |
|
|||
4228 | > @revsetpredicate('custom1()') |
|
|||
4229 | > def custom1(repo, subset, x): |
|
|||
4230 | > return revset.baseset([1]) |
|
|||
4231 | > |
|
|||
4232 | > raise error.Abort('intentional failure of loading extension') |
|
|||
4233 | > EOF |
|
|||
4234 | $ cat <<EOF > .hg/hgrc |
|
|||
4235 | > [extensions] |
|
|||
4236 | > custompredicate = $TESTTMP/custompredicate.py |
|
|||
4237 | > EOF |
|
|||
4238 |
|
||||
4239 | $ hg debugrevspec "custom1()" |
|
|||
4240 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension |
|
|||
4241 | hg: parse error: unknown identifier: custom1 |
|
|||
4242 | [255] |
|
|||
4243 |
|
||||
4244 | Test repo.anyrevs with customized revset overrides |
|
|||
4245 |
|
||||
4246 | $ cat > $TESTTMP/printprevset.py <<EOF |
|
|||
4247 | > from mercurial import encoding, registrar |
|
|||
4248 | > cmdtable = {} |
|
|||
4249 | > command = registrar.command(cmdtable) |
|
|||
4250 | > @command('printprevset') |
|
|||
4251 | > def printprevset(ui, repo): |
|
|||
4252 | > alias = {} |
|
|||
4253 | > p = encoding.environ.get('P') |
|
|||
4254 | > if p: |
|
|||
4255 | > alias['P'] = p |
|
|||
4256 | > revs = repo.anyrevs(['P'], user=True, localalias=alias) |
|
|||
4257 | > ui.write('P=%r\n' % list(revs)) |
|
|||
4258 | > EOF |
|
|||
4259 |
|
||||
4260 | $ cat >> .hg/hgrc <<EOF |
|
|||
4261 | > custompredicate = ! |
|
|||
4262 | > printprevset = $TESTTMP/printprevset.py |
|
|||
4263 | > EOF |
|
|||
4264 |
|
||||
4265 | $ hg --config revsetalias.P=1 printprevset |
|
|||
4266 | P=[1] |
|
|||
4267 | $ P=3 hg --config revsetalias.P=2 printprevset |
|
|||
4268 | P=[3] |
|
|||
4269 |
|
||||
4270 | $ cd .. |
|
|||
4271 |
|
||||
4272 | Test obsstore related revsets |
|
|||
4273 |
|
||||
4274 | $ hg init repo1 |
|
|||
4275 | $ cd repo1 |
|
|||
4276 | $ cat <<EOF >> .hg/hgrc |
|
|||
4277 | > [experimental] |
|
|||
4278 | > stabilization = createmarkers |
|
|||
4279 | > EOF |
|
|||
4280 |
|
||||
4281 | $ hg debugdrawdag <<'EOS' |
|
|||
4282 | > F G |
|
|||
4283 | > |/ # split: B -> E, F |
|
|||
4284 | > B C D E # amend: B -> C -> D |
|
|||
4285 | > \|/ | # amend: F -> G |
|
|||
4286 | > A A Z # amend: A -> Z |
|
|||
4287 | > EOS |
|
|||
4288 |
|
||||
4289 | $ hg log -r 'successors(Z)' -T '{desc}\n' |
|
|||
4290 | Z |
|
|||
4291 |
|
||||
4292 | $ hg log -r 'successors(F)' -T '{desc}\n' |
|
|||
4293 | F |
|
|||
4294 | G |
|
|||
4295 |
|
||||
4296 | $ hg tag --remove --local C D E F G |
|
|||
4297 |
|
||||
4298 | $ hg log -r 'successors(B)' -T '{desc}\n' |
|
|||
4299 | B |
|
|||
4300 | D |
|
|||
4301 | E |
|
|||
4302 | G |
|
|||
4303 |
|
||||
4304 | $ hg log -r 'successors(B)' -T '{desc}\n' --hidden |
|
|||
4305 | B |
|
|||
4306 | C |
|
|||
4307 | D |
|
|||
4308 | E |
|
|||
4309 | F |
|
|||
4310 | G |
|
|||
4311 |
|
||||
4312 | $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden |
|
|||
4313 | D |
|
|||
4314 | E |
|
|||
4315 | G |
|
|||
4316 |
|
||||
4317 | $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' |
|
|||
4318 | A |
|
|||
4319 | Z |
|
|||
4320 | B |
|
|||
4321 |
|
||||
4322 | $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' |
|
|||
4323 | Z |
|
|||
4324 |
|
||||
4325 | Test `draft() & ::x` optimization |
|
|||
4326 |
|
||||
4327 | $ hg init $TESTTMP/repo2 |
|
|||
4328 | $ cd $TESTTMP/repo2 |
|
|||
4329 | $ hg debugdrawdag <<'EOS' |
|
|||
4330 | > P5 S1 |
|
|||
4331 | > | | |
|
|||
4332 | > S2 | D3 |
|
|||
4333 | > \|/ |
|
|||
4334 | > P4 |
|
|||
4335 | > | |
|
|||
4336 | > P3 D2 |
|
|||
4337 | > | | |
|
|||
4338 | > P2 D1 |
|
|||
4339 | > |/ |
|
|||
4340 | > P1 |
|
|||
4341 | > | |
|
|||
4342 | > P0 |
|
|||
4343 | > EOS |
|
|||
4344 | $ hg phase --public -r P5 |
|
|||
4345 | $ hg phase --force --secret -r S1+S2 |
|
|||
4346 | $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' |
|
|||
4347 | o 8 P5 public |
|
|||
4348 | | |
|
|||
4349 | | o 10 S1 secret |
|
|||
4350 | | | |
|
|||
4351 | | o 7 D3 draft |
|
|||
4352 | |/ |
|
|||
4353 | | o 9 S2 secret |
|
|||
4354 | |/ |
|
|||
4355 | o 6 P4 public |
|
|||
4356 | | |
|
|||
4357 | o 5 P3 public |
|
|||
4358 | | |
|
|||
4359 | o 3 P2 public |
|
|||
4360 | | |
|
|||
4361 | | o 4 D2 draft |
|
|||
4362 | | | |
|
|||
4363 | | o 2 D1 draft |
|
|||
4364 | |/ |
|
|||
4365 | o 1 P1 public |
|
|||
4366 | | |
|
|||
4367 | o 0 P0 public |
|
|||
4368 |
|
||||
4369 | $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' |
|
|||
4370 | * analyzed: |
|
|||
4371 | (and |
|
|||
4372 | (func |
|
|||
4373 | (symbol 'draft') |
|
|||
4374 | None) |
|
|||
4375 | (func |
|
|||
4376 | (symbol 'ancestors') |
|
|||
4377 | (or |
|
|||
4378 | (list |
|
|||
4379 | (and |
|
|||
4380 | (or |
|
|||
4381 | (list |
|
|||
4382 | (symbol 'S1') |
|
|||
4383 | (symbol 'D1') |
|
|||
4384 | (symbol 'P5'))) |
|
|||
4385 | (not |
|
|||
4386 | (symbol 'D3'))) |
|
|||
4387 | (symbol 'S2'))))) |
|
|||
4388 | * optimized: |
|
|||
4389 | (func |
|
|||
4390 | (symbol '_phaseandancestors') |
|
|||
4391 | (list |
|
|||
4392 | (symbol 'draft') |
|
|||
4393 | (or |
|
|||
4394 | (list |
|
|||
4395 | (difference |
|
|||
4396 | (func |
|
|||
4397 | (symbol '_list') |
|
|||
4398 | (string 'S1\x00D1\x00P5')) |
|
|||
4399 | (symbol 'D3')) |
|
|||
4400 | (symbol 'S2'))))) |
|
|||
4401 | $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' |
|
|||
4402 | * analyzed: |
|
|||
4403 | (and |
|
|||
4404 | (func |
|
|||
4405 | (symbol 'secret') |
|
|||
4406 | None) |
|
|||
4407 | (func |
|
|||
4408 | (symbol 'ancestors') |
|
|||
4409 | (symbol '9'))) |
|
|||
4410 | * optimized: |
|
|||
4411 | (func |
|
|||
4412 | (symbol '_phaseandancestors') |
|
|||
4413 | (list |
|
|||
4414 | (symbol 'secret') |
|
|||
4415 | (symbol '9'))) |
|
|||
4416 | $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' |
|
|||
4417 | * analyzed: |
|
|||
4418 | (and |
|
|||
4419 | (symbol '7') |
|
|||
4420 | (and |
|
|||
4421 | (not |
|
|||
4422 | (func |
|
|||
4423 | (symbol 'public') |
|
|||
4424 | None)) |
|
|||
4425 | (func |
|
|||
4426 | (symbol 'ancestors') |
|
|||
4427 | (func |
|
|||
4428 | (symbol 'tag') |
|
|||
4429 | None)))) |
|
|||
4430 | * optimized: |
|
|||
4431 | (and |
|
|||
4432 | (symbol '7') |
|
|||
4433 | (func |
|
|||
4434 | (symbol '_phaseandancestors') |
|
|||
4435 | (list |
|
|||
4436 | (symbol '_notpublic') |
|
|||
4437 | (func |
|
|||
4438 | (symbol 'tag') |
|
|||
4439 | None)))) |
|
|||
4440 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' |
|
|||
4441 | * optimized: |
|
|||
4442 | (and |
|
|||
4443 | (func |
|
|||
4444 | (symbol '_notpublic') |
|
|||
4445 | None) |
|
|||
4446 | (func |
|
|||
4447 | (symbol 'ancestors') |
|
|||
4448 | (list |
|
|||
4449 | (func |
|
|||
4450 | (symbol '_list') |
|
|||
4451 | (string 'S1\x00D2\x00P5')) |
|
|||
4452 | (symbol '1')))) |
|
|||
4453 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' |
|
|||
4454 | * optimized: |
|
|||
4455 | (and |
|
|||
4456 | (func |
|
|||
4457 | (symbol '_notpublic') |
|
|||
4458 | None) |
|
|||
4459 | (func |
|
|||
4460 | (symbol 'ancestors') |
|
|||
4461 | (list |
|
|||
4462 | (func |
|
|||
4463 | (symbol '_list') |
|
|||
4464 | (string 'S1\x00D2\x00P5')) |
|
|||
4465 | (keyvalue |
|
|||
4466 | (symbol 'depth') |
|
|||
4467 | (symbol '1'))))) |
|
This diff has been collapsed as it changes many lines, (2649 lines changed) Show them Hide them | |||||
@@ -1,4467 +1,1818 | |||||
1 | $ HGENCODING=utf-8 |
|
1 | $ HGENCODING=utf-8 | |
2 | $ export HGENCODING |
|
2 | $ export HGENCODING | |
3 | $ cat > testrevset.py << EOF |
|
|||
4 | > import mercurial.revset |
|
|||
5 | > |
|
|||
6 | > baseset = mercurial.revset.baseset |
|
|||
7 | > |
|
|||
8 | > def r3232(repo, subset, x): |
|
|||
9 | > """"simple revset that return [3,2,3,2] |
|
|||
10 | > |
|
|||
11 | > revisions duplicated on purpose. |
|
|||
12 | > """ |
|
|||
13 | > if 3 not in subset: |
|
|||
14 | > if 2 in subset: |
|
|||
15 | > return baseset([2,2]) |
|
|||
16 | > return baseset() |
|
|||
17 | > return baseset([3,3,2,2]) |
|
|||
18 | > |
|
|||
19 | > mercurial.revset.symbols['r3232'] = r3232 |
|
|||
20 | > EOF |
|
|||
21 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
22 | > [extensions] |
|
4 | > [extensions] | |
23 | > drawdag=$TESTDIR/drawdag.py |
|
5 | > drawdag=$TESTDIR/drawdag.py | |
24 | > testrevset=$TESTTMP/testrevset.py |
|
|||
25 | > EOF |
|
6 | > EOF | |
26 |
|
7 | |||
27 | $ try() { |
|
8 | $ try() { | |
28 | > hg debugrevspec --debug "$@" |
|
9 | > hg debugrevspec --debug "$@" | |
29 | > } |
|
10 | > } | |
30 |
|
11 | |||
31 | $ log() { |
|
12 | $ log() { | |
32 | > hg log --template '{rev}\n' -r "$1" |
|
13 | > hg log --template '{rev}\n' -r "$1" | |
33 | > } |
|
14 | > } | |
34 |
|
15 | |||
35 | extension to build '_intlist()' and '_hexlist()', which is necessary because |
|
|||
36 | these predicates use '\0' as a separator: |
|
|||
37 |
|
||||
38 | $ cat <<EOF > debugrevlistspec.py |
|
|||
39 | > from __future__ import absolute_import |
|
|||
40 | > from mercurial import ( |
|
|||
41 | > node as nodemod, |
|
|||
42 | > registrar, |
|
|||
43 | > revset, |
|
|||
44 | > revsetlang, |
|
|||
45 | > smartset, |
|
|||
46 | > ) |
|
|||
47 | > cmdtable = {} |
|
|||
48 | > command = registrar.command(cmdtable) |
|
|||
49 | > @command(b'debugrevlistspec', |
|
|||
50 | > [('', 'optimize', None, 'print parsed tree after optimizing'), |
|
|||
51 | > ('', 'bin', None, 'unhexlify arguments')]) |
|
|||
52 | > def debugrevlistspec(ui, repo, fmt, *args, **opts): |
|
|||
53 | > if opts['bin']: |
|
|||
54 | > args = map(nodemod.bin, args) |
|
|||
55 | > expr = revsetlang.formatspec(fmt, list(args)) |
|
|||
56 | > if ui.verbose: |
|
|||
57 | > tree = revsetlang.parse(expr, lookup=repo.__contains__) |
|
|||
58 | > ui.note(revsetlang.prettyformat(tree), "\n") |
|
|||
59 | > if opts["optimize"]: |
|
|||
60 | > opttree = revsetlang.optimize(revsetlang.analyze(tree)) |
|
|||
61 | > ui.note("* optimized:\n", revsetlang.prettyformat(opttree), |
|
|||
62 | > "\n") |
|
|||
63 | > func = revset.match(ui, expr, repo) |
|
|||
64 | > revs = func(repo) |
|
|||
65 | > if ui.verbose: |
|
|||
66 | > ui.note("* set:\n", smartset.prettyformat(revs), "\n") |
|
|||
67 | > for c in revs: |
|
|||
68 | > ui.write("%s\n" % c) |
|
|||
69 | > EOF |
|
|||
70 | $ cat <<EOF >> $HGRCPATH |
|
|||
71 | > [extensions] |
|
|||
72 | > debugrevlistspec = $TESTTMP/debugrevlistspec.py |
|
|||
73 | > EOF |
|
|||
74 | $ trylist() { |
|
|||
75 | > hg debugrevlistspec --debug "$@" |
|
|||
76 | > } |
|
|||
77 |
|
||||
78 | $ hg init repo |
|
16 | $ hg init repo | |
79 | $ cd repo |
|
17 | $ cd repo | |
80 |
|
18 | |||
81 | $ echo a > a |
|
19 | $ echo a > a | |
82 | $ hg branch a |
|
20 | $ hg branch a | |
83 | marked working directory as branch a |
|
21 | marked working directory as branch a | |
84 | (branches are permanent and global, did you want a bookmark?) |
|
22 | (branches are permanent and global, did you want a bookmark?) | |
85 | $ hg ci -Aqm0 |
|
23 | $ hg ci -Aqm0 | |
86 |
|
24 | |||
87 | $ echo b > b |
|
25 | $ echo b > b | |
88 | $ hg branch b |
|
26 | $ hg branch b | |
89 | marked working directory as branch b |
|
27 | marked working directory as branch b | |
90 | $ hg ci -Aqm1 |
|
28 | $ hg ci -Aqm1 | |
91 |
|
29 | |||
92 | $ rm a |
|
30 | $ rm a | |
93 | $ hg branch a-b-c- |
|
31 | $ hg branch a-b-c- | |
94 | marked working directory as branch a-b-c- |
|
32 | marked working directory as branch a-b-c- | |
95 | $ hg ci -Aqm2 -u Bob |
|
33 | $ hg ci -Aqm2 -u Bob | |
96 |
|
34 | |||
97 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' |
|
35 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' | |
98 | 2 |
|
36 | 2 | |
99 | $ hg log -r "extra('branch')" --template '{rev}\n' |
|
37 | $ hg log -r "extra('branch')" --template '{rev}\n' | |
100 | 0 |
|
38 | 0 | |
101 | 1 |
|
39 | 1 | |
102 | 2 |
|
40 | 2 | |
103 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' |
|
41 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' | |
104 | 0 a |
|
42 | 0 a | |
105 | 2 a-b-c- |
|
43 | 2 a-b-c- | |
106 |
|
44 | |||
107 | $ hg co 1 |
|
45 | $ hg co 1 | |
108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
109 | $ hg branch +a+b+c+ |
|
47 | $ hg branch +a+b+c+ | |
110 | marked working directory as branch +a+b+c+ |
|
48 | marked working directory as branch +a+b+c+ | |
111 | $ hg ci -Aqm3 |
|
49 | $ hg ci -Aqm3 | |
112 |
|
50 | |||
113 | $ hg co 2 # interleave |
|
51 | $ hg co 2 # interleave | |
114 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
52 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
115 | $ echo bb > b |
|
53 | $ echo bb > b | |
116 | $ hg branch -- -a-b-c- |
|
54 | $ hg branch -- -a-b-c- | |
117 | marked working directory as branch -a-b-c- |
|
55 | marked working directory as branch -a-b-c- | |
118 | $ hg ci -Aqm4 -d "May 12 2005" |
|
56 | $ hg ci -Aqm4 -d "May 12 2005" | |
119 |
|
57 | |||
120 | $ hg co 3 |
|
58 | $ hg co 3 | |
121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | $ hg branch !a/b/c/ |
|
60 | $ hg branch !a/b/c/ | |
123 | marked working directory as branch !a/b/c/ |
|
61 | marked working directory as branch !a/b/c/ | |
124 | $ hg ci -Aqm"5 bug" |
|
62 | $ hg ci -Aqm"5 bug" | |
125 |
|
63 | |||
126 | $ hg merge 4 |
|
64 | $ hg merge 4 | |
127 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
65 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
128 | (branch merge, don't forget to commit) |
|
66 | (branch merge, don't forget to commit) | |
129 | $ hg branch _a_b_c_ |
|
67 | $ hg branch _a_b_c_ | |
130 | marked working directory as branch _a_b_c_ |
|
68 | marked working directory as branch _a_b_c_ | |
131 | $ hg ci -Aqm"6 issue619" |
|
69 | $ hg ci -Aqm"6 issue619" | |
132 |
|
70 | |||
133 | $ hg branch .a.b.c. |
|
71 | $ hg branch .a.b.c. | |
134 | marked working directory as branch .a.b.c. |
|
72 | marked working directory as branch .a.b.c. | |
135 | $ hg ci -Aqm7 |
|
73 | $ hg ci -Aqm7 | |
136 |
|
74 | |||
137 | $ hg branch all |
|
75 | $ hg branch all | |
138 | marked working directory as branch all |
|
76 | marked working directory as branch all | |
139 |
|
77 | |||
140 | $ hg co 4 |
|
78 | $ hg co 4 | |
141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
142 | $ hg branch Γ© |
|
80 | $ hg branch Γ© | |
143 | marked working directory as branch \xc3\xa9 (esc) |
|
81 | marked working directory as branch \xc3\xa9 (esc) | |
144 | $ hg ci -Aqm9 |
|
82 | $ hg ci -Aqm9 | |
145 |
|
83 | |||
146 | $ hg tag -r6 1.0 |
|
84 | $ hg tag -r6 1.0 | |
147 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
85 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
148 |
|
86 | |||
149 | $ hg clone --quiet -U -r 7 . ../remote1 |
|
87 | $ hg clone --quiet -U -r 7 . ../remote1 | |
150 | $ hg clone --quiet -U -r 8 . ../remote2 |
|
88 | $ hg clone --quiet -U -r 8 . ../remote2 | |
151 | $ echo "[paths]" >> .hg/hgrc |
|
89 | $ echo "[paths]" >> .hg/hgrc | |
152 | $ echo "default = ../remote1" >> .hg/hgrc |
|
90 | $ echo "default = ../remote1" >> .hg/hgrc | |
153 |
|
91 | |||
154 | trivial |
|
|||
155 |
|
||||
156 | $ try 0:1 |
|
|||
157 | (range |
|
|||
158 | (symbol '0') |
|
|||
159 | (symbol '1')) |
|
|||
160 | * set: |
|
|||
161 | <spanset+ 0:2> |
|
|||
162 | 0 |
|
|||
163 | 1 |
|
|||
164 | $ try --optimize : |
|
|||
165 | (rangeall |
|
|||
166 | None) |
|
|||
167 | * optimized: |
|
|||
168 | (rangeall |
|
|||
169 | None) |
|
|||
170 | * set: |
|
|||
171 | <spanset+ 0:10> |
|
|||
172 | 0 |
|
|||
173 | 1 |
|
|||
174 | 2 |
|
|||
175 | 3 |
|
|||
176 | 4 |
|
|||
177 | 5 |
|
|||
178 | 6 |
|
|||
179 | 7 |
|
|||
180 | 8 |
|
|||
181 | 9 |
|
|||
182 | $ try 3::6 |
|
|||
183 | (dagrange |
|
|||
184 | (symbol '3') |
|
|||
185 | (symbol '6')) |
|
|||
186 | * set: |
|
|||
187 | <baseset+ [3, 5, 6]> |
|
|||
188 | 3 |
|
|||
189 | 5 |
|
|||
190 | 6 |
|
|||
191 | $ try '0|1|2' |
|
|||
192 | (or |
|
|||
193 | (list |
|
|||
194 | (symbol '0') |
|
|||
195 | (symbol '1') |
|
|||
196 | (symbol '2'))) |
|
|||
197 | * set: |
|
|||
198 | <baseset [0, 1, 2]> |
|
|||
199 | 0 |
|
|||
200 | 1 |
|
|||
201 | 2 |
|
|||
202 |
|
||||
203 | names that should work without quoting |
|
|||
204 |
|
||||
205 | $ try a |
|
|||
206 | (symbol 'a') |
|
|||
207 | * set: |
|
|||
208 | <baseset [0]> |
|
|||
209 | 0 |
|
|||
210 | $ try b-a |
|
|||
211 | (minus |
|
|||
212 | (symbol 'b') |
|
|||
213 | (symbol 'a')) |
|
|||
214 | * set: |
|
|||
215 | <filteredset |
|
|||
216 | <baseset [1]>, |
|
|||
217 | <not |
|
|||
218 | <baseset [0]>>> |
|
|||
219 | 1 |
|
|||
220 | $ try _a_b_c_ |
|
|||
221 | (symbol '_a_b_c_') |
|
|||
222 | * set: |
|
|||
223 | <baseset [6]> |
|
|||
224 | 6 |
|
|||
225 | $ try _a_b_c_-a |
|
|||
226 | (minus |
|
|||
227 | (symbol '_a_b_c_') |
|
|||
228 | (symbol 'a')) |
|
|||
229 | * set: |
|
|||
230 | <filteredset |
|
|||
231 | <baseset [6]>, |
|
|||
232 | <not |
|
|||
233 | <baseset [0]>>> |
|
|||
234 | 6 |
|
|||
235 | $ try .a.b.c. |
|
|||
236 | (symbol '.a.b.c.') |
|
|||
237 | * set: |
|
|||
238 | <baseset [7]> |
|
|||
239 | 7 |
|
|||
240 | $ try .a.b.c.-a |
|
|||
241 | (minus |
|
|||
242 | (symbol '.a.b.c.') |
|
|||
243 | (symbol 'a')) |
|
|||
244 | * set: |
|
|||
245 | <filteredset |
|
|||
246 | <baseset [7]>, |
|
|||
247 | <not |
|
|||
248 | <baseset [0]>>> |
|
|||
249 | 7 |
|
|||
250 |
|
||||
251 | names that should be caught by fallback mechanism |
|
|||
252 |
|
||||
253 | $ try -- '-a-b-c-' |
|
|||
254 | (symbol '-a-b-c-') |
|
|||
255 | * set: |
|
|||
256 | <baseset [4]> |
|
|||
257 | 4 |
|
|||
258 | $ log -a-b-c- |
|
|||
259 | 4 |
|
|||
260 | $ try '+a+b+c+' |
|
|||
261 | (symbol '+a+b+c+') |
|
|||
262 | * set: |
|
|||
263 | <baseset [3]> |
|
|||
264 | 3 |
|
|||
265 | $ try '+a+b+c+:' |
|
|||
266 | (rangepost |
|
|||
267 | (symbol '+a+b+c+')) |
|
|||
268 | * set: |
|
|||
269 | <spanset+ 3:10> |
|
|||
270 | 3 |
|
|||
271 | 4 |
|
|||
272 | 5 |
|
|||
273 | 6 |
|
|||
274 | 7 |
|
|||
275 | 8 |
|
|||
276 | 9 |
|
|||
277 | $ try ':+a+b+c+' |
|
|||
278 | (rangepre |
|
|||
279 | (symbol '+a+b+c+')) |
|
|||
280 | * set: |
|
|||
281 | <spanset+ 0:4> |
|
|||
282 | 0 |
|
|||
283 | 1 |
|
|||
284 | 2 |
|
|||
285 | 3 |
|
|||
286 | $ try -- '-a-b-c-:+a+b+c+' |
|
|||
287 | (range |
|
|||
288 | (symbol '-a-b-c-') |
|
|||
289 | (symbol '+a+b+c+')) |
|
|||
290 | * set: |
|
|||
291 | <spanset- 3:5> |
|
|||
292 | 4 |
|
|||
293 | 3 |
|
|||
294 | $ log '-a-b-c-:+a+b+c+' |
|
|||
295 | 4 |
|
|||
296 | 3 |
|
|||
297 |
|
||||
298 | $ try -- -a-b-c--a # complains |
|
|||
299 | (minus |
|
|||
300 | (minus |
|
|||
301 | (minus |
|
|||
302 | (negate |
|
|||
303 | (symbol 'a')) |
|
|||
304 | (symbol 'b')) |
|
|||
305 | (symbol 'c')) |
|
|||
306 | (negate |
|
|||
307 | (symbol 'a'))) |
|
|||
308 | abort: unknown revision '-a'! |
|
|||
309 | [255] |
|
|||
310 | $ try Γ© |
|
|||
311 | (symbol '\xc3\xa9') |
|
|||
312 | * set: |
|
|||
313 | <baseset [9]> |
|
|||
314 | 9 |
|
|||
315 |
|
||||
316 | no quoting needed |
|
|||
317 |
|
||||
318 | $ log ::a-b-c- |
|
|||
319 | 0 |
|
|||
320 | 1 |
|
|||
321 | 2 |
|
|||
322 |
|
||||
323 | quoting needed |
|
|||
324 |
|
||||
325 | $ try '"-a-b-c-"-a' |
|
|||
326 | (minus |
|
|||
327 | (string '-a-b-c-') |
|
|||
328 | (symbol 'a')) |
|
|||
329 | * set: |
|
|||
330 | <filteredset |
|
|||
331 | <baseset [4]>, |
|
|||
332 | <not |
|
|||
333 | <baseset [0]>>> |
|
|||
334 | 4 |
|
|||
335 |
|
||||
336 | $ log '1 or 2' |
|
|||
337 | 1 |
|
|||
338 | 2 |
|
|||
339 | $ log '1|2' |
|
|||
340 | 1 |
|
|||
341 | 2 |
|
|||
342 | $ log '1 and 2' |
|
|||
343 | $ log '1&2' |
|
|||
344 | $ try '1&2|3' # precedence - and is higher |
|
|||
345 | (or |
|
|||
346 | (list |
|
|||
347 | (and |
|
|||
348 | (symbol '1') |
|
|||
349 | (symbol '2')) |
|
|||
350 | (symbol '3'))) |
|
|||
351 | * set: |
|
|||
352 | <addset |
|
|||
353 | <baseset []>, |
|
|||
354 | <baseset [3]>> |
|
|||
355 | 3 |
|
|||
356 | $ try '1|2&3' |
|
|||
357 | (or |
|
|||
358 | (list |
|
|||
359 | (symbol '1') |
|
|||
360 | (and |
|
|||
361 | (symbol '2') |
|
|||
362 | (symbol '3')))) |
|
|||
363 | * set: |
|
|||
364 | <addset |
|
|||
365 | <baseset [1]>, |
|
|||
366 | <baseset []>> |
|
|||
367 | 1 |
|
|||
368 | $ try '1&2&3' # associativity |
|
|||
369 | (and |
|
|||
370 | (and |
|
|||
371 | (symbol '1') |
|
|||
372 | (symbol '2')) |
|
|||
373 | (symbol '3')) |
|
|||
374 | * set: |
|
|||
375 | <baseset []> |
|
|||
376 | $ try '1|(2|3)' |
|
|||
377 | (or |
|
|||
378 | (list |
|
|||
379 | (symbol '1') |
|
|||
380 | (group |
|
|||
381 | (or |
|
|||
382 | (list |
|
|||
383 | (symbol '2') |
|
|||
384 | (symbol '3')))))) |
|
|||
385 | * set: |
|
|||
386 | <addset |
|
|||
387 | <baseset [1]>, |
|
|||
388 | <baseset [2, 3]>> |
|
|||
389 | 1 |
|
|||
390 | 2 |
|
|||
391 | 3 |
|
|||
392 | $ log '1.0' # tag |
|
|||
393 | 6 |
|
|||
394 | $ log 'a' # branch |
|
|||
395 | 0 |
|
|||
396 | $ log '2785f51ee' |
|
|||
397 | 0 |
|
|||
398 | $ log 'date(2005)' |
|
|||
399 | 4 |
|
|||
400 | $ log 'date(this is a test)' |
|
|||
401 | hg: parse error at 10: unexpected token: symbol |
|
|||
402 | [255] |
|
|||
403 | $ log 'date()' |
|
|||
404 | hg: parse error: date requires a string |
|
|||
405 | [255] |
|
|||
406 | $ log 'date' |
|
|||
407 | abort: unknown revision 'date'! |
|
|||
408 | [255] |
|
|||
409 | $ log 'date(' |
|
|||
410 | hg: parse error at 5: not a prefix: end |
|
|||
411 | [255] |
|
|||
412 | $ log 'date("\xy")' |
|
|||
413 | hg: parse error: invalid \x escape |
|
|||
414 | [255] |
|
|||
415 | $ log 'date(tip)' |
|
|||
416 | hg: parse error: invalid date: 'tip' |
|
|||
417 | [255] |
|
|||
418 | $ log '0:date' |
|
|||
419 | abort: unknown revision 'date'! |
|
|||
420 | [255] |
|
|||
421 | $ log '::"date"' |
|
|||
422 | abort: unknown revision 'date'! |
|
|||
423 | [255] |
|
|||
424 | $ hg book date -r 4 |
|
|||
425 | $ log '0:date' |
|
|||
426 | 0 |
|
|||
427 | 1 |
|
|||
428 | 2 |
|
|||
429 | 3 |
|
|||
430 | 4 |
|
|||
431 | $ log '::date' |
|
|||
432 | 0 |
|
|||
433 | 1 |
|
|||
434 | 2 |
|
|||
435 | 4 |
|
|||
436 | $ log '::"date"' |
|
|||
437 | 0 |
|
|||
438 | 1 |
|
|||
439 | 2 |
|
|||
440 | 4 |
|
|||
441 | $ log 'date(2005) and 1::' |
|
|||
442 | 4 |
|
|||
443 | $ hg book -d date |
|
|||
444 |
|
||||
445 | function name should be a symbol |
|
|||
446 |
|
||||
447 | $ log '"date"(2005)' |
|
|||
448 | hg: parse error: not a symbol |
|
|||
449 | [255] |
|
|||
450 |
|
||||
451 | keyword arguments |
|
|||
452 |
|
||||
453 | $ log 'extra(branch, value=a)' |
|
|||
454 | 0 |
|
|||
455 |
|
||||
456 | $ log 'extra(branch, a, b)' |
|
|||
457 | hg: parse error: extra takes at most 2 positional arguments |
|
|||
458 | [255] |
|
|||
459 | $ log 'extra(a, label=b)' |
|
|||
460 | hg: parse error: extra got multiple values for keyword argument 'label' |
|
|||
461 | [255] |
|
|||
462 | $ log 'extra(label=branch, default)' |
|
|||
463 | hg: parse error: extra got an invalid argument |
|
|||
464 | [255] |
|
|||
465 | $ log 'extra(branch, foo+bar=baz)' |
|
|||
466 | hg: parse error: extra got an invalid argument |
|
|||
467 | [255] |
|
|||
468 | $ log 'extra(unknown=branch)' |
|
|||
469 | hg: parse error: extra got an unexpected keyword argument 'unknown' |
|
|||
470 | [255] |
|
|||
471 |
|
||||
472 | $ try 'foo=bar|baz' |
|
|||
473 | (keyvalue |
|
|||
474 | (symbol 'foo') |
|
|||
475 | (or |
|
|||
476 | (list |
|
|||
477 | (symbol 'bar') |
|
|||
478 | (symbol 'baz')))) |
|
|||
479 | hg: parse error: can't use a key-value pair in this context |
|
|||
480 | [255] |
|
|||
481 |
|
||||
482 | right-hand side should be optimized recursively |
|
|||
483 |
|
||||
484 | $ try --optimize 'foo=(not public())' |
|
|||
485 | (keyvalue |
|
|||
486 | (symbol 'foo') |
|
|||
487 | (group |
|
|||
488 | (not |
|
|||
489 | (func |
|
|||
490 | (symbol 'public') |
|
|||
491 | None)))) |
|
|||
492 | * optimized: |
|
|||
493 | (keyvalue |
|
|||
494 | (symbol 'foo') |
|
|||
495 | (func |
|
|||
496 | (symbol '_notpublic') |
|
|||
497 | None)) |
|
|||
498 | hg: parse error: can't use a key-value pair in this context |
|
|||
499 | [255] |
|
|||
500 |
|
||||
501 | relation-subscript operator has the highest binding strength (as function call): |
|
|||
502 |
|
||||
503 | $ hg debugrevspec -p parsed 'tip:tip^#generations[-1]' |
|
|||
504 | * parsed: |
|
|||
505 | (range |
|
|||
506 | (symbol 'tip') |
|
|||
507 | (relsubscript |
|
|||
508 | (parentpost |
|
|||
509 | (symbol 'tip')) |
|
|||
510 | (symbol 'generations') |
|
|||
511 | (negate |
|
|||
512 | (symbol '1')))) |
|
|||
513 | 9 |
|
|||
514 | 8 |
|
|||
515 | 7 |
|
|||
516 | 6 |
|
|||
517 | 5 |
|
|||
518 | 4 |
|
|||
519 |
|
||||
520 | $ hg debugrevspec -p parsed --no-show-revs 'not public()#generations[0]' |
|
|||
521 | * parsed: |
|
|||
522 | (not |
|
|||
523 | (relsubscript |
|
|||
524 | (func |
|
|||
525 | (symbol 'public') |
|
|||
526 | None) |
|
|||
527 | (symbol 'generations') |
|
|||
528 | (symbol '0'))) |
|
|||
529 |
|
||||
530 | left-hand side of relation-subscript operator should be optimized recursively: |
|
|||
531 |
|
||||
532 | $ hg debugrevspec -p analyzed -p optimized --no-show-revs \ |
|
|||
533 | > '(not public())#generations[0]' |
|
|||
534 | * analyzed: |
|
|||
535 | (relsubscript |
|
|||
536 | (not |
|
|||
537 | (func |
|
|||
538 | (symbol 'public') |
|
|||
539 | None)) |
|
|||
540 | (symbol 'generations') |
|
|||
541 | (symbol '0')) |
|
|||
542 | * optimized: |
|
|||
543 | (relsubscript |
|
|||
544 | (func |
|
|||
545 | (symbol '_notpublic') |
|
|||
546 | None) |
|
|||
547 | (symbol 'generations') |
|
|||
548 | (symbol '0')) |
|
|||
549 |
|
||||
550 | resolution of subscript and relation-subscript ternary operators: |
|
|||
551 |
|
||||
552 | $ hg debugrevspec -p analyzed 'tip[0]' |
|
|||
553 | * analyzed: |
|
|||
554 | (subscript |
|
|||
555 | (symbol 'tip') |
|
|||
556 | (symbol '0')) |
|
|||
557 | hg: parse error: can't use a subscript in this context |
|
|||
558 | [255] |
|
|||
559 |
|
||||
560 | $ hg debugrevspec -p analyzed 'tip#rel[0]' |
|
|||
561 | * analyzed: |
|
|||
562 | (relsubscript |
|
|||
563 | (symbol 'tip') |
|
|||
564 | (symbol 'rel') |
|
|||
565 | (symbol '0')) |
|
|||
566 | hg: parse error: unknown identifier: rel |
|
|||
567 | [255] |
|
|||
568 |
|
||||
569 | $ hg debugrevspec -p analyzed '(tip#rel)[0]' |
|
|||
570 | * analyzed: |
|
|||
571 | (subscript |
|
|||
572 | (relation |
|
|||
573 | (symbol 'tip') |
|
|||
574 | (symbol 'rel')) |
|
|||
575 | (symbol '0')) |
|
|||
576 | hg: parse error: can't use a subscript in this context |
|
|||
577 | [255] |
|
|||
578 |
|
||||
579 | $ hg debugrevspec -p analyzed 'tip#rel[0][1]' |
|
|||
580 | * analyzed: |
|
|||
581 | (subscript |
|
|||
582 | (relsubscript |
|
|||
583 | (symbol 'tip') |
|
|||
584 | (symbol 'rel') |
|
|||
585 | (symbol '0')) |
|
|||
586 | (symbol '1')) |
|
|||
587 | hg: parse error: can't use a subscript in this context |
|
|||
588 | [255] |
|
|||
589 |
|
||||
590 | $ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]' |
|
|||
591 | * analyzed: |
|
|||
592 | (relsubscript |
|
|||
593 | (relation |
|
|||
594 | (symbol 'tip') |
|
|||
595 | (symbol 'rel0')) |
|
|||
596 | (symbol 'rel1') |
|
|||
597 | (symbol '1')) |
|
|||
598 | hg: parse error: unknown identifier: rel1 |
|
|||
599 | [255] |
|
|||
600 |
|
||||
601 | $ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]' |
|
|||
602 | * analyzed: |
|
|||
603 | (relsubscript |
|
|||
604 | (relsubscript |
|
|||
605 | (symbol 'tip') |
|
|||
606 | (symbol 'rel0') |
|
|||
607 | (symbol '0')) |
|
|||
608 | (symbol 'rel1') |
|
|||
609 | (symbol '1')) |
|
|||
610 | hg: parse error: unknown identifier: rel1 |
|
|||
611 | [255] |
|
|||
612 |
|
||||
613 | parse errors of relation, subscript and relation-subscript operators: |
|
|||
614 |
|
||||
615 | $ hg debugrevspec '[0]' |
|
|||
616 | hg: parse error at 0: not a prefix: [ |
|
|||
617 | [255] |
|
|||
618 | $ hg debugrevspec '.#' |
|
|||
619 | hg: parse error at 2: not a prefix: end |
|
|||
620 | [255] |
|
|||
621 | $ hg debugrevspec '#rel' |
|
|||
622 | hg: parse error at 0: not a prefix: # |
|
|||
623 | [255] |
|
|||
624 | $ hg debugrevspec '.#rel[0' |
|
|||
625 | hg: parse error at 7: unexpected token: end |
|
|||
626 | [255] |
|
|||
627 | $ hg debugrevspec '.]' |
|
|||
628 | hg: parse error at 1: invalid token |
|
|||
629 | [255] |
|
|||
630 |
|
||||
631 | $ hg debugrevspec '.#generations[a]' |
|
|||
632 | hg: parse error: relation subscript must be an integer |
|
|||
633 | [255] |
|
|||
634 | $ hg debugrevspec '.#generations[1-2]' |
|
|||
635 | hg: parse error: relation subscript must be an integer |
|
|||
636 | [255] |
|
|||
637 |
|
||||
638 | parsed tree at stages: |
|
|||
639 |
|
||||
640 | $ hg debugrevspec -p all '()' |
|
|||
641 | * parsed: |
|
|||
642 | (group |
|
|||
643 | None) |
|
|||
644 | * expanded: |
|
|||
645 | (group |
|
|||
646 | None) |
|
|||
647 | * concatenated: |
|
|||
648 | (group |
|
|||
649 | None) |
|
|||
650 | * analyzed: |
|
|||
651 | None |
|
|||
652 | * optimized: |
|
|||
653 | None |
|
|||
654 | hg: parse error: missing argument |
|
|||
655 | [255] |
|
|||
656 |
|
||||
657 | $ hg debugrevspec --no-optimized -p all '()' |
|
|||
658 | * parsed: |
|
|||
659 | (group |
|
|||
660 | None) |
|
|||
661 | * expanded: |
|
|||
662 | (group |
|
|||
663 | None) |
|
|||
664 | * concatenated: |
|
|||
665 | (group |
|
|||
666 | None) |
|
|||
667 | * analyzed: |
|
|||
668 | None |
|
|||
669 | hg: parse error: missing argument |
|
|||
670 | [255] |
|
|||
671 |
|
||||
672 | $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1' |
|
|||
673 | * parsed: |
|
|||
674 | (minus |
|
|||
675 | (group |
|
|||
676 | (or |
|
|||
677 | (list |
|
|||
678 | (symbol '0') |
|
|||
679 | (symbol '1')))) |
|
|||
680 | (symbol '1')) |
|
|||
681 | * analyzed: |
|
|||
682 | (and |
|
|||
683 | (or |
|
|||
684 | (list |
|
|||
685 | (symbol '0') |
|
|||
686 | (symbol '1'))) |
|
|||
687 | (not |
|
|||
688 | (symbol '1'))) |
|
|||
689 | * optimized: |
|
|||
690 | (difference |
|
|||
691 | (func |
|
|||
692 | (symbol '_list') |
|
|||
693 | (string '0\x001')) |
|
|||
694 | (symbol '1')) |
|
|||
695 | 0 |
|
|||
696 |
|
||||
697 | $ hg debugrevspec -p unknown '0' |
|
|||
698 | abort: invalid stage name: unknown |
|
|||
699 | [255] |
|
|||
700 |
|
||||
701 | $ hg debugrevspec -p all --optimize '0' |
|
|||
702 | abort: cannot use --optimize with --show-stage |
|
|||
703 | [255] |
|
|||
704 |
|
||||
705 | verify optimized tree: |
|
|||
706 |
|
||||
707 | $ hg debugrevspec --verify '0|1' |
|
|||
708 |
|
||||
709 | $ hg debugrevspec --verify -v -p analyzed -p optimized 'r3232() & 2' |
|
|||
710 | * analyzed: |
|
|||
711 | (and |
|
|||
712 | (func |
|
|||
713 | (symbol 'r3232') |
|
|||
714 | None) |
|
|||
715 | (symbol '2')) |
|
|||
716 | * optimized: |
|
|||
717 | (andsmally |
|
|||
718 | (func |
|
|||
719 | (symbol 'r3232') |
|
|||
720 | None) |
|
|||
721 | (symbol '2')) |
|
|||
722 | * analyzed set: |
|
|||
723 | <baseset [2]> |
|
|||
724 | * optimized set: |
|
|||
725 | <baseset [2, 2]> |
|
|||
726 | --- analyzed |
|
|||
727 | +++ optimized |
|
|||
728 | 2 |
|
|||
729 | +2 |
|
|||
730 | [1] |
|
|||
731 |
|
||||
732 | $ hg debugrevspec --no-optimized --verify-optimized '0' |
|
|||
733 | abort: cannot use --verify-optimized with --no-optimized |
|
|||
734 | [255] |
|
|||
735 |
|
||||
736 | Test that symbols only get parsed as functions if there's an opening |
|
|||
737 | parenthesis. |
|
|||
738 |
|
||||
739 | $ hg book only -r 9 |
|
|||
740 | $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark |
|
|||
741 | 8 |
|
|||
742 | 9 |
|
|||
743 |
|
||||
744 | ':y' behaves like '0:y', but can't be rewritten as such since the revision '0' |
|
|||
745 | may be hidden (issue5385) |
|
|||
746 |
|
||||
747 | $ try -p parsed -p analyzed ':' |
|
|||
748 | * parsed: |
|
|||
749 | (rangeall |
|
|||
750 | None) |
|
|||
751 | * analyzed: |
|
|||
752 | (rangeall |
|
|||
753 | None) |
|
|||
754 | * set: |
|
|||
755 | <spanset+ 0:10> |
|
|||
756 | 0 |
|
|||
757 | 1 |
|
|||
758 | 2 |
|
|||
759 | 3 |
|
|||
760 | 4 |
|
|||
761 | 5 |
|
|||
762 | 6 |
|
|||
763 | 7 |
|
|||
764 | 8 |
|
|||
765 | 9 |
|
|||
766 | $ try -p analyzed ':1' |
|
|||
767 | * analyzed: |
|
|||
768 | (rangepre |
|
|||
769 | (symbol '1')) |
|
|||
770 | * set: |
|
|||
771 | <spanset+ 0:2> |
|
|||
772 | 0 |
|
|||
773 | 1 |
|
|||
774 | $ try -p analyzed ':(1|2)' |
|
|||
775 | * analyzed: |
|
|||
776 | (rangepre |
|
|||
777 | (or |
|
|||
778 | (list |
|
|||
779 | (symbol '1') |
|
|||
780 | (symbol '2')))) |
|
|||
781 | * set: |
|
|||
782 | <spanset+ 0:3> |
|
|||
783 | 0 |
|
|||
784 | 1 |
|
|||
785 | 2 |
|
|||
786 | $ try -p analyzed ':(1&2)' |
|
|||
787 | * analyzed: |
|
|||
788 | (rangepre |
|
|||
789 | (and |
|
|||
790 | (symbol '1') |
|
|||
791 | (symbol '2'))) |
|
|||
792 | * set: |
|
|||
793 | <baseset []> |
|
|||
794 |
|
||||
795 | infix/suffix resolution of ^ operator (issue2884): |
|
|||
796 |
|
||||
797 | x^:y means (x^):y |
|
|||
798 |
|
||||
799 | $ try '1^:2' |
|
|||
800 | (range |
|
|||
801 | (parentpost |
|
|||
802 | (symbol '1')) |
|
|||
803 | (symbol '2')) |
|
|||
804 | * set: |
|
|||
805 | <spanset+ 0:3> |
|
|||
806 | 0 |
|
|||
807 | 1 |
|
|||
808 | 2 |
|
|||
809 |
|
||||
810 | $ try '1^::2' |
|
|||
811 | (dagrange |
|
|||
812 | (parentpost |
|
|||
813 | (symbol '1')) |
|
|||
814 | (symbol '2')) |
|
|||
815 | * set: |
|
|||
816 | <baseset+ [0, 1, 2]> |
|
|||
817 | 0 |
|
|||
818 | 1 |
|
|||
819 | 2 |
|
|||
820 |
|
||||
821 | $ try '9^:' |
|
|||
822 | (rangepost |
|
|||
823 | (parentpost |
|
|||
824 | (symbol '9'))) |
|
|||
825 | * set: |
|
|||
826 | <spanset+ 8:10> |
|
|||
827 | 8 |
|
|||
828 | 9 |
|
|||
829 |
|
||||
830 | x^:y should be resolved before omitting group operators |
|
|||
831 |
|
||||
832 | $ try '1^(:2)' |
|
|||
833 | (parent |
|
|||
834 | (symbol '1') |
|
|||
835 | (group |
|
|||
836 | (rangepre |
|
|||
837 | (symbol '2')))) |
|
|||
838 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
|||
839 | [255] |
|
|||
840 |
|
||||
841 | x^:y should be resolved recursively |
|
|||
842 |
|
||||
843 | $ try 'sort(1^:2)' |
|
|||
844 | (func |
|
|||
845 | (symbol 'sort') |
|
|||
846 | (range |
|
|||
847 | (parentpost |
|
|||
848 | (symbol '1')) |
|
|||
849 | (symbol '2'))) |
|
|||
850 | * set: |
|
|||
851 | <spanset+ 0:3> |
|
|||
852 | 0 |
|
|||
853 | 1 |
|
|||
854 | 2 |
|
|||
855 |
|
||||
856 | $ try '(3^:4)^:2' |
|
|||
857 | (range |
|
|||
858 | (parentpost |
|
|||
859 | (group |
|
|||
860 | (range |
|
|||
861 | (parentpost |
|
|||
862 | (symbol '3')) |
|
|||
863 | (symbol '4')))) |
|
|||
864 | (symbol '2')) |
|
|||
865 | * set: |
|
|||
866 | <spanset+ 0:3> |
|
|||
867 | 0 |
|
|||
868 | 1 |
|
|||
869 | 2 |
|
|||
870 |
|
||||
871 | $ try '(3^::4)^::2' |
|
|||
872 | (dagrange |
|
|||
873 | (parentpost |
|
|||
874 | (group |
|
|||
875 | (dagrange |
|
|||
876 | (parentpost |
|
|||
877 | (symbol '3')) |
|
|||
878 | (symbol '4')))) |
|
|||
879 | (symbol '2')) |
|
|||
880 | * set: |
|
|||
881 | <baseset+ [0, 1, 2]> |
|
|||
882 | 0 |
|
|||
883 | 1 |
|
|||
884 | 2 |
|
|||
885 |
|
||||
886 | $ try '(9^:)^:' |
|
|||
887 | (rangepost |
|
|||
888 | (parentpost |
|
|||
889 | (group |
|
|||
890 | (rangepost |
|
|||
891 | (parentpost |
|
|||
892 | (symbol '9')))))) |
|
|||
893 | * set: |
|
|||
894 | <spanset+ 4:10> |
|
|||
895 | 4 |
|
|||
896 | 5 |
|
|||
897 | 6 |
|
|||
898 | 7 |
|
|||
899 | 8 |
|
|||
900 | 9 |
|
|||
901 |
|
||||
902 | x^ in alias should also be resolved |
|
|||
903 |
|
||||
904 | $ try 'A' --config 'revsetalias.A=1^:2' |
|
|||
905 | (symbol 'A') |
|
|||
906 | * expanded: |
|
|||
907 | (range |
|
|||
908 | (parentpost |
|
|||
909 | (symbol '1')) |
|
|||
910 | (symbol '2')) |
|
|||
911 | * set: |
|
|||
912 | <spanset+ 0:3> |
|
|||
913 | 0 |
|
|||
914 | 1 |
|
|||
915 | 2 |
|
|||
916 |
|
||||
917 | $ try 'A:2' --config 'revsetalias.A=1^' |
|
|||
918 | (range |
|
|||
919 | (symbol 'A') |
|
|||
920 | (symbol '2')) |
|
|||
921 | * expanded: |
|
|||
922 | (range |
|
|||
923 | (parentpost |
|
|||
924 | (symbol '1')) |
|
|||
925 | (symbol '2')) |
|
|||
926 | * set: |
|
|||
927 | <spanset+ 0:3> |
|
|||
928 | 0 |
|
|||
929 | 1 |
|
|||
930 | 2 |
|
|||
931 |
|
||||
932 | but not beyond the boundary of alias expansion, because the resolution should |
|
|||
933 | be made at the parsing stage |
|
|||
934 |
|
||||
935 | $ try '1^A' --config 'revsetalias.A=:2' |
|
|||
936 | (parent |
|
|||
937 | (symbol '1') |
|
|||
938 | (symbol 'A')) |
|
|||
939 | * expanded: |
|
|||
940 | (parent |
|
|||
941 | (symbol '1') |
|
|||
942 | (rangepre |
|
|||
943 | (symbol '2'))) |
|
|||
944 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
|||
945 | [255] |
|
|||
946 |
|
||||
947 | ancestor can accept 0 or more arguments |
|
|||
948 |
|
||||
949 | $ log 'ancestor()' |
|
|||
950 | $ log 'ancestor(1)' |
|
|||
951 | 1 |
|
|||
952 | $ log 'ancestor(4,5)' |
|
|||
953 | 1 |
|
|||
954 | $ log 'ancestor(4,5) and 4' |
|
|||
955 | $ log 'ancestor(0,0,1,3)' |
|
|||
956 | 0 |
|
|||
957 | $ log 'ancestor(3,1,5,3,5,1)' |
|
|||
958 | 1 |
|
|||
959 | $ log 'ancestor(0,1,3,5)' |
|
|||
960 | 0 |
|
|||
961 | $ log 'ancestor(1,2,3,4,5)' |
|
|||
962 | 1 |
|
|||
963 |
|
||||
964 | test ancestors |
|
|||
965 |
|
||||
966 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True |
|
|||
967 | @ 9 |
|
|||
968 | o 8 |
|
|||
969 | | o 7 |
|
|||
970 | | o 6 |
|
|||
971 | |/| |
|
|||
972 | | o 5 |
|
|||
973 | o | 4 |
|
|||
974 | | o 3 |
|
|||
975 | o | 2 |
|
|||
976 | |/ |
|
|||
977 | o 1 |
|
|||
978 | o 0 |
|
|||
979 |
|
||||
980 | $ log 'ancestors(5)' |
|
|||
981 | 0 |
|
|||
982 | 1 |
|
|||
983 | 3 |
|
|||
984 | 5 |
|
|||
985 | $ log 'ancestor(ancestors(5))' |
|
|||
986 | 0 |
|
|||
987 | $ log '::r3232()' |
|
|||
988 | 0 |
|
|||
989 | 1 |
|
|||
990 | 2 |
|
|||
991 | 3 |
|
|||
992 |
|
||||
993 | test ancestors with depth limit |
|
|||
994 |
|
||||
995 | (depth=0 selects the node itself) |
|
|||
996 |
|
||||
997 | $ log 'reverse(ancestors(9, depth=0))' |
|
|||
998 | 9 |
|
|||
999 |
|
||||
1000 | (interleaved: '4' would be missing if heap queue were higher depth first) |
|
|||
1001 |
|
||||
1002 | $ log 'reverse(ancestors(8:9, depth=1))' |
|
|||
1003 | 9 |
|
|||
1004 | 8 |
|
|||
1005 | 4 |
|
|||
1006 |
|
||||
1007 | (interleaved: '2' would be missing if heap queue were higher depth first) |
|
|||
1008 |
|
||||
1009 | $ log 'reverse(ancestors(7+8, depth=2))' |
|
|||
1010 | 8 |
|
|||
1011 | 7 |
|
|||
1012 | 6 |
|
|||
1013 | 5 |
|
|||
1014 | 4 |
|
|||
1015 | 2 |
|
|||
1016 |
|
||||
1017 | (walk example above by separate queries) |
|
|||
1018 |
|
||||
1019 | $ log 'reverse(ancestors(8, depth=2)) + reverse(ancestors(7, depth=2))' |
|
|||
1020 | 8 |
|
|||
1021 | 4 |
|
|||
1022 | 2 |
|
|||
1023 | 7 |
|
|||
1024 | 6 |
|
|||
1025 | 5 |
|
|||
1026 |
|
||||
1027 | (walk 2nd and 3rd ancestors) |
|
|||
1028 |
|
||||
1029 | $ log 'reverse(ancestors(7, depth=3, startdepth=2))' |
|
|||
1030 | 5 |
|
|||
1031 | 4 |
|
|||
1032 | 3 |
|
|||
1033 | 2 |
|
|||
1034 |
|
||||
1035 | (interleaved: '4' would be missing if higher-depth ancestors weren't scanned) |
|
|||
1036 |
|
||||
1037 | $ log 'reverse(ancestors(7+8, depth=2, startdepth=2))' |
|
|||
1038 | 5 |
|
|||
1039 | 4 |
|
|||
1040 | 2 |
|
|||
1041 |
|
||||
1042 | (note that 'ancestors(x, depth=y, startdepth=z)' does not identical to |
|
|||
1043 | 'ancestors(x, depth=y) - ancestors(x, depth=z-1)' because a node may have |
|
|||
1044 | multiple depths) |
|
|||
1045 |
|
||||
1046 | $ log 'reverse(ancestors(7+8, depth=2) - ancestors(7+8, depth=1))' |
|
|||
1047 | 5 |
|
|||
1048 | 2 |
|
|||
1049 |
|
||||
1050 | test bad arguments passed to ancestors() |
|
|||
1051 |
|
||||
1052 | $ log 'ancestors(., depth=-1)' |
|
|||
1053 | hg: parse error: negative depth |
|
|||
1054 | [255] |
|
|||
1055 | $ log 'ancestors(., depth=foo)' |
|
|||
1056 | hg: parse error: ancestors expects an integer depth |
|
|||
1057 | [255] |
|
|||
1058 |
|
||||
1059 | test descendants |
|
|||
1060 |
|
||||
1061 | $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True |
|
|||
1062 | @ 9 |
|
|||
1063 | o 8 |
|
|||
1064 | | o 7 |
|
|||
1065 | | o 6 |
|
|||
1066 | |/| |
|
|||
1067 | | o 5 |
|
|||
1068 | o | 4 |
|
|||
1069 | | o 3 |
|
|||
1070 | o | 2 |
|
|||
1071 | |/ |
|
|||
1072 | o 1 |
|
|||
1073 | o 0 |
|
|||
1074 |
|
||||
1075 | (null is ultimate root and has optimized path) |
|
|||
1076 |
|
||||
1077 | $ log 'null:4 & descendants(null)' |
|
|||
1078 | -1 |
|
|||
1079 | 0 |
|
|||
1080 | 1 |
|
|||
1081 | 2 |
|
|||
1082 | 3 |
|
|||
1083 | 4 |
|
|||
1084 |
|
||||
1085 | (including merge) |
|
|||
1086 |
|
||||
1087 | $ log ':8 & descendants(2)' |
|
|||
1088 | 2 |
|
|||
1089 | 4 |
|
|||
1090 | 6 |
|
|||
1091 | 7 |
|
|||
1092 | 8 |
|
|||
1093 |
|
||||
1094 | (multiple roots) |
|
|||
1095 |
|
||||
1096 | $ log ':8 & descendants(2+5)' |
|
|||
1097 | 2 |
|
|||
1098 | 4 |
|
|||
1099 | 5 |
|
|||
1100 | 6 |
|
|||
1101 | 7 |
|
|||
1102 | 8 |
|
|||
1103 |
|
||||
1104 | test descendants with depth limit |
|
|||
1105 |
|
||||
1106 | (depth=0 selects the node itself) |
|
|||
1107 |
|
||||
1108 | $ log 'descendants(0, depth=0)' |
|
|||
1109 | 0 |
|
|||
1110 | $ log 'null: & descendants(null, depth=0)' |
|
|||
1111 | -1 |
|
|||
1112 |
|
||||
1113 | (p2 = null should be ignored) |
|
|||
1114 |
|
||||
1115 | $ log 'null: & descendants(null, depth=2)' |
|
|||
1116 | -1 |
|
|||
1117 | 0 |
|
|||
1118 | 1 |
|
|||
1119 |
|
||||
1120 | (multiple paths: depth(6) = (2, 3)) |
|
|||
1121 |
|
||||
1122 | $ log 'descendants(1+3, depth=2)' |
|
|||
1123 | 1 |
|
|||
1124 | 2 |
|
|||
1125 | 3 |
|
|||
1126 | 4 |
|
|||
1127 | 5 |
|
|||
1128 | 6 |
|
|||
1129 |
|
||||
1130 | (multiple paths: depth(5) = (1, 2), depth(6) = (2, 3)) |
|
|||
1131 |
|
||||
1132 | $ log 'descendants(3+1, depth=2, startdepth=2)' |
|
|||
1133 | 4 |
|
|||
1134 | 5 |
|
|||
1135 | 6 |
|
|||
1136 |
|
||||
1137 | (multiple depths: depth(6) = (0, 2, 4), search for depth=2) |
|
|||
1138 |
|
||||
1139 | $ log 'descendants(0+3+6, depth=3, startdepth=1)' |
|
|||
1140 | 1 |
|
|||
1141 | 2 |
|
|||
1142 | 3 |
|
|||
1143 | 4 |
|
|||
1144 | 5 |
|
|||
1145 | 6 |
|
|||
1146 | 7 |
|
|||
1147 |
|
||||
1148 | (multiple depths: depth(6) = (0, 4), no match) |
|
|||
1149 |
|
||||
1150 | $ log 'descendants(0+6, depth=3, startdepth=1)' |
|
|||
1151 | 1 |
|
|||
1152 | 2 |
|
|||
1153 | 3 |
|
|||
1154 | 4 |
|
|||
1155 | 5 |
|
|||
1156 | 7 |
|
|||
1157 |
|
||||
1158 | test ancestors/descendants relation subscript: |
|
|||
1159 |
|
||||
1160 | $ log 'tip#generations[0]' |
|
|||
1161 | 9 |
|
|||
1162 | $ log '.#generations[-1]' |
|
|||
1163 | 8 |
|
|||
1164 | $ log '.#g[(-1)]' |
|
|||
1165 | 8 |
|
|||
1166 |
|
||||
1167 | $ hg debugrevspec -p parsed 'roots(:)#g[2]' |
|
|||
1168 | * parsed: |
|
|||
1169 | (relsubscript |
|
|||
1170 | (func |
|
|||
1171 | (symbol 'roots') |
|
|||
1172 | (rangeall |
|
|||
1173 | None)) |
|
|||
1174 | (symbol 'g') |
|
|||
1175 | (symbol '2')) |
|
|||
1176 | 2 |
|
|||
1177 | 3 |
|
|||
1178 |
|
||||
1179 | test author |
|
|||
1180 |
|
||||
1181 | $ log 'author(bob)' |
|
|||
1182 | 2 |
|
|||
1183 | $ log 'author("re:bob|test")' |
|
|||
1184 | 0 |
|
|||
1185 | 1 |
|
|||
1186 | 2 |
|
|||
1187 | 3 |
|
|||
1188 | 4 |
|
|||
1189 | 5 |
|
|||
1190 | 6 |
|
|||
1191 | 7 |
|
|||
1192 | 8 |
|
|||
1193 | 9 |
|
|||
1194 | $ log 'author(r"re:\S")' |
|
|||
1195 | 0 |
|
|||
1196 | 1 |
|
|||
1197 | 2 |
|
|||
1198 | 3 |
|
|||
1199 | 4 |
|
|||
1200 | 5 |
|
|||
1201 | 6 |
|
|||
1202 | 7 |
|
|||
1203 | 8 |
|
|||
1204 | 9 |
|
|||
1205 | $ log 'branch(Γ©)' |
|
|||
1206 | 8 |
|
|||
1207 | 9 |
|
|||
1208 | $ log 'branch(a)' |
|
|||
1209 | 0 |
|
|||
1210 | $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n' |
|
|||
1211 | 0 a |
|
|||
1212 | 2 a-b-c- |
|
|||
1213 | 3 +a+b+c+ |
|
|||
1214 | 4 -a-b-c- |
|
|||
1215 | 5 !a/b/c/ |
|
|||
1216 | 6 _a_b_c_ |
|
|||
1217 | 7 .a.b.c. |
|
|||
1218 | $ log 'children(ancestor(4,5))' |
|
|||
1219 | 2 |
|
|||
1220 | 3 |
|
|||
1221 |
|
||||
1222 | $ log 'children(4)' |
|
|||
1223 | 6 |
|
|||
1224 | 8 |
|
|||
1225 | $ log 'children(null)' |
|
|||
1226 | 0 |
|
|||
1227 |
|
||||
1228 | $ log 'closed()' |
|
|||
1229 | $ log 'contains(a)' |
|
|||
1230 | 0 |
|
|||
1231 | 1 |
|
|||
1232 | 3 |
|
|||
1233 | 5 |
|
|||
1234 | $ log 'contains("../repo/a")' |
|
|||
1235 | 0 |
|
|||
1236 | 1 |
|
|||
1237 | 3 |
|
|||
1238 | 5 |
|
|||
1239 | $ log 'desc(B)' |
|
|||
1240 | 5 |
|
|||
1241 | $ hg log -r 'desc(r"re:S?u")' --template "{rev} {desc|firstline}\n" |
|
|||
1242 | 5 5 bug |
|
|||
1243 | 6 6 issue619 |
|
|||
1244 | $ log 'descendants(2 or 3)' |
|
|||
1245 | 2 |
|
|||
1246 | 3 |
|
|||
1247 | 4 |
|
|||
1248 | 5 |
|
|||
1249 | 6 |
|
|||
1250 | 7 |
|
|||
1251 | 8 |
|
|||
1252 | 9 |
|
|||
1253 | $ log 'file("b*")' |
|
|||
1254 | 1 |
|
|||
1255 | 4 |
|
|||
1256 | $ log 'filelog("b")' |
|
|||
1257 | 1 |
|
|||
1258 | 4 |
|
|||
1259 | $ log 'filelog("../repo/b")' |
|
|||
1260 | 1 |
|
|||
1261 | 4 |
|
|||
1262 | $ log 'follow()' |
|
|||
1263 | 0 |
|
|||
1264 | 1 |
|
|||
1265 | 2 |
|
|||
1266 | 4 |
|
|||
1267 | 8 |
|
|||
1268 | 9 |
|
|||
1269 | $ log 'grep("issue\d+")' |
|
|||
1270 | 6 |
|
|||
1271 | $ try 'grep("(")' # invalid regular expression |
|
|||
1272 | (func |
|
|||
1273 | (symbol 'grep') |
|
|||
1274 | (string '(')) |
|
|||
1275 | hg: parse error: invalid match pattern: unbalanced parenthesis |
|
|||
1276 | [255] |
|
|||
1277 | $ try 'grep("\bissue\d+")' |
|
|||
1278 | (func |
|
|||
1279 | (symbol 'grep') |
|
|||
1280 | (string '\x08issue\\d+')) |
|
|||
1281 | * set: |
|
|||
1282 | <filteredset |
|
|||
1283 | <fullreposet+ 0:10>, |
|
|||
1284 | <grep '\x08issue\\d+'>> |
|
|||
1285 | $ try 'grep(r"\bissue\d+")' |
|
|||
1286 | (func |
|
|||
1287 | (symbol 'grep') |
|
|||
1288 | (string '\\bissue\\d+')) |
|
|||
1289 | * set: |
|
|||
1290 | <filteredset |
|
|||
1291 | <fullreposet+ 0:10>, |
|
|||
1292 | <grep '\\bissue\\d+'>> |
|
|||
1293 | 6 |
|
|||
1294 | $ try 'grep(r"\")' |
|
|||
1295 | hg: parse error at 7: unterminated string |
|
|||
1296 | [255] |
|
|||
1297 | $ log 'head()' |
|
|||
1298 | 0 |
|
|||
1299 | 1 |
|
|||
1300 | 2 |
|
|||
1301 | 3 |
|
|||
1302 | 4 |
|
|||
1303 | 5 |
|
|||
1304 | 6 |
|
|||
1305 | 7 |
|
|||
1306 | 9 |
|
|||
1307 | $ log 'heads(6::)' |
|
|||
1308 | 7 |
|
|||
1309 | $ log 'keyword(issue)' |
|
|||
1310 | 6 |
|
|||
1311 | $ log 'keyword("test a")' |
|
|||
1312 |
|
||||
1313 | Test first (=limit) and last |
|
|||
1314 |
|
||||
1315 | $ log 'limit(head(), 1)' |
|
|||
1316 | 0 |
|
|||
1317 | $ log 'limit(author("re:bob|test"), 3, 5)' |
|
|||
1318 | 5 |
|
|||
1319 | 6 |
|
|||
1320 | 7 |
|
|||
1321 | $ log 'limit(author("re:bob|test"), offset=6)' |
|
|||
1322 | 6 |
|
|||
1323 | $ log 'limit(author("re:bob|test"), offset=10)' |
|
|||
1324 | $ log 'limit(all(), 1, -1)' |
|
|||
1325 | hg: parse error: negative offset |
|
|||
1326 | [255] |
|
|||
1327 | $ log 'limit(all(), -1)' |
|
|||
1328 | hg: parse error: negative number to select |
|
|||
1329 | [255] |
|
|||
1330 | $ log 'limit(all(), 0)' |
|
|||
1331 |
|
||||
1332 | $ log 'last(all(), -1)' |
|
|||
1333 | hg: parse error: negative number to select |
|
|||
1334 | [255] |
|
|||
1335 | $ log 'last(all(), 0)' |
|
|||
1336 | $ log 'last(all(), 1)' |
|
|||
1337 | 9 |
|
|||
1338 | $ log 'last(all(), 2)' |
|
|||
1339 | 8 |
|
|||
1340 | 9 |
|
|||
1341 |
|
||||
1342 | Test smartset.slice() by first/last() |
|
|||
1343 |
|
||||
1344 | (using unoptimized set, filteredset as example) |
|
|||
1345 |
|
||||
1346 | $ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")' |
|
|||
1347 | * set: |
|
|||
1348 | <filteredset |
|
|||
1349 | <spanset+ 0:8>, |
|
|||
1350 | <branch 're:'>> |
|
|||
1351 | $ log 'limit(0:7 & branch("re:"), 3, 4)' |
|
|||
1352 | 4 |
|
|||
1353 | 5 |
|
|||
1354 | 6 |
|
|||
1355 | $ log 'limit(7:0 & branch("re:"), 3, 4)' |
|
|||
1356 | 3 |
|
|||
1357 | 2 |
|
|||
1358 | 1 |
|
|||
1359 | $ log 'last(0:7 & branch("re:"), 2)' |
|
|||
1360 | 6 |
|
|||
1361 | 7 |
|
|||
1362 |
|
||||
1363 | (using baseset) |
|
|||
1364 |
|
||||
1365 | $ hg debugrevspec --no-show-revs -s 0+1+2+3+4+5+6+7 |
|
|||
1366 | * set: |
|
|||
1367 | <baseset [0, 1, 2, 3, 4, 5, 6, 7]> |
|
|||
1368 | $ hg debugrevspec --no-show-revs -s 0::7 |
|
|||
1369 | * set: |
|
|||
1370 | <baseset+ [0, 1, 2, 3, 4, 5, 6, 7]> |
|
|||
1371 | $ log 'limit(0+1+2+3+4+5+6+7, 3, 4)' |
|
|||
1372 | 4 |
|
|||
1373 | 5 |
|
|||
1374 | 6 |
|
|||
1375 | $ log 'limit(sort(0::7, rev), 3, 4)' |
|
|||
1376 | 4 |
|
|||
1377 | 5 |
|
|||
1378 | 6 |
|
|||
1379 | $ log 'limit(sort(0::7, -rev), 3, 4)' |
|
|||
1380 | 3 |
|
|||
1381 | 2 |
|
|||
1382 | 1 |
|
|||
1383 | $ log 'last(sort(0::7, rev), 2)' |
|
|||
1384 | 6 |
|
|||
1385 | 7 |
|
|||
1386 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 6)' |
|
|||
1387 | * set: |
|
|||
1388 | <baseset+ [6, 7]> |
|
|||
1389 | 6 |
|
|||
1390 | 7 |
|
|||
1391 | $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 9)' |
|
|||
1392 | * set: |
|
|||
1393 | <baseset+ []> |
|
|||
1394 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 6)' |
|
|||
1395 | * set: |
|
|||
1396 | <baseset- [0, 1]> |
|
|||
1397 | 1 |
|
|||
1398 | 0 |
|
|||
1399 | $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 9)' |
|
|||
1400 | * set: |
|
|||
1401 | <baseset- []> |
|
|||
1402 | $ hg debugrevspec -s 'limit(0::7, 0)' |
|
|||
1403 | * set: |
|
|||
1404 | <baseset+ []> |
|
|||
1405 |
|
||||
1406 | (using spanset) |
|
|||
1407 |
|
||||
1408 | $ hg debugrevspec --no-show-revs -s 0:7 |
|
|||
1409 | * set: |
|
|||
1410 | <spanset+ 0:8> |
|
|||
1411 | $ log 'limit(0:7, 3, 4)' |
|
|||
1412 | 4 |
|
|||
1413 | 5 |
|
|||
1414 | 6 |
|
|||
1415 | $ log 'limit(7:0, 3, 4)' |
|
|||
1416 | 3 |
|
|||
1417 | 2 |
|
|||
1418 | 1 |
|
|||
1419 | $ log 'limit(0:7, 3, 6)' |
|
|||
1420 | 6 |
|
|||
1421 | 7 |
|
|||
1422 | $ log 'limit(7:0, 3, 6)' |
|
|||
1423 | 1 |
|
|||
1424 | 0 |
|
|||
1425 | $ log 'last(0:7, 2)' |
|
|||
1426 | 6 |
|
|||
1427 | 7 |
|
|||
1428 | $ hg debugrevspec -s 'limit(0:7, 3, 6)' |
|
|||
1429 | * set: |
|
|||
1430 | <spanset+ 6:8> |
|
|||
1431 | 6 |
|
|||
1432 | 7 |
|
|||
1433 | $ hg debugrevspec -s 'limit(0:7, 3, 9)' |
|
|||
1434 | * set: |
|
|||
1435 | <spanset+ 8:8> |
|
|||
1436 | $ hg debugrevspec -s 'limit(7:0, 3, 6)' |
|
|||
1437 | * set: |
|
|||
1438 | <spanset- 0:2> |
|
|||
1439 | 1 |
|
|||
1440 | 0 |
|
|||
1441 | $ hg debugrevspec -s 'limit(7:0, 3, 9)' |
|
|||
1442 | * set: |
|
|||
1443 | <spanset- 0:0> |
|
|||
1444 | $ hg debugrevspec -s 'limit(0:7, 0)' |
|
|||
1445 | * set: |
|
|||
1446 | <spanset+ 0:0> |
|
|||
1447 |
|
||||
1448 | Test order of first/last revisions |
|
|||
1449 |
|
||||
1450 | $ hg debugrevspec -s 'first(4:0, 3) & 3:' |
|
|||
1451 | * set: |
|
|||
1452 | <filteredset |
|
|||
1453 | <spanset- 2:5>, |
|
|||
1454 | <spanset+ 3:10>> |
|
|||
1455 | 4 |
|
|||
1456 | 3 |
|
|||
1457 |
|
||||
1458 | $ hg debugrevspec -s '3: & first(4:0, 3)' |
|
|||
1459 | * set: |
|
|||
1460 | <filteredset |
|
|||
1461 | <spanset+ 3:10>, |
|
|||
1462 | <spanset- 2:5>> |
|
|||
1463 | 3 |
|
|||
1464 | 4 |
|
|||
1465 |
|
||||
1466 | $ hg debugrevspec -s 'last(4:0, 3) & :1' |
|
|||
1467 | * set: |
|
|||
1468 | <filteredset |
|
|||
1469 | <spanset- 0:3>, |
|
|||
1470 | <spanset+ 0:2>> |
|
|||
1471 | 1 |
|
|||
1472 | 0 |
|
|||
1473 |
|
||||
1474 | $ hg debugrevspec -s ':1 & last(4:0, 3)' |
|
|||
1475 | * set: |
|
|||
1476 | <filteredset |
|
|||
1477 | <spanset+ 0:2>, |
|
|||
1478 | <spanset+ 0:3>> |
|
|||
1479 | 0 |
|
|||
1480 | 1 |
|
|||
1481 |
|
||||
1482 | Test scmutil.revsingle() should return the last revision |
|
|||
1483 |
|
||||
1484 | $ hg debugrevspec -s 'last(0::)' |
|
|||
1485 | * set: |
|
|||
1486 | <baseset slice=0:1 |
|
|||
1487 | <generatorset->> |
|
|||
1488 | 9 |
|
|||
1489 | $ hg identify -r '0::' --num |
|
|||
1490 | 9 |
|
|||
1491 |
|
||||
1492 | Test matching |
|
|||
1493 |
|
||||
1494 | $ log 'matching(6)' |
|
|||
1495 | 6 |
|
|||
1496 | $ log 'matching(6:7, "phase parents user date branch summary files description substate")' |
|
|||
1497 | 6 |
|
|||
1498 | 7 |
|
|||
1499 |
|
||||
1500 | Testing min and max |
|
|||
1501 |
|
||||
1502 | max: simple |
|
|||
1503 |
|
||||
1504 | $ log 'max(contains(a))' |
|
|||
1505 | 5 |
|
|||
1506 |
|
||||
1507 | max: simple on unordered set) |
|
|||
1508 |
|
||||
1509 | $ log 'max((4+0+2+5+7) and contains(a))' |
|
|||
1510 | 5 |
|
|||
1511 |
|
||||
1512 | max: no result |
|
|||
1513 |
|
||||
1514 | $ log 'max(contains(stringthatdoesnotappearanywhere))' |
|
|||
1515 |
|
||||
1516 | max: no result on unordered set |
|
|||
1517 |
|
||||
1518 | $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
|||
1519 |
|
||||
1520 | min: simple |
|
|||
1521 |
|
||||
1522 | $ log 'min(contains(a))' |
|
|||
1523 | 0 |
|
|||
1524 |
|
||||
1525 | min: simple on unordered set |
|
|||
1526 |
|
||||
1527 | $ log 'min((4+0+2+5+7) and contains(a))' |
|
|||
1528 | 0 |
|
|||
1529 |
|
||||
1530 | min: empty |
|
|||
1531 |
|
||||
1532 | $ log 'min(contains(stringthatdoesnotappearanywhere))' |
|
|||
1533 |
|
||||
1534 | min: empty on unordered set |
|
|||
1535 |
|
||||
1536 | $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
|||
1537 |
|
||||
1538 |
|
||||
1539 | $ log 'merge()' |
|
|||
1540 | 6 |
|
|||
1541 | $ log 'branchpoint()' |
|
|||
1542 | 1 |
|
|||
1543 | 4 |
|
|||
1544 | $ log 'modifies(b)' |
|
|||
1545 | 4 |
|
|||
1546 | $ log 'modifies("path:b")' |
|
|||
1547 | 4 |
|
|||
1548 | $ log 'modifies("*")' |
|
|||
1549 | 4 |
|
|||
1550 | 6 |
|
|||
1551 | $ log 'modifies("set:modified()")' |
|
|||
1552 | 4 |
|
|||
1553 | $ log 'id(5)' |
|
|||
1554 | 2 |
|
|||
1555 | $ log 'only(9)' |
|
|||
1556 | 8 |
|
|||
1557 | 9 |
|
|||
1558 | $ log 'only(8)' |
|
|||
1559 | 8 |
|
|||
1560 | $ log 'only(9, 5)' |
|
|||
1561 | 2 |
|
|||
1562 | 4 |
|
|||
1563 | 8 |
|
|||
1564 | 9 |
|
|||
1565 | $ log 'only(7 + 9, 5 + 2)' |
|
|||
1566 | 4 |
|
|||
1567 | 6 |
|
|||
1568 | 7 |
|
|||
1569 | 8 |
|
|||
1570 | 9 |
|
|||
1571 |
|
||||
1572 | Test empty set input |
|
|||
1573 | $ log 'only(p2())' |
|
|||
1574 | $ log 'only(p1(), p2())' |
|
|||
1575 | 0 |
|
|||
1576 | 1 |
|
|||
1577 | 2 |
|
|||
1578 | 4 |
|
|||
1579 | 8 |
|
|||
1580 | 9 |
|
|||
1581 |
|
||||
1582 | Test '%' operator |
|
|||
1583 |
|
||||
1584 | $ log '9%' |
|
|||
1585 | 8 |
|
|||
1586 | 9 |
|
|||
1587 | $ log '9%5' |
|
|||
1588 | 2 |
|
|||
1589 | 4 |
|
|||
1590 | 8 |
|
|||
1591 | 9 |
|
|||
1592 | $ log '(7 + 9)%(5 + 2)' |
|
|||
1593 | 4 |
|
|||
1594 | 6 |
|
|||
1595 | 7 |
|
|||
1596 | 8 |
|
|||
1597 | 9 |
|
|||
1598 |
|
||||
1599 | Test operand of '%' is optimized recursively (issue4670) |
|
|||
1600 |
|
||||
1601 | $ try --optimize '8:9-8%' |
|
|||
1602 | (onlypost |
|
|||
1603 | (minus |
|
|||
1604 | (range |
|
|||
1605 | (symbol '8') |
|
|||
1606 | (symbol '9')) |
|
|||
1607 | (symbol '8'))) |
|
|||
1608 | * optimized: |
|
|||
1609 | (func |
|
|||
1610 | (symbol 'only') |
|
|||
1611 | (difference |
|
|||
1612 | (range |
|
|||
1613 | (symbol '8') |
|
|||
1614 | (symbol '9')) |
|
|||
1615 | (symbol '8'))) |
|
|||
1616 | * set: |
|
|||
1617 | <baseset+ [8, 9]> |
|
|||
1618 | 8 |
|
|||
1619 | 9 |
|
|||
1620 | $ try --optimize '(9)%(5)' |
|
|||
1621 | (only |
|
|||
1622 | (group |
|
|||
1623 | (symbol '9')) |
|
|||
1624 | (group |
|
|||
1625 | (symbol '5'))) |
|
|||
1626 | * optimized: |
|
|||
1627 | (func |
|
|||
1628 | (symbol 'only') |
|
|||
1629 | (list |
|
|||
1630 | (symbol '9') |
|
|||
1631 | (symbol '5'))) |
|
|||
1632 | * set: |
|
|||
1633 | <baseset+ [2, 4, 8, 9]> |
|
|||
1634 | 2 |
|
|||
1635 | 4 |
|
|||
1636 | 8 |
|
|||
1637 | 9 |
|
|||
1638 |
|
||||
1639 | Test the order of operations |
|
|||
1640 |
|
||||
1641 | $ log '7 + 9%5 + 2' |
|
|||
1642 | 7 |
|
|||
1643 | 2 |
|
|||
1644 | 4 |
|
|||
1645 | 8 |
|
|||
1646 | 9 |
|
|||
1647 |
|
||||
1648 | Test explicit numeric revision |
|
|||
1649 | $ log 'rev(-2)' |
|
|||
1650 | $ log 'rev(-1)' |
|
|||
1651 | -1 |
|
|||
1652 | $ log 'rev(0)' |
|
|||
1653 | 0 |
|
|||
1654 | $ log 'rev(9)' |
|
|||
1655 | 9 |
|
|||
1656 | $ log 'rev(10)' |
|
|||
1657 | $ log 'rev(tip)' |
|
|||
1658 | hg: parse error: rev expects a number |
|
|||
1659 | [255] |
|
|||
1660 |
|
||||
1661 | Test hexadecimal revision |
|
|||
1662 | $ log 'id(2)' |
|
|||
1663 | abort: 00changelog.i@2: ambiguous identifier! |
|
|||
1664 | [255] |
|
|||
1665 | $ log 'id(23268)' |
|
|||
1666 | 4 |
|
|||
1667 | $ log 'id(2785f51eece)' |
|
|||
1668 | 0 |
|
|||
1669 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)' |
|
|||
1670 | 8 |
|
|||
1671 | $ log 'id(d5d0dcbdc4a)' |
|
|||
1672 | $ log 'id(d5d0dcbdc4w)' |
|
|||
1673 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)' |
|
|||
1674 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)' |
|
|||
1675 | $ log 'id(1.0)' |
|
|||
1676 | $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)' |
|
|||
1677 |
|
||||
1678 | Test null revision |
|
|||
1679 | $ log '(null)' |
|
|||
1680 | -1 |
|
|||
1681 | $ log '(null:0)' |
|
|||
1682 | -1 |
|
|||
1683 | 0 |
|
|||
1684 | $ log '(0:null)' |
|
|||
1685 | 0 |
|
|||
1686 | -1 |
|
|||
1687 | $ log 'null::0' |
|
|||
1688 | -1 |
|
|||
1689 | 0 |
|
|||
1690 | $ log 'null:tip - 0:' |
|
|||
1691 | -1 |
|
|||
1692 | $ log 'null: and null::' | head -1 |
|
|||
1693 | -1 |
|
|||
1694 | $ log 'null: or 0:' | head -2 |
|
|||
1695 | -1 |
|
|||
1696 | 0 |
|
|||
1697 | $ log 'ancestors(null)' |
|
|||
1698 | -1 |
|
|||
1699 | $ log 'reverse(null:)' | tail -2 |
|
|||
1700 | 0 |
|
|||
1701 | -1 |
|
|||
1702 | $ log 'first(null:)' |
|
|||
1703 | -1 |
|
|||
1704 | $ log 'min(null:)' |
|
|||
1705 | BROKEN: should be '-1' |
|
|||
1706 | $ log 'tip:null and all()' | tail -2 |
|
|||
1707 | 1 |
|
|||
1708 | 0 |
|
|||
1709 |
|
||||
1710 | Test working-directory revision |
|
|||
1711 | $ hg debugrevspec 'wdir()' |
|
|||
1712 | 2147483647 |
|
|||
1713 | $ hg debugrevspec 'wdir()^' |
|
|||
1714 | 9 |
|
|||
1715 | $ hg up 7 |
|
|||
1716 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1717 | $ hg debugrevspec 'wdir()^' |
|
|||
1718 | 7 |
|
|||
1719 | $ hg debugrevspec 'wdir()^0' |
|
|||
1720 | 2147483647 |
|
|||
1721 | $ hg debugrevspec 'wdir()~3' |
|
|||
1722 | 5 |
|
|||
1723 | $ hg debugrevspec 'ancestors(wdir())' |
|
|||
1724 | 0 |
|
|||
1725 | 1 |
|
|||
1726 | 2 |
|
|||
1727 | 3 |
|
|||
1728 | 4 |
|
|||
1729 | 5 |
|
|||
1730 | 6 |
|
|||
1731 | 7 |
|
|||
1732 | 2147483647 |
|
|||
1733 | $ hg debugrevspec 'wdir()~0' |
|
|||
1734 | 2147483647 |
|
|||
1735 | $ hg debugrevspec 'p1(wdir())' |
|
|||
1736 | 7 |
|
|||
1737 | $ hg debugrevspec 'p2(wdir())' |
|
|||
1738 | $ hg debugrevspec 'parents(wdir())' |
|
|||
1739 | 7 |
|
|||
1740 | $ hg debugrevspec 'wdir()^1' |
|
|||
1741 | 7 |
|
|||
1742 | $ hg debugrevspec 'wdir()^2' |
|
|||
1743 | $ hg debugrevspec 'wdir()^3' |
|
|||
1744 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
|||
1745 | [255] |
|
|||
1746 | For tests consistency |
|
|||
1747 | $ hg up 9 |
|
|||
1748 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1749 | $ hg debugrevspec 'tip or wdir()' |
|
|||
1750 | 9 |
|
|||
1751 | 2147483647 |
|
|||
1752 | $ hg debugrevspec '0:tip and wdir()' |
|
|||
1753 | $ log '0:wdir()' | tail -3 |
|
|||
1754 | 8 |
|
|||
1755 | 9 |
|
|||
1756 | 2147483647 |
|
|||
1757 | $ log 'wdir():0' | head -3 |
|
|||
1758 | 2147483647 |
|
|||
1759 | 9 |
|
|||
1760 | 8 |
|
|||
1761 | $ log 'wdir():wdir()' |
|
|||
1762 | 2147483647 |
|
|||
1763 | $ log '(all() + wdir()) & min(. + wdir())' |
|
|||
1764 | 9 |
|
|||
1765 | $ log '(all() + wdir()) & max(. + wdir())' |
|
|||
1766 | 2147483647 |
|
|||
1767 | $ log 'first(wdir() + .)' |
|
|||
1768 | 2147483647 |
|
|||
1769 | $ log 'last(. + wdir())' |
|
|||
1770 | 2147483647 |
|
|||
1771 |
|
||||
1772 | Test working-directory integer revision and node id |
|
|||
1773 | (BUG: '0:wdir()' is still needed to populate wdir revision) |
|
|||
1774 |
|
||||
1775 | $ hg debugrevspec '0:wdir() & 2147483647' |
|
|||
1776 | 2147483647 |
|
|||
1777 | $ hg debugrevspec '0:wdir() & rev(2147483647)' |
|
|||
1778 | 2147483647 |
|
|||
1779 | $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff' |
|
|||
1780 | 2147483647 |
|
|||
1781 | $ hg debugrevspec '0:wdir() & ffffffffffff' |
|
|||
1782 | 2147483647 |
|
|||
1783 | $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)' |
|
|||
1784 | 2147483647 |
|
|||
1785 | $ hg debugrevspec '0:wdir() & id(ffffffffffff)' |
|
|||
1786 | 2147483647 |
|
|||
1787 |
|
||||
1788 | $ cd .. |
|
|||
1789 |
|
||||
1790 | Test short 'ff...' hash collision |
|
|||
1791 | (BUG: '0:wdir()' is still needed to populate wdir revision) |
|
|||
1792 |
|
||||
1793 | $ hg init wdir-hashcollision |
|
|||
1794 | $ cd wdir-hashcollision |
|
|||
1795 | $ cat <<EOF >> .hg/hgrc |
|
|||
1796 | > [experimental] |
|
|||
1797 | > stabilization = createmarkers |
|
|||
1798 | > EOF |
|
|||
1799 | $ echo 0 > a |
|
|||
1800 | $ hg ci -qAm 0 |
|
|||
1801 | $ for i in 2463 2961 6726 78127; do |
|
|||
1802 | > hg up -q 0 |
|
|||
1803 | > echo $i > a |
|
|||
1804 | > hg ci -qm $i |
|
|||
1805 | > done |
|
|||
1806 | $ hg up -q null |
|
|||
1807 | $ hg log -r '0:wdir()' -T '{rev}:{node} {shortest(node, 3)}\n' |
|
|||
1808 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e |
|
|||
1809 | 1:fffbae3886c8fbb2114296380d276fd37715d571 fffba |
|
|||
1810 | 2:fffb6093b00943f91034b9bdad069402c834e572 fffb6 |
|
|||
1811 | 3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4 |
|
|||
1812 | 4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8 |
|
|||
1813 | 2147483647:ffffffffffffffffffffffffffffffffffffffff fffff |
|
|||
1814 | $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571 |
|
|||
1815 | obsoleted 1 changesets |
|
|||
1816 |
|
||||
1817 | $ hg debugrevspec '0:wdir() & fff' |
|
|||
1818 | abort: 00changelog.i@fff: ambiguous identifier! |
|
|||
1819 | [255] |
|
|||
1820 | $ hg debugrevspec '0:wdir() & ffff' |
|
|||
1821 | abort: 00changelog.i@ffff: ambiguous identifier! |
|
|||
1822 | [255] |
|
|||
1823 | $ hg debugrevspec '0:wdir() & fffb' |
|
|||
1824 | abort: 00changelog.i@fffb: ambiguous identifier! |
|
|||
1825 | [255] |
|
|||
1826 | BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8) |
|
|||
1827 | $ hg debugrevspec '0:wdir() & id(fffb)' |
|
|||
1828 | 2 |
|
|||
1829 | $ hg debugrevspec '0:wdir() & ffff8' |
|
|||
1830 | 4 |
|
|||
1831 | $ hg debugrevspec '0:wdir() & fffff' |
|
|||
1832 | 2147483647 |
|
|||
1833 |
|
||||
1834 | $ cd .. |
|
|||
1835 |
|
||||
1836 | Test branch() with wdir() |
|
|||
1837 |
|
||||
1838 | $ cd repo |
|
|||
1839 |
|
||||
1840 | $ log '0:wdir() & branch("literal:Γ©")' |
|
|||
1841 | 8 |
|
|||
1842 | 9 |
|
|||
1843 | 2147483647 |
|
|||
1844 | $ log '0:wdir() & branch("re:Γ©")' |
|
|||
1845 | 8 |
|
|||
1846 | 9 |
|
|||
1847 | 2147483647 |
|
|||
1848 | $ log '0:wdir() & branch("re:^a")' |
|
|||
1849 | 0 |
|
|||
1850 | 2 |
|
|||
1851 | $ log '0:wdir() & branch(8)' |
|
|||
1852 | 8 |
|
|||
1853 | 9 |
|
|||
1854 | 2147483647 |
|
|||
1855 |
|
||||
1856 | branch(wdir()) returns all revisions belonging to the working branch. The wdir |
|
|||
1857 | itself isn't returned unless it is explicitly populated. |
|
|||
1858 |
|
||||
1859 | $ log 'branch(wdir())' |
|
|||
1860 | 8 |
|
|||
1861 | 9 |
|
|||
1862 | $ log '0:wdir() & branch(wdir())' |
|
|||
1863 | 8 |
|
|||
1864 | 9 |
|
|||
1865 | 2147483647 |
|
|||
1866 |
|
||||
1867 | $ log 'outgoing()' |
|
|||
1868 | 8 |
|
|||
1869 | 9 |
|
|||
1870 | $ log 'outgoing("../remote1")' |
|
|||
1871 | 8 |
|
|||
1872 | 9 |
|
|||
1873 | $ log 'outgoing("../remote2")' |
|
|||
1874 | 3 |
|
|||
1875 | 5 |
|
|||
1876 | 6 |
|
|||
1877 | 7 |
|
|||
1878 | 9 |
|
|||
1879 | $ log 'p1(merge())' |
|
|||
1880 | 5 |
|
|||
1881 | $ log 'p2(merge())' |
|
|||
1882 | 4 |
|
|||
1883 | $ log 'parents(merge())' |
|
|||
1884 | 4 |
|
|||
1885 | 5 |
|
|||
1886 | $ log 'p1(branchpoint())' |
|
|||
1887 | 0 |
|
|||
1888 | 2 |
|
|||
1889 | $ log 'p2(branchpoint())' |
|
|||
1890 | $ log 'parents(branchpoint())' |
|
|||
1891 | 0 |
|
|||
1892 | 2 |
|
|||
1893 | $ log 'removes(a)' |
|
|||
1894 | 2 |
|
|||
1895 | 6 |
|
|||
1896 | $ log 'roots(all())' |
|
|||
1897 | 0 |
|
|||
1898 | $ log 'reverse(2 or 3 or 4 or 5)' |
|
|||
1899 | 5 |
|
|||
1900 | 4 |
|
|||
1901 | 3 |
|
|||
1902 | 2 |
|
|||
1903 | $ log 'reverse(all())' |
|
|||
1904 | 9 |
|
|||
1905 | 8 |
|
|||
1906 | 7 |
|
|||
1907 | 6 |
|
|||
1908 | 5 |
|
|||
1909 | 4 |
|
|||
1910 | 3 |
|
|||
1911 | 2 |
|
|||
1912 | 1 |
|
|||
1913 | 0 |
|
|||
1914 | $ log 'reverse(all()) & filelog(b)' |
|
|||
1915 | 4 |
|
|||
1916 | 1 |
|
|||
1917 | $ log 'rev(5)' |
|
|||
1918 | 5 |
|
|||
1919 | $ log 'sort(limit(reverse(all()), 3))' |
|
|||
1920 | 7 |
|
|||
1921 | 8 |
|
|||
1922 | 9 |
|
|||
1923 | $ log 'sort(2 or 3 or 4 or 5, date)' |
|
|||
1924 | 2 |
|
|||
1925 | 3 |
|
|||
1926 | 5 |
|
|||
1927 | 4 |
|
|||
1928 | $ log 'tagged()' |
|
|||
1929 | 6 |
|
|||
1930 | $ log 'tag()' |
|
|||
1931 | 6 |
|
|||
1932 | $ log 'tag(1.0)' |
|
|||
1933 | 6 |
|
|||
1934 | $ log 'tag(tip)' |
|
|||
1935 | 9 |
|
|||
1936 |
|
||||
1937 | Test order of revisions in compound expression |
|
|||
1938 | ---------------------------------------------- |
|
|||
1939 |
|
||||
1940 | The general rule is that only the outermost (= leftmost) predicate can |
|
|||
1941 | enforce its ordering requirement. The other predicates should take the |
|
|||
1942 | ordering defined by it. |
|
|||
1943 |
|
||||
1944 | 'A & B' should follow the order of 'A': |
|
|||
1945 |
|
||||
1946 | $ log '2:0 & 0::2' |
|
|||
1947 | 2 |
|
|||
1948 | 1 |
|
|||
1949 | 0 |
|
|||
1950 |
|
||||
1951 | 'head()' combines sets in right order: |
|
|||
1952 |
|
||||
1953 | $ log '2:0 & head()' |
|
|||
1954 | 2 |
|
|||
1955 | 1 |
|
|||
1956 | 0 |
|
|||
1957 |
|
||||
1958 | 'x:y' takes ordering parameter into account: |
|
|||
1959 |
|
||||
1960 | $ try -p optimized '3:0 & 0:3 & not 2:1' |
|
|||
1961 | * optimized: |
|
|||
1962 | (difference |
|
|||
1963 | (and |
|
|||
1964 | (range |
|
|||
1965 | (symbol '3') |
|
|||
1966 | (symbol '0')) |
|
|||
1967 | (range |
|
|||
1968 | (symbol '0') |
|
|||
1969 | (symbol '3'))) |
|
|||
1970 | (range |
|
|||
1971 | (symbol '2') |
|
|||
1972 | (symbol '1'))) |
|
|||
1973 | * set: |
|
|||
1974 | <filteredset |
|
|||
1975 | <filteredset |
|
|||
1976 | <spanset- 0:4>, |
|
|||
1977 | <spanset+ 0:4>>, |
|
|||
1978 | <not |
|
|||
1979 | <spanset+ 1:3>>> |
|
|||
1980 | 3 |
|
|||
1981 | 0 |
|
|||
1982 |
|
||||
1983 | 'a + b', which is optimized to '_list(a b)', should take the ordering of |
|
|||
1984 | the left expression: |
|
|||
1985 |
|
||||
1986 | $ try --optimize '2:0 & (0 + 1 + 2)' |
|
|||
1987 | (and |
|
|||
1988 | (range |
|
|||
1989 | (symbol '2') |
|
|||
1990 | (symbol '0')) |
|
|||
1991 | (group |
|
|||
1992 | (or |
|
|||
1993 | (list |
|
|||
1994 | (symbol '0') |
|
|||
1995 | (symbol '1') |
|
|||
1996 | (symbol '2'))))) |
|
|||
1997 | * optimized: |
|
|||
1998 | (and |
|
|||
1999 | (range |
|
|||
2000 | (symbol '2') |
|
|||
2001 | (symbol '0')) |
|
|||
2002 | (func |
|
|||
2003 | (symbol '_list') |
|
|||
2004 | (string '0\x001\x002'))) |
|
|||
2005 | * set: |
|
|||
2006 | <filteredset |
|
|||
2007 | <spanset- 0:3>, |
|
|||
2008 | <baseset [0, 1, 2]>> |
|
|||
2009 | 2 |
|
|||
2010 | 1 |
|
|||
2011 | 0 |
|
|||
2012 |
|
||||
2013 | 'A + B' should take the ordering of the left expression: |
|
|||
2014 |
|
||||
2015 | $ try --optimize '2:0 & (0:1 + 2)' |
|
|||
2016 | (and |
|
|||
2017 | (range |
|
|||
2018 | (symbol '2') |
|
|||
2019 | (symbol '0')) |
|
|||
2020 | (group |
|
|||
2021 | (or |
|
|||
2022 | (list |
|
|||
2023 | (range |
|
|||
2024 | (symbol '0') |
|
|||
2025 | (symbol '1')) |
|
|||
2026 | (symbol '2'))))) |
|
|||
2027 | * optimized: |
|
|||
2028 | (and |
|
|||
2029 | (range |
|
|||
2030 | (symbol '2') |
|
|||
2031 | (symbol '0')) |
|
|||
2032 | (or |
|
|||
2033 | (list |
|
|||
2034 | (range |
|
|||
2035 | (symbol '0') |
|
|||
2036 | (symbol '1')) |
|
|||
2037 | (symbol '2')))) |
|
|||
2038 | * set: |
|
|||
2039 | <filteredset |
|
|||
2040 | <spanset- 0:3>, |
|
|||
2041 | <addset |
|
|||
2042 | <spanset+ 0:2>, |
|
|||
2043 | <baseset [2]>>> |
|
|||
2044 | 2 |
|
|||
2045 | 1 |
|
|||
2046 | 0 |
|
|||
2047 |
|
||||
2048 | '_intlist(a b)' should behave like 'a + b': |
|
|||
2049 |
|
||||
2050 | $ trylist --optimize '2:0 & %ld' 0 1 2 |
|
|||
2051 | (and |
|
|||
2052 | (range |
|
|||
2053 | (symbol '2') |
|
|||
2054 | (symbol '0')) |
|
|||
2055 | (func |
|
|||
2056 | (symbol '_intlist') |
|
|||
2057 | (string '0\x001\x002'))) |
|
|||
2058 | * optimized: |
|
|||
2059 | (andsmally |
|
|||
2060 | (range |
|
|||
2061 | (symbol '2') |
|
|||
2062 | (symbol '0')) |
|
|||
2063 | (func |
|
|||
2064 | (symbol '_intlist') |
|
|||
2065 | (string '0\x001\x002'))) |
|
|||
2066 | * set: |
|
|||
2067 | <filteredset |
|
|||
2068 | <spanset- 0:3>, |
|
|||
2069 | <baseset+ [0, 1, 2]>> |
|
|||
2070 | 2 |
|
|||
2071 | 1 |
|
|||
2072 | 0 |
|
|||
2073 |
|
||||
2074 | $ trylist --optimize '%ld & 2:0' 0 2 1 |
|
|||
2075 | (and |
|
|||
2076 | (func |
|
|||
2077 | (symbol '_intlist') |
|
|||
2078 | (string '0\x002\x001')) |
|
|||
2079 | (range |
|
|||
2080 | (symbol '2') |
|
|||
2081 | (symbol '0'))) |
|
|||
2082 | * optimized: |
|
|||
2083 | (and |
|
|||
2084 | (func |
|
|||
2085 | (symbol '_intlist') |
|
|||
2086 | (string '0\x002\x001')) |
|
|||
2087 | (range |
|
|||
2088 | (symbol '2') |
|
|||
2089 | (symbol '0'))) |
|
|||
2090 | * set: |
|
|||
2091 | <filteredset |
|
|||
2092 | <baseset [0, 2, 1]>, |
|
|||
2093 | <spanset- 0:3>> |
|
|||
2094 | 0 |
|
|||
2095 | 2 |
|
|||
2096 | 1 |
|
|||
2097 |
|
||||
2098 | '_hexlist(a b)' should behave like 'a + b': |
|
|||
2099 |
|
||||
2100 | $ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2` |
|
|||
2101 | (and |
|
|||
2102 | (range |
|
|||
2103 | (symbol '2') |
|
|||
2104 | (symbol '0')) |
|
|||
2105 | (func |
|
|||
2106 | (symbol '_hexlist') |
|
|||
2107 | (string '*'))) (glob) |
|
|||
2108 | * optimized: |
|
|||
2109 | (and |
|
|||
2110 | (range |
|
|||
2111 | (symbol '2') |
|
|||
2112 | (symbol '0')) |
|
|||
2113 | (func |
|
|||
2114 | (symbol '_hexlist') |
|
|||
2115 | (string '*'))) (glob) |
|
|||
2116 | * set: |
|
|||
2117 | <filteredset |
|
|||
2118 | <spanset- 0:3>, |
|
|||
2119 | <baseset [0, 1, 2]>> |
|
|||
2120 | 2 |
|
|||
2121 | 1 |
|
|||
2122 | 0 |
|
|||
2123 |
|
||||
2124 | $ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1` |
|
|||
2125 | (and |
|
|||
2126 | (func |
|
|||
2127 | (symbol '_hexlist') |
|
|||
2128 | (string '*')) (glob) |
|
|||
2129 | (range |
|
|||
2130 | (symbol '2') |
|
|||
2131 | (symbol '0'))) |
|
|||
2132 | * optimized: |
|
|||
2133 | (andsmally |
|
|||
2134 | (func |
|
|||
2135 | (symbol '_hexlist') |
|
|||
2136 | (string '*')) (glob) |
|
|||
2137 | (range |
|
|||
2138 | (symbol '2') |
|
|||
2139 | (symbol '0'))) |
|
|||
2140 | * set: |
|
|||
2141 | <baseset [0, 2, 1]> |
|
|||
2142 | 0 |
|
|||
2143 | 2 |
|
|||
2144 | 1 |
|
|||
2145 |
|
||||
2146 | '_list' should not go through the slow follow-order path if order doesn't |
|
|||
2147 | matter: |
|
|||
2148 |
|
||||
2149 | $ try -p optimized '2:0 & not (0 + 1)' |
|
|||
2150 | * optimized: |
|
|||
2151 | (difference |
|
|||
2152 | (range |
|
|||
2153 | (symbol '2') |
|
|||
2154 | (symbol '0')) |
|
|||
2155 | (func |
|
|||
2156 | (symbol '_list') |
|
|||
2157 | (string '0\x001'))) |
|
|||
2158 | * set: |
|
|||
2159 | <filteredset |
|
|||
2160 | <spanset- 0:3>, |
|
|||
2161 | <not |
|
|||
2162 | <baseset [0, 1]>>> |
|
|||
2163 | 2 |
|
|||
2164 |
|
||||
2165 | $ try -p optimized '2:0 & not (0:2 & (0 + 1))' |
|
|||
2166 | * optimized: |
|
|||
2167 | (difference |
|
|||
2168 | (range |
|
|||
2169 | (symbol '2') |
|
|||
2170 | (symbol '0')) |
|
|||
2171 | (and |
|
|||
2172 | (range |
|
|||
2173 | (symbol '0') |
|
|||
2174 | (symbol '2')) |
|
|||
2175 | (func |
|
|||
2176 | (symbol '_list') |
|
|||
2177 | (string '0\x001')))) |
|
|||
2178 | * set: |
|
|||
2179 | <filteredset |
|
|||
2180 | <spanset- 0:3>, |
|
|||
2181 | <not |
|
|||
2182 | <baseset [0, 1]>>> |
|
|||
2183 | 2 |
|
|||
2184 |
|
||||
2185 | because 'present()' does nothing other than suppressing an error, the |
|
|||
2186 | ordering requirement should be forwarded to the nested expression |
|
|||
2187 |
|
||||
2188 | $ try -p optimized 'present(2 + 0 + 1)' |
|
|||
2189 | * optimized: |
|
|||
2190 | (func |
|
|||
2191 | (symbol 'present') |
|
|||
2192 | (func |
|
|||
2193 | (symbol '_list') |
|
|||
2194 | (string '2\x000\x001'))) |
|
|||
2195 | * set: |
|
|||
2196 | <baseset [2, 0, 1]> |
|
|||
2197 | 2 |
|
|||
2198 | 0 |
|
|||
2199 | 1 |
|
|||
2200 |
|
||||
2201 | $ try --optimize '2:0 & present(0 + 1 + 2)' |
|
|||
2202 | (and |
|
|||
2203 | (range |
|
|||
2204 | (symbol '2') |
|
|||
2205 | (symbol '0')) |
|
|||
2206 | (func |
|
|||
2207 | (symbol 'present') |
|
|||
2208 | (or |
|
|||
2209 | (list |
|
|||
2210 | (symbol '0') |
|
|||
2211 | (symbol '1') |
|
|||
2212 | (symbol '2'))))) |
|
|||
2213 | * optimized: |
|
|||
2214 | (and |
|
|||
2215 | (range |
|
|||
2216 | (symbol '2') |
|
|||
2217 | (symbol '0')) |
|
|||
2218 | (func |
|
|||
2219 | (symbol 'present') |
|
|||
2220 | (func |
|
|||
2221 | (symbol '_list') |
|
|||
2222 | (string '0\x001\x002')))) |
|
|||
2223 | * set: |
|
|||
2224 | <filteredset |
|
|||
2225 | <spanset- 0:3>, |
|
|||
2226 | <baseset [0, 1, 2]>> |
|
|||
2227 | 2 |
|
|||
2228 | 1 |
|
|||
2229 | 0 |
|
|||
2230 |
|
||||
2231 | 'reverse()' should take effect only if it is the outermost expression: |
|
|||
2232 |
|
||||
2233 | $ try --optimize '0:2 & reverse(all())' |
|
|||
2234 | (and |
|
|||
2235 | (range |
|
|||
2236 | (symbol '0') |
|
|||
2237 | (symbol '2')) |
|
|||
2238 | (func |
|
|||
2239 | (symbol 'reverse') |
|
|||
2240 | (func |
|
|||
2241 | (symbol 'all') |
|
|||
2242 | None))) |
|
|||
2243 | * optimized: |
|
|||
2244 | (and |
|
|||
2245 | (range |
|
|||
2246 | (symbol '0') |
|
|||
2247 | (symbol '2')) |
|
|||
2248 | (func |
|
|||
2249 | (symbol 'reverse') |
|
|||
2250 | (func |
|
|||
2251 | (symbol 'all') |
|
|||
2252 | None))) |
|
|||
2253 | * set: |
|
|||
2254 | <filteredset |
|
|||
2255 | <spanset+ 0:3>, |
|
|||
2256 | <spanset+ 0:10>> |
|
|||
2257 | 0 |
|
|||
2258 | 1 |
|
|||
2259 | 2 |
|
|||
2260 |
|
||||
2261 | 'sort()' should take effect only if it is the outermost expression: |
|
|||
2262 |
|
||||
2263 | $ try --optimize '0:2 & sort(all(), -rev)' |
|
|||
2264 | (and |
|
|||
2265 | (range |
|
|||
2266 | (symbol '0') |
|
|||
2267 | (symbol '2')) |
|
|||
2268 | (func |
|
|||
2269 | (symbol 'sort') |
|
|||
2270 | (list |
|
|||
2271 | (func |
|
|||
2272 | (symbol 'all') |
|
|||
2273 | None) |
|
|||
2274 | (negate |
|
|||
2275 | (symbol 'rev'))))) |
|
|||
2276 | * optimized: |
|
|||
2277 | (and |
|
|||
2278 | (range |
|
|||
2279 | (symbol '0') |
|
|||
2280 | (symbol '2')) |
|
|||
2281 | (func |
|
|||
2282 | (symbol 'sort') |
|
|||
2283 | (list |
|
|||
2284 | (func |
|
|||
2285 | (symbol 'all') |
|
|||
2286 | None) |
|
|||
2287 | (string '-rev')))) |
|
|||
2288 | * set: |
|
|||
2289 | <filteredset |
|
|||
2290 | <spanset+ 0:3>, |
|
|||
2291 | <spanset+ 0:10>> |
|
|||
2292 | 0 |
|
|||
2293 | 1 |
|
|||
2294 | 2 |
|
|||
2295 |
|
||||
2296 | invalid argument passed to noop sort(): |
|
|||
2297 |
|
||||
2298 | $ log '0:2 & sort()' |
|
|||
2299 | hg: parse error: sort requires one or two arguments |
|
|||
2300 | [255] |
|
|||
2301 | $ log '0:2 & sort(all(), -invalid)' |
|
|||
2302 | hg: parse error: unknown sort key '-invalid' |
|
|||
2303 | [255] |
|
|||
2304 |
|
||||
2305 | for 'A & f(B)', 'B' should not be affected by the order of 'A': |
|
|||
2306 |
|
||||
2307 | $ try --optimize '2:0 & first(1 + 0 + 2)' |
|
|||
2308 | (and |
|
|||
2309 | (range |
|
|||
2310 | (symbol '2') |
|
|||
2311 | (symbol '0')) |
|
|||
2312 | (func |
|
|||
2313 | (symbol 'first') |
|
|||
2314 | (or |
|
|||
2315 | (list |
|
|||
2316 | (symbol '1') |
|
|||
2317 | (symbol '0') |
|
|||
2318 | (symbol '2'))))) |
|
|||
2319 | * optimized: |
|
|||
2320 | (and |
|
|||
2321 | (range |
|
|||
2322 | (symbol '2') |
|
|||
2323 | (symbol '0')) |
|
|||
2324 | (func |
|
|||
2325 | (symbol 'first') |
|
|||
2326 | (func |
|
|||
2327 | (symbol '_list') |
|
|||
2328 | (string '1\x000\x002')))) |
|
|||
2329 | * set: |
|
|||
2330 | <filteredset |
|
|||
2331 | <baseset [1]>, |
|
|||
2332 | <spanset- 0:3>> |
|
|||
2333 | 1 |
|
|||
2334 |
|
||||
2335 | $ try --optimize '2:0 & not last(0 + 2 + 1)' |
|
|||
2336 | (and |
|
|||
2337 | (range |
|
|||
2338 | (symbol '2') |
|
|||
2339 | (symbol '0')) |
|
|||
2340 | (not |
|
|||
2341 | (func |
|
|||
2342 | (symbol 'last') |
|
|||
2343 | (or |
|
|||
2344 | (list |
|
|||
2345 | (symbol '0') |
|
|||
2346 | (symbol '2') |
|
|||
2347 | (symbol '1')))))) |
|
|||
2348 | * optimized: |
|
|||
2349 | (difference |
|
|||
2350 | (range |
|
|||
2351 | (symbol '2') |
|
|||
2352 | (symbol '0')) |
|
|||
2353 | (func |
|
|||
2354 | (symbol 'last') |
|
|||
2355 | (func |
|
|||
2356 | (symbol '_list') |
|
|||
2357 | (string '0\x002\x001')))) |
|
|||
2358 | * set: |
|
|||
2359 | <filteredset |
|
|||
2360 | <spanset- 0:3>, |
|
|||
2361 | <not |
|
|||
2362 | <baseset [1]>>> |
|
|||
2363 | 2 |
|
|||
2364 | 0 |
|
|||
2365 |
|
||||
2366 | for 'A & (op)(B)', 'B' should not be affected by the order of 'A': |
|
|||
2367 |
|
||||
2368 | $ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)' |
|
|||
2369 | (and |
|
|||
2370 | (range |
|
|||
2371 | (symbol '2') |
|
|||
2372 | (symbol '0')) |
|
|||
2373 | (range |
|
|||
2374 | (group |
|
|||
2375 | (or |
|
|||
2376 | (list |
|
|||
2377 | (symbol '1') |
|
|||
2378 | (symbol '0') |
|
|||
2379 | (symbol '2')))) |
|
|||
2380 | (group |
|
|||
2381 | (or |
|
|||
2382 | (list |
|
|||
2383 | (symbol '0') |
|
|||
2384 | (symbol '2') |
|
|||
2385 | (symbol '1')))))) |
|
|||
2386 | * optimized: |
|
|||
2387 | (and |
|
|||
2388 | (range |
|
|||
2389 | (symbol '2') |
|
|||
2390 | (symbol '0')) |
|
|||
2391 | (range |
|
|||
2392 | (func |
|
|||
2393 | (symbol '_list') |
|
|||
2394 | (string '1\x000\x002')) |
|
|||
2395 | (func |
|
|||
2396 | (symbol '_list') |
|
|||
2397 | (string '0\x002\x001')))) |
|
|||
2398 | * set: |
|
|||
2399 | <filteredset |
|
|||
2400 | <spanset- 0:3>, |
|
|||
2401 | <baseset [1]>> |
|
|||
2402 | 1 |
|
|||
2403 |
|
||||
2404 | 'A & B' can be rewritten as 'flipand(B, A)' by weight. |
|
|||
2405 |
|
||||
2406 | $ try --optimize 'contains("glob:*") & (2 + 0 + 1)' |
|
|||
2407 | (and |
|
|||
2408 | (func |
|
|||
2409 | (symbol 'contains') |
|
|||
2410 | (string 'glob:*')) |
|
|||
2411 | (group |
|
|||
2412 | (or |
|
|||
2413 | (list |
|
|||
2414 | (symbol '2') |
|
|||
2415 | (symbol '0') |
|
|||
2416 | (symbol '1'))))) |
|
|||
2417 | * optimized: |
|
|||
2418 | (andsmally |
|
|||
2419 | (func |
|
|||
2420 | (symbol 'contains') |
|
|||
2421 | (string 'glob:*')) |
|
|||
2422 | (func |
|
|||
2423 | (symbol '_list') |
|
|||
2424 | (string '2\x000\x001'))) |
|
|||
2425 | * set: |
|
|||
2426 | <filteredset |
|
|||
2427 | <baseset+ [0, 1, 2]>, |
|
|||
2428 | <contains 'glob:*'>> |
|
|||
2429 | 0 |
|
|||
2430 | 1 |
|
|||
2431 | 2 |
|
|||
2432 |
|
||||
2433 | and in this example, 'A & B' is rewritten as 'B & A', but 'A' overrides |
|
|||
2434 | the order appropriately: |
|
|||
2435 |
|
||||
2436 | $ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)' |
|
|||
2437 | (and |
|
|||
2438 | (func |
|
|||
2439 | (symbol 'reverse') |
|
|||
2440 | (func |
|
|||
2441 | (symbol 'contains') |
|
|||
2442 | (string 'glob:*'))) |
|
|||
2443 | (group |
|
|||
2444 | (or |
|
|||
2445 | (list |
|
|||
2446 | (symbol '0') |
|
|||
2447 | (symbol '2') |
|
|||
2448 | (symbol '1'))))) |
|
|||
2449 | * optimized: |
|
|||
2450 | (andsmally |
|
|||
2451 | (func |
|
|||
2452 | (symbol 'reverse') |
|
|||
2453 | (func |
|
|||
2454 | (symbol 'contains') |
|
|||
2455 | (string 'glob:*'))) |
|
|||
2456 | (func |
|
|||
2457 | (symbol '_list') |
|
|||
2458 | (string '0\x002\x001'))) |
|
|||
2459 | * set: |
|
|||
2460 | <filteredset |
|
|||
2461 | <baseset- [0, 1, 2]>, |
|
|||
2462 | <contains 'glob:*'>> |
|
|||
2463 | 2 |
|
|||
2464 | 1 |
|
|||
2465 | 0 |
|
|||
2466 |
|
||||
2467 | test sort revset |
|
|||
2468 | -------------------------------------------- |
|
|||
2469 |
|
||||
2470 | test when adding two unordered revsets |
|
|||
2471 |
|
||||
2472 | $ log 'sort(keyword(issue) or modifies(b))' |
|
|||
2473 | 4 |
|
|||
2474 | 6 |
|
|||
2475 |
|
||||
2476 | test when sorting a reversed collection in the same way it is |
|
|||
2477 |
|
||||
2478 | $ log 'sort(reverse(all()), -rev)' |
|
|||
2479 | 9 |
|
|||
2480 | 8 |
|
|||
2481 | 7 |
|
|||
2482 | 6 |
|
|||
2483 | 5 |
|
|||
2484 | 4 |
|
|||
2485 | 3 |
|
|||
2486 | 2 |
|
|||
2487 | 1 |
|
|||
2488 | 0 |
|
|||
2489 |
|
||||
2490 | test when sorting a reversed collection |
|
|||
2491 |
|
||||
2492 | $ log 'sort(reverse(all()), rev)' |
|
|||
2493 | 0 |
|
|||
2494 | 1 |
|
|||
2495 | 2 |
|
|||
2496 | 3 |
|
|||
2497 | 4 |
|
|||
2498 | 5 |
|
|||
2499 | 6 |
|
|||
2500 | 7 |
|
|||
2501 | 8 |
|
|||
2502 | 9 |
|
|||
2503 |
|
||||
2504 |
|
||||
2505 | test sorting two sorted collections in different orders |
|
|||
2506 |
|
||||
2507 | $ log 'sort(outgoing() or reverse(removes(a)), rev)' |
|
|||
2508 | 2 |
|
|||
2509 | 6 |
|
|||
2510 | 8 |
|
|||
2511 | 9 |
|
|||
2512 |
|
||||
2513 | test sorting two sorted collections in different orders backwards |
|
|||
2514 |
|
||||
2515 | $ log 'sort(outgoing() or reverse(removes(a)), -rev)' |
|
|||
2516 | 9 |
|
|||
2517 | 8 |
|
|||
2518 | 6 |
|
|||
2519 | 2 |
|
|||
2520 |
|
||||
2521 | test empty sort key which is noop |
|
|||
2522 |
|
||||
2523 | $ log 'sort(0 + 2 + 1, "")' |
|
|||
2524 | 0 |
|
|||
2525 | 2 |
|
|||
2526 | 1 |
|
|||
2527 |
|
||||
2528 | test invalid sort keys |
|
|||
2529 |
|
||||
2530 | $ log 'sort(all(), -invalid)' |
|
|||
2531 | hg: parse error: unknown sort key '-invalid' |
|
|||
2532 | [255] |
|
|||
2533 |
|
||||
2534 | $ cd .. |
|
|||
2535 |
|
||||
2536 | test sorting by multiple keys including variable-length strings |
|
|||
2537 |
|
||||
2538 | $ hg init sorting |
|
|||
2539 | $ cd sorting |
|
|||
2540 | $ cat <<EOF >> .hg/hgrc |
|
|||
2541 | > [ui] |
|
|||
2542 | > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n' |
|
|||
2543 | > [templatealias] |
|
|||
2544 | > p5(s) = pad(s, 5) |
|
|||
2545 | > EOF |
|
|||
2546 | $ hg branch -qf b12 |
|
|||
2547 | $ hg ci -m m111 -u u112 -d '111 10800' |
|
|||
2548 | $ hg branch -qf b11 |
|
|||
2549 | $ hg ci -m m12 -u u111 -d '112 7200' |
|
|||
2550 | $ hg branch -qf b111 |
|
|||
2551 | $ hg ci -m m11 -u u12 -d '111 3600' |
|
|||
2552 | $ hg branch -qf b112 |
|
|||
2553 | $ hg ci -m m111 -u u11 -d '120 0' |
|
|||
2554 | $ hg branch -qf b111 |
|
|||
2555 | $ hg ci -m m112 -u u111 -d '110 14400' |
|
|||
2556 | created new head |
|
|||
2557 |
|
||||
2558 | compare revisions (has fast path): |
|
|||
2559 |
|
||||
2560 | $ hg log -r 'sort(all(), rev)' |
|
|||
2561 | 0 b12 m111 u112 111 10800 |
|
|||
2562 | 1 b11 m12 u111 112 7200 |
|
|||
2563 | 2 b111 m11 u12 111 3600 |
|
|||
2564 | 3 b112 m111 u11 120 0 |
|
|||
2565 | 4 b111 m112 u111 110 14400 |
|
|||
2566 |
|
||||
2567 | $ hg log -r 'sort(all(), -rev)' |
|
|||
2568 | 4 b111 m112 u111 110 14400 |
|
|||
2569 | 3 b112 m111 u11 120 0 |
|
|||
2570 | 2 b111 m11 u12 111 3600 |
|
|||
2571 | 1 b11 m12 u111 112 7200 |
|
|||
2572 | 0 b12 m111 u112 111 10800 |
|
|||
2573 |
|
||||
2574 | compare variable-length strings (issue5218): |
|
|||
2575 |
|
||||
2576 | $ hg log -r 'sort(all(), branch)' |
|
|||
2577 | 1 b11 m12 u111 112 7200 |
|
|||
2578 | 2 b111 m11 u12 111 3600 |
|
|||
2579 | 4 b111 m112 u111 110 14400 |
|
|||
2580 | 3 b112 m111 u11 120 0 |
|
|||
2581 | 0 b12 m111 u112 111 10800 |
|
|||
2582 |
|
||||
2583 | $ hg log -r 'sort(all(), -branch)' |
|
|||
2584 | 0 b12 m111 u112 111 10800 |
|
|||
2585 | 3 b112 m111 u11 120 0 |
|
|||
2586 | 2 b111 m11 u12 111 3600 |
|
|||
2587 | 4 b111 m112 u111 110 14400 |
|
|||
2588 | 1 b11 m12 u111 112 7200 |
|
|||
2589 |
|
||||
2590 | $ hg log -r 'sort(all(), desc)' |
|
|||
2591 | 2 b111 m11 u12 111 3600 |
|
|||
2592 | 0 b12 m111 u112 111 10800 |
|
|||
2593 | 3 b112 m111 u11 120 0 |
|
|||
2594 | 4 b111 m112 u111 110 14400 |
|
|||
2595 | 1 b11 m12 u111 112 7200 |
|
|||
2596 |
|
||||
2597 | $ hg log -r 'sort(all(), -desc)' |
|
|||
2598 | 1 b11 m12 u111 112 7200 |
|
|||
2599 | 4 b111 m112 u111 110 14400 |
|
|||
2600 | 0 b12 m111 u112 111 10800 |
|
|||
2601 | 3 b112 m111 u11 120 0 |
|
|||
2602 | 2 b111 m11 u12 111 3600 |
|
|||
2603 |
|
||||
2604 | $ hg log -r 'sort(all(), user)' |
|
|||
2605 | 3 b112 m111 u11 120 0 |
|
|||
2606 | 1 b11 m12 u111 112 7200 |
|
|||
2607 | 4 b111 m112 u111 110 14400 |
|
|||
2608 | 0 b12 m111 u112 111 10800 |
|
|||
2609 | 2 b111 m11 u12 111 3600 |
|
|||
2610 |
|
||||
2611 | $ hg log -r 'sort(all(), -user)' |
|
|||
2612 | 2 b111 m11 u12 111 3600 |
|
|||
2613 | 0 b12 m111 u112 111 10800 |
|
|||
2614 | 1 b11 m12 u111 112 7200 |
|
|||
2615 | 4 b111 m112 u111 110 14400 |
|
|||
2616 | 3 b112 m111 u11 120 0 |
|
|||
2617 |
|
||||
2618 | compare dates (tz offset should have no effect): |
|
|||
2619 |
|
||||
2620 | $ hg log -r 'sort(all(), date)' |
|
|||
2621 | 4 b111 m112 u111 110 14400 |
|
|||
2622 | 0 b12 m111 u112 111 10800 |
|
|||
2623 | 2 b111 m11 u12 111 3600 |
|
|||
2624 | 1 b11 m12 u111 112 7200 |
|
|||
2625 | 3 b112 m111 u11 120 0 |
|
|||
2626 |
|
||||
2627 | $ hg log -r 'sort(all(), -date)' |
|
|||
2628 | 3 b112 m111 u11 120 0 |
|
|||
2629 | 1 b11 m12 u111 112 7200 |
|
|||
2630 | 0 b12 m111 u112 111 10800 |
|
|||
2631 | 2 b111 m11 u12 111 3600 |
|
|||
2632 | 4 b111 m112 u111 110 14400 |
|
|||
2633 |
|
||||
2634 | be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))' |
|
|||
2635 | because '-k' reverses the comparison, not the list itself: |
|
|||
2636 |
|
||||
2637 | $ hg log -r 'sort(0 + 2, date)' |
|
|||
2638 | 0 b12 m111 u112 111 10800 |
|
|||
2639 | 2 b111 m11 u12 111 3600 |
|
|||
2640 |
|
||||
2641 | $ hg log -r 'sort(0 + 2, -date)' |
|
|||
2642 | 0 b12 m111 u112 111 10800 |
|
|||
2643 | 2 b111 m11 u12 111 3600 |
|
|||
2644 |
|
||||
2645 | $ hg log -r 'reverse(sort(0 + 2, date))' |
|
|||
2646 | 2 b111 m11 u12 111 3600 |
|
|||
2647 | 0 b12 m111 u112 111 10800 |
|
|||
2648 |
|
||||
2649 | sort by multiple keys: |
|
|||
2650 |
|
||||
2651 | $ hg log -r 'sort(all(), "branch -rev")' |
|
|||
2652 | 1 b11 m12 u111 112 7200 |
|
|||
2653 | 4 b111 m112 u111 110 14400 |
|
|||
2654 | 2 b111 m11 u12 111 3600 |
|
|||
2655 | 3 b112 m111 u11 120 0 |
|
|||
2656 | 0 b12 m111 u112 111 10800 |
|
|||
2657 |
|
||||
2658 | $ hg log -r 'sort(all(), "-desc -date")' |
|
|||
2659 | 1 b11 m12 u111 112 7200 |
|
|||
2660 | 4 b111 m112 u111 110 14400 |
|
|||
2661 | 3 b112 m111 u11 120 0 |
|
|||
2662 | 0 b12 m111 u112 111 10800 |
|
|||
2663 | 2 b111 m11 u12 111 3600 |
|
|||
2664 |
|
||||
2665 | $ hg log -r 'sort(all(), "user -branch date rev")' |
|
|||
2666 | 3 b112 m111 u11 120 0 |
|
|||
2667 | 4 b111 m112 u111 110 14400 |
|
|||
2668 | 1 b11 m12 u111 112 7200 |
|
|||
2669 | 0 b12 m111 u112 111 10800 |
|
|||
2670 | 2 b111 m11 u12 111 3600 |
|
|||
2671 |
|
||||
2672 | toposort prioritises graph branches |
|
|||
2673 |
|
||||
2674 | $ hg up 2 |
|
|||
2675 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
2676 | $ touch a |
|
|||
2677 | $ hg addremove |
|
|||
2678 | adding a |
|
|||
2679 | $ hg ci -m 't1' -u 'tu' -d '130 0' |
|
|||
2680 | created new head |
|
|||
2681 | $ echo 'a' >> a |
|
|||
2682 | $ hg ci -m 't2' -u 'tu' -d '130 0' |
|
|||
2683 | $ hg book book1 |
|
|||
2684 | $ hg up 4 |
|
|||
2685 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
2686 | (leaving bookmark book1) |
|
|||
2687 | $ touch a |
|
|||
2688 | $ hg addremove |
|
|||
2689 | adding a |
|
|||
2690 | $ hg ci -m 't3' -u 'tu' -d '130 0' |
|
|||
2691 |
|
||||
2692 | $ hg log -r 'sort(all(), topo)' |
|
|||
2693 | 7 b111 t3 tu 130 0 |
|
|||
2694 | 4 b111 m112 u111 110 14400 |
|
|||
2695 | 3 b112 m111 u11 120 0 |
|
|||
2696 | 6 b111 t2 tu 130 0 |
|
|||
2697 | 5 b111 t1 tu 130 0 |
|
|||
2698 | 2 b111 m11 u12 111 3600 |
|
|||
2699 | 1 b11 m12 u111 112 7200 |
|
|||
2700 | 0 b12 m111 u112 111 10800 |
|
|||
2701 |
|
||||
2702 | $ hg log -r 'sort(all(), -topo)' |
|
|||
2703 | 0 b12 m111 u112 111 10800 |
|
|||
2704 | 1 b11 m12 u111 112 7200 |
|
|||
2705 | 2 b111 m11 u12 111 3600 |
|
|||
2706 | 5 b111 t1 tu 130 0 |
|
|||
2707 | 6 b111 t2 tu 130 0 |
|
|||
2708 | 3 b112 m111 u11 120 0 |
|
|||
2709 | 4 b111 m112 u111 110 14400 |
|
|||
2710 | 7 b111 t3 tu 130 0 |
|
|||
2711 |
|
||||
2712 | $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)' |
|
|||
2713 | 6 b111 t2 tu 130 0 |
|
|||
2714 | 5 b111 t1 tu 130 0 |
|
|||
2715 | 7 b111 t3 tu 130 0 |
|
|||
2716 | 4 b111 m112 u111 110 14400 |
|
|||
2717 | 3 b112 m111 u11 120 0 |
|
|||
2718 | 2 b111 m11 u12 111 3600 |
|
|||
2719 | 1 b11 m12 u111 112 7200 |
|
|||
2720 | 0 b12 m111 u112 111 10800 |
|
|||
2721 |
|
||||
2722 | topographical sorting can't be combined with other sort keys, and you can't |
|
|||
2723 | use the topo.firstbranch option when topo sort is not active: |
|
|||
2724 |
|
||||
2725 | $ hg log -r 'sort(all(), "topo user")' |
|
|||
2726 | hg: parse error: topo sort order cannot be combined with other sort keys |
|
|||
2727 | [255] |
|
|||
2728 |
|
||||
2729 | $ hg log -r 'sort(all(), user, topo.firstbranch=book1)' |
|
|||
2730 | hg: parse error: topo.firstbranch can only be used when using the topo sort key |
|
|||
2731 | [255] |
|
|||
2732 |
|
||||
2733 | topo.firstbranch should accept any kind of expressions: |
|
|||
2734 |
|
||||
2735 | $ hg log -r 'sort(0, topo, topo.firstbranch=(book1))' |
|
|||
2736 | 0 b12 m111 u112 111 10800 |
|
|||
2737 |
|
||||
2738 | $ cd .. |
|
|||
2739 | $ cd repo |
|
|||
2740 |
|
||||
2741 | test subtracting something from an addset |
|
92 | test subtracting something from an addset | |
2742 |
|
93 | |||
2743 | $ log '(outgoing() or removes(a)) - removes(a)' |
|
94 | $ log '(outgoing() or removes(a)) - removes(a)' | |
2744 | 8 |
|
95 | 8 | |
2745 | 9 |
|
96 | 9 | |
2746 |
|
97 | |||
2747 | test intersecting something with an addset |
|
98 | test intersecting something with an addset | |
2748 |
|
99 | |||
2749 | $ log 'parents(outgoing() or removes(a))' |
|
100 | $ log 'parents(outgoing() or removes(a))' | |
2750 | 1 |
|
101 | 1 | |
2751 | 4 |
|
102 | 4 | |
2752 | 5 |
|
103 | 5 | |
2753 | 8 |
|
104 | 8 | |
2754 |
|
105 | |||
2755 | test that `or` operation combines elements in the right order: |
|
106 | test that `or` operation combines elements in the right order: | |
2756 |
|
107 | |||
2757 | $ log '3:4 or 2:5' |
|
108 | $ log '3:4 or 2:5' | |
2758 | 3 |
|
109 | 3 | |
2759 | 4 |
|
110 | 4 | |
2760 | 2 |
|
111 | 2 | |
2761 | 5 |
|
112 | 5 | |
2762 | $ log '3:4 or 5:2' |
|
113 | $ log '3:4 or 5:2' | |
2763 | 3 |
|
114 | 3 | |
2764 | 4 |
|
115 | 4 | |
2765 | 5 |
|
116 | 5 | |
2766 | 2 |
|
117 | 2 | |
2767 | $ log 'sort(3:4 or 2:5)' |
|
118 | $ log 'sort(3:4 or 2:5)' | |
2768 | 2 |
|
119 | 2 | |
2769 | 3 |
|
120 | 3 | |
2770 | 4 |
|
121 | 4 | |
2771 | 5 |
|
122 | 5 | |
2772 | $ log 'sort(3:4 or 5:2)' |
|
123 | $ log 'sort(3:4 or 5:2)' | |
2773 | 2 |
|
124 | 2 | |
2774 | 3 |
|
125 | 3 | |
2775 | 4 |
|
126 | 4 | |
2776 | 5 |
|
127 | 5 | |
2777 |
|
128 | |||
2778 | test that more than one `-r`s are combined in the right order and deduplicated: |
|
129 | test that more than one `-r`s are combined in the right order and deduplicated: | |
2779 |
|
130 | |||
2780 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' |
|
131 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' | |
2781 | 3 |
|
132 | 3 | |
2782 | 4 |
|
133 | 4 | |
2783 | 5 |
|
134 | 5 | |
2784 | 2 |
|
135 | 2 | |
2785 | 0 |
|
136 | 0 | |
2786 | 1 |
|
137 | 1 | |
2787 |
|
138 | |||
2788 | test that `or` operation skips duplicated revisions from right-hand side |
|
139 | test that `or` operation skips duplicated revisions from right-hand side | |
2789 |
|
140 | |||
2790 | $ try 'reverse(1::5) or ancestors(4)' |
|
141 | $ try 'reverse(1::5) or ancestors(4)' | |
2791 | (or |
|
142 | (or | |
2792 | (list |
|
143 | (list | |
2793 | (func |
|
144 | (func | |
2794 | (symbol 'reverse') |
|
145 | (symbol 'reverse') | |
2795 | (dagrange |
|
146 | (dagrange | |
2796 | (symbol '1') |
|
147 | (symbol '1') | |
2797 | (symbol '5'))) |
|
148 | (symbol '5'))) | |
2798 | (func |
|
149 | (func | |
2799 | (symbol 'ancestors') |
|
150 | (symbol 'ancestors') | |
2800 | (symbol '4')))) |
|
151 | (symbol '4')))) | |
2801 | * set: |
|
152 | * set: | |
2802 | <addset |
|
153 | <addset | |
2803 | <baseset- [1, 3, 5]>, |
|
154 | <baseset- [1, 3, 5]>, | |
2804 | <generatorset+>> |
|
155 | <generatorset+>> | |
2805 | 5 |
|
156 | 5 | |
2806 | 3 |
|
157 | 3 | |
2807 | 1 |
|
158 | 1 | |
2808 | 0 |
|
159 | 0 | |
2809 | 2 |
|
160 | 2 | |
2810 | 4 |
|
161 | 4 | |
2811 | $ try 'sort(ancestors(4) or reverse(1::5))' |
|
162 | $ try 'sort(ancestors(4) or reverse(1::5))' | |
2812 | (func |
|
163 | (func | |
2813 | (symbol 'sort') |
|
164 | (symbol 'sort') | |
2814 | (or |
|
165 | (or | |
2815 | (list |
|
166 | (list | |
2816 | (func |
|
167 | (func | |
2817 | (symbol 'ancestors') |
|
168 | (symbol 'ancestors') | |
2818 | (symbol '4')) |
|
169 | (symbol '4')) | |
2819 | (func |
|
170 | (func | |
2820 | (symbol 'reverse') |
|
171 | (symbol 'reverse') | |
2821 | (dagrange |
|
172 | (dagrange | |
2822 | (symbol '1') |
|
173 | (symbol '1') | |
2823 | (symbol '5')))))) |
|
174 | (symbol '5')))))) | |
2824 | * set: |
|
175 | * set: | |
2825 | <addset+ |
|
176 | <addset+ | |
2826 | <generatorset+>, |
|
177 | <generatorset+>, | |
2827 | <baseset- [1, 3, 5]>> |
|
178 | <baseset- [1, 3, 5]>> | |
2828 | 0 |
|
179 | 0 | |
2829 | 1 |
|
180 | 1 | |
2830 | 2 |
|
181 | 2 | |
2831 | 3 |
|
182 | 3 | |
2832 | 4 |
|
183 | 4 | |
2833 | 5 |
|
184 | 5 | |
2834 |
|
185 | |||
2835 | test optimization of trivial `or` operation |
|
186 | test optimization of trivial `or` operation | |
2836 |
|
187 | |||
2837 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
188 | $ try --optimize '0|(1)|"2"|-2|tip|null' | |
2838 | (or |
|
189 | (or | |
2839 | (list |
|
190 | (list | |
2840 | (symbol '0') |
|
191 | (symbol '0') | |
2841 | (group |
|
192 | (group | |
2842 | (symbol '1')) |
|
193 | (symbol '1')) | |
2843 | (string '2') |
|
194 | (string '2') | |
2844 | (negate |
|
195 | (negate | |
2845 | (symbol '2')) |
|
196 | (symbol '2')) | |
2846 | (symbol 'tip') |
|
197 | (symbol 'tip') | |
2847 | (symbol 'null'))) |
|
198 | (symbol 'null'))) | |
2848 | * optimized: |
|
199 | * optimized: | |
2849 | (func |
|
200 | (func | |
2850 | (symbol '_list') |
|
201 | (symbol '_list') | |
2851 |
(string '0\x001\x002 |
|
202 | (string '0\x001\x002\x00-2\x00tip\x00null')) | |
2852 | * set: |
|
203 | * set: | |
2853 | <baseset [0, 1, 2, 8, 9, -1]> |
|
204 | <baseset [0, 1, 2, 8, 9, -1]> | |
2854 | 0 |
|
205 | 0 | |
2855 | 1 |
|
206 | 1 | |
2856 | 2 |
|
207 | 2 | |
2857 | 8 |
|
208 | 8 | |
2858 | 9 |
|
209 | 9 | |
2859 | -1 |
|
210 | -1 | |
2860 |
|
211 | |||
2861 | $ try --optimize '0|1|2:3' |
|
212 | $ try --optimize '0|1|2:3' | |
2862 | (or |
|
213 | (or | |
2863 | (list |
|
214 | (list | |
2864 | (symbol '0') |
|
215 | (symbol '0') | |
2865 | (symbol '1') |
|
216 | (symbol '1') | |
2866 | (range |
|
217 | (range | |
2867 | (symbol '2') |
|
218 | (symbol '2') | |
2868 | (symbol '3')))) |
|
219 | (symbol '3')))) | |
2869 | * optimized: |
|
220 | * optimized: | |
2870 | (or |
|
221 | (or | |
2871 | (list |
|
222 | (list | |
2872 | (func |
|
223 | (func | |
2873 | (symbol '_list') |
|
224 | (symbol '_list') | |
2874 | (string '0\x001')) |
|
225 | (string '0\x001')) | |
2875 | (range |
|
226 | (range | |
2876 | (symbol '2') |
|
227 | (symbol '2') | |
2877 | (symbol '3')))) |
|
228 | (symbol '3')))) | |
2878 | * set: |
|
229 | * set: | |
2879 | <addset |
|
230 | <addset | |
2880 | <baseset [0, 1]>, |
|
231 | <baseset [0, 1]>, | |
2881 | <spanset+ 2:4>> |
|
232 | <spanset+ 2:4>> | |
2882 | 0 |
|
233 | 0 | |
2883 | 1 |
|
234 | 1 | |
2884 | 2 |
|
235 | 2 | |
2885 | 3 |
|
236 | 3 | |
2886 |
|
237 | |||
2887 | $ try --optimize '0:1|2|3:4|5|6' |
|
238 | $ try --optimize '0:1|2|3:4|5|6' | |
2888 | (or |
|
239 | (or | |
2889 | (list |
|
240 | (list | |
2890 | (range |
|
241 | (range | |
2891 | (symbol '0') |
|
242 | (symbol '0') | |
2892 | (symbol '1')) |
|
243 | (symbol '1')) | |
2893 | (symbol '2') |
|
244 | (symbol '2') | |
2894 | (range |
|
245 | (range | |
2895 | (symbol '3') |
|
246 | (symbol '3') | |
2896 | (symbol '4')) |
|
247 | (symbol '4')) | |
2897 | (symbol '5') |
|
248 | (symbol '5') | |
2898 | (symbol '6'))) |
|
249 | (symbol '6'))) | |
2899 | * optimized: |
|
250 | * optimized: | |
2900 | (or |
|
251 | (or | |
2901 | (list |
|
252 | (list | |
2902 | (range |
|
253 | (range | |
2903 | (symbol '0') |
|
254 | (symbol '0') | |
2904 | (symbol '1')) |
|
255 | (symbol '1')) | |
2905 | (symbol '2') |
|
256 | (symbol '2') | |
2906 | (range |
|
257 | (range | |
2907 | (symbol '3') |
|
258 | (symbol '3') | |
2908 | (symbol '4')) |
|
259 | (symbol '4')) | |
2909 | (func |
|
260 | (func | |
2910 | (symbol '_list') |
|
261 | (symbol '_list') | |
2911 | (string '5\x006')))) |
|
262 | (string '5\x006')))) | |
2912 | * set: |
|
263 | * set: | |
2913 | <addset |
|
264 | <addset | |
2914 | <addset |
|
265 | <addset | |
2915 | <spanset+ 0:2>, |
|
266 | <spanset+ 0:2>, | |
2916 | <baseset [2]>>, |
|
267 | <baseset [2]>>, | |
2917 | <addset |
|
268 | <addset | |
2918 | <spanset+ 3:5>, |
|
269 | <spanset+ 3:5>, | |
2919 | <baseset [5, 6]>>> |
|
270 | <baseset [5, 6]>>> | |
2920 | 0 |
|
271 | 0 | |
2921 | 1 |
|
272 | 1 | |
2922 | 2 |
|
273 | 2 | |
2923 | 3 |
|
274 | 3 | |
2924 | 4 |
|
275 | 4 | |
2925 | 5 |
|
276 | 5 | |
2926 | 6 |
|
277 | 6 | |
2927 |
|
278 | |||
2928 | unoptimized `or` looks like this |
|
279 | unoptimized `or` looks like this | |
2929 |
|
280 | |||
2930 | $ try --no-optimized -p analyzed '0|1|2|3|4' |
|
281 | $ try --no-optimized -p analyzed '0|1|2|3|4' | |
2931 | * analyzed: |
|
282 | * analyzed: | |
2932 | (or |
|
283 | (or | |
2933 | (list |
|
284 | (list | |
2934 | (symbol '0') |
|
285 | (symbol '0') | |
2935 | (symbol '1') |
|
286 | (symbol '1') | |
2936 | (symbol '2') |
|
287 | (symbol '2') | |
2937 | (symbol '3') |
|
288 | (symbol '3') | |
2938 | (symbol '4'))) |
|
289 | (symbol '4'))) | |
2939 | * set: |
|
290 | * set: | |
2940 | <addset |
|
291 | <addset | |
2941 | <addset |
|
292 | <addset | |
2942 | <baseset [0]>, |
|
293 | <baseset [0]>, | |
2943 | <baseset [1]>>, |
|
294 | <baseset [1]>>, | |
2944 | <addset |
|
295 | <addset | |
2945 | <baseset [2]>, |
|
296 | <baseset [2]>, | |
2946 | <addset |
|
297 | <addset | |
2947 | <baseset [3]>, |
|
298 | <baseset [3]>, | |
2948 | <baseset [4]>>>> |
|
299 | <baseset [4]>>>> | |
2949 | 0 |
|
300 | 0 | |
2950 | 1 |
|
301 | 1 | |
2951 | 2 |
|
302 | 2 | |
2952 | 3 |
|
303 | 3 | |
2953 | 4 |
|
304 | 4 | |
2954 |
|
305 | |||
2955 | test that `_list` should be narrowed by provided `subset` |
|
306 | test that `_list` should be narrowed by provided `subset` | |
2956 |
|
307 | |||
2957 | $ log '0:2 and (null|1|2|3)' |
|
308 | $ log '0:2 and (null|1|2|3)' | |
2958 | 1 |
|
309 | 1 | |
2959 | 2 |
|
310 | 2 | |
2960 |
|
311 | |||
2961 | test that `_list` should remove duplicates |
|
312 | test that `_list` should remove duplicates | |
2962 |
|
313 | |||
2963 | $ log '0|1|2|1|2|-1|tip' |
|
314 | $ log '0|1|2|1|2|-1|tip' | |
2964 | 0 |
|
315 | 0 | |
2965 | 1 |
|
316 | 1 | |
2966 | 2 |
|
317 | 2 | |
2967 | 9 |
|
318 | 9 | |
2968 |
|
319 | |||
2969 | test unknown revision in `_list` |
|
320 | test unknown revision in `_list` | |
2970 |
|
321 | |||
2971 | $ log '0|unknown' |
|
322 | $ log '0|unknown' | |
2972 | abort: unknown revision 'unknown'! |
|
323 | abort: unknown revision 'unknown'! | |
2973 | [255] |
|
324 | [255] | |
2974 |
|
325 | |||
2975 | test integer range in `_list` |
|
326 | test integer range in `_list` | |
2976 |
|
327 | |||
2977 | $ log '-1|-10' |
|
328 | $ log '-1|-10' | |
2978 | 9 |
|
329 | 9 | |
2979 | 0 |
|
330 | 0 | |
2980 |
|
331 | |||
2981 | $ log '-10|-11' |
|
332 | $ log '-10|-11' | |
2982 | abort: unknown revision '-11'! |
|
333 | abort: unknown revision '-11'! | |
2983 | [255] |
|
334 | [255] | |
2984 |
|
335 | |||
2985 | $ log '9|10' |
|
336 | $ log '9|10' | |
2986 | abort: unknown revision '10'! |
|
337 | abort: unknown revision '10'! | |
2987 | [255] |
|
338 | [255] | |
2988 |
|
339 | |||
2989 | test '0000' != '0' in `_list` |
|
340 | test '0000' != '0' in `_list` | |
2990 |
|
341 | |||
2991 | $ log '0|0000' |
|
342 | $ log '0|0000' | |
2992 | 0 |
|
343 | 0 | |
2993 | -1 |
|
344 | -1 | |
2994 |
|
345 | |||
2995 | test ',' in `_list` |
|
346 | test ',' in `_list` | |
2996 | $ log '0,1' |
|
347 | $ log '0,1' | |
2997 | hg: parse error: can't use a list in this context |
|
348 | hg: parse error: can't use a list in this context | |
2998 | (see hg help "revsets.x or y") |
|
349 | (see hg help "revsets.x or y") | |
2999 | [255] |
|
350 | [255] | |
3000 | $ try '0,1,2' |
|
351 | $ try '0,1,2' | |
3001 | (list |
|
352 | (list | |
3002 | (symbol '0') |
|
353 | (symbol '0') | |
3003 | (symbol '1') |
|
354 | (symbol '1') | |
3004 | (symbol '2')) |
|
355 | (symbol '2')) | |
3005 | hg: parse error: can't use a list in this context |
|
356 | hg: parse error: can't use a list in this context | |
3006 | (see hg help "revsets.x or y") |
|
357 | (see hg help "revsets.x or y") | |
3007 | [255] |
|
358 | [255] | |
3008 |
|
359 | |||
3009 | test that chained `or` operations make balanced addsets |
|
360 | test that chained `or` operations make balanced addsets | |
3010 |
|
361 | |||
3011 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
362 | $ try '0:1|1:2|2:3|3:4|4:5' | |
3012 | (or |
|
363 | (or | |
3013 | (list |
|
364 | (list | |
3014 | (range |
|
365 | (range | |
3015 | (symbol '0') |
|
366 | (symbol '0') | |
3016 | (symbol '1')) |
|
367 | (symbol '1')) | |
3017 | (range |
|
368 | (range | |
3018 | (symbol '1') |
|
369 | (symbol '1') | |
3019 | (symbol '2')) |
|
370 | (symbol '2')) | |
3020 | (range |
|
371 | (range | |
3021 | (symbol '2') |
|
372 | (symbol '2') | |
3022 | (symbol '3')) |
|
373 | (symbol '3')) | |
3023 | (range |
|
374 | (range | |
3024 | (symbol '3') |
|
375 | (symbol '3') | |
3025 | (symbol '4')) |
|
376 | (symbol '4')) | |
3026 | (range |
|
377 | (range | |
3027 | (symbol '4') |
|
378 | (symbol '4') | |
3028 | (symbol '5')))) |
|
379 | (symbol '5')))) | |
3029 | * set: |
|
380 | * set: | |
3030 | <addset |
|
381 | <addset | |
3031 | <addset |
|
382 | <addset | |
3032 | <spanset+ 0:2>, |
|
383 | <spanset+ 0:2>, | |
3033 | <spanset+ 1:3>>, |
|
384 | <spanset+ 1:3>>, | |
3034 | <addset |
|
385 | <addset | |
3035 | <spanset+ 2:4>, |
|
386 | <spanset+ 2:4>, | |
3036 | <addset |
|
387 | <addset | |
3037 | <spanset+ 3:5>, |
|
388 | <spanset+ 3:5>, | |
3038 | <spanset+ 4:6>>>> |
|
389 | <spanset+ 4:6>>>> | |
3039 | 0 |
|
390 | 0 | |
3040 | 1 |
|
391 | 1 | |
3041 | 2 |
|
392 | 2 | |
3042 | 3 |
|
393 | 3 | |
3043 | 4 |
|
394 | 4 | |
3044 | 5 |
|
395 | 5 | |
3045 |
|
396 | |||
3046 | no crash by empty group "()" while optimizing `or` operations |
|
397 | no crash by empty group "()" while optimizing `or` operations | |
3047 |
|
398 | |||
3048 | $ try --optimize '0|()' |
|
399 | $ try --optimize '0|()' | |
3049 | (or |
|
400 | (or | |
3050 | (list |
|
401 | (list | |
3051 | (symbol '0') |
|
402 | (symbol '0') | |
3052 | (group |
|
403 | (group | |
3053 | None))) |
|
404 | None))) | |
3054 | * optimized: |
|
405 | * optimized: | |
3055 | (or |
|
406 | (or | |
3056 | (list |
|
407 | (list | |
3057 | (symbol '0') |
|
408 | (symbol '0') | |
3058 | None)) |
|
409 | None)) | |
3059 | hg: parse error: missing argument |
|
410 | hg: parse error: missing argument | |
3060 | [255] |
|
411 | [255] | |
3061 |
|
412 | |||
3062 | test that chained `or` operations never eat up stack (issue4624) |
|
413 | test that chained `or` operations never eat up stack (issue4624) | |
3063 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) |
|
414 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) | |
3064 |
|
415 | |||
3065 | $ hg log -T '{rev}\n' -r `$PYTHON -c "print '+'.join(['0:1'] * 500)"` |
|
416 | $ hg log -T '{rev}\n' -r `$PYTHON -c "print '+'.join(['0:1'] * 500)"` | |
3066 | 0 |
|
417 | 0 | |
3067 | 1 |
|
418 | 1 | |
3068 |
|
419 | |||
3069 | test that repeated `-r` options never eat up stack (issue4565) |
|
420 | test that repeated `-r` options never eat up stack (issue4565) | |
3070 | (uses `-r 0::1` to avoid possible optimization at old-style parser) |
|
421 | (uses `-r 0::1` to avoid possible optimization at old-style parser) | |
3071 |
|
422 | |||
3072 |
$ hg log -T '{rev}\n' `$PYTHON -c "for |
|
423 | $ hg log -T '{rev}\n' `$PYTHON -c "for i in xrange(500): print '-r 0::1 ',"` | |
3073 | 0 |
|
424 | 0 | |
3074 | 1 |
|
425 | 1 | |
3075 |
|
426 | |||
3076 | check that conversion to only works |
|
427 | check that conversion to only works | |
3077 | $ try --optimize '::3 - ::1' |
|
428 | $ try --optimize '::3 - ::1' | |
3078 | (minus |
|
429 | (minus | |
3079 | (dagrangepre |
|
430 | (dagrangepre | |
3080 | (symbol '3')) |
|
431 | (symbol '3')) | |
3081 | (dagrangepre |
|
432 | (dagrangepre | |
3082 | (symbol '1'))) |
|
433 | (symbol '1'))) | |
3083 | * optimized: |
|
434 | * optimized: | |
3084 | (func |
|
435 | (func | |
3085 | (symbol 'only') |
|
436 | (symbol 'only') | |
3086 | (list |
|
437 | (list | |
3087 | (symbol '3') |
|
438 | (symbol '3') | |
3088 | (symbol '1'))) |
|
439 | (symbol '1'))) | |
3089 | * set: |
|
440 | * set: | |
3090 | <baseset+ [3]> |
|
441 | <baseset+ [3]> | |
3091 | 3 |
|
442 | 3 | |
3092 | $ try --optimize 'ancestors(1) - ancestors(3)' |
|
443 | $ try --optimize 'ancestors(1) - ancestors(3)' | |
3093 | (minus |
|
444 | (minus | |
3094 | (func |
|
445 | (func | |
3095 | (symbol 'ancestors') |
|
446 | (symbol 'ancestors') | |
3096 | (symbol '1')) |
|
447 | (symbol '1')) | |
3097 | (func |
|
448 | (func | |
3098 | (symbol 'ancestors') |
|
449 | (symbol 'ancestors') | |
3099 | (symbol '3'))) |
|
450 | (symbol '3'))) | |
3100 | * optimized: |
|
451 | * optimized: | |
3101 | (func |
|
452 | (func | |
3102 | (symbol 'only') |
|
453 | (symbol 'only') | |
3103 | (list |
|
454 | (list | |
3104 | (symbol '1') |
|
455 | (symbol '1') | |
3105 | (symbol '3'))) |
|
456 | (symbol '3'))) | |
3106 | * set: |
|
457 | * set: | |
3107 | <baseset+ []> |
|
458 | <baseset+ []> | |
3108 | $ try --optimize 'not ::2 and ::6' |
|
459 | $ try --optimize 'not ::2 and ::6' | |
3109 | (and |
|
460 | (and | |
3110 | (not |
|
461 | (not | |
3111 | (dagrangepre |
|
462 | (dagrangepre | |
3112 | (symbol '2'))) |
|
463 | (symbol '2'))) | |
3113 | (dagrangepre |
|
464 | (dagrangepre | |
3114 | (symbol '6'))) |
|
465 | (symbol '6'))) | |
3115 | * optimized: |
|
466 | * optimized: | |
3116 | (func |
|
467 | (func | |
3117 | (symbol 'only') |
|
468 | (symbol 'only') | |
3118 | (list |
|
469 | (list | |
3119 | (symbol '6') |
|
470 | (symbol '6') | |
3120 | (symbol '2'))) |
|
471 | (symbol '2'))) | |
3121 | * set: |
|
472 | * set: | |
3122 | <baseset+ [3, 4, 5, 6]> |
|
473 | <baseset+ [3, 4, 5, 6]> | |
3123 | 3 |
|
474 | 3 | |
3124 | 4 |
|
475 | 4 | |
3125 | 5 |
|
476 | 5 | |
3126 | 6 |
|
477 | 6 | |
3127 | $ try --optimize 'ancestors(6) and not ancestors(4)' |
|
478 | $ try --optimize 'ancestors(6) and not ancestors(4)' | |
3128 | (and |
|
479 | (and | |
3129 | (func |
|
480 | (func | |
3130 | (symbol 'ancestors') |
|
481 | (symbol 'ancestors') | |
3131 | (symbol '6')) |
|
482 | (symbol '6')) | |
3132 | (not |
|
483 | (not | |
3133 | (func |
|
484 | (func | |
3134 | (symbol 'ancestors') |
|
485 | (symbol 'ancestors') | |
3135 | (symbol '4')))) |
|
486 | (symbol '4')))) | |
3136 | * optimized: |
|
487 | * optimized: | |
3137 | (func |
|
488 | (func | |
3138 | (symbol 'only') |
|
489 | (symbol 'only') | |
3139 | (list |
|
490 | (list | |
3140 | (symbol '6') |
|
491 | (symbol '6') | |
3141 | (symbol '4'))) |
|
492 | (symbol '4'))) | |
3142 | * set: |
|
493 | * set: | |
3143 | <baseset+ [3, 5, 6]> |
|
494 | <baseset+ [3, 5, 6]> | |
3144 | 3 |
|
495 | 3 | |
3145 | 5 |
|
496 | 5 | |
3146 | 6 |
|
497 | 6 | |
3147 |
|
498 | |||
3148 | no crash by empty group "()" while optimizing to "only()" |
|
499 | no crash by empty group "()" while optimizing to "only()" | |
3149 |
|
500 | |||
3150 | $ try --optimize '::1 and ()' |
|
501 | $ try --optimize '::1 and ()' | |
3151 | (and |
|
502 | (and | |
3152 | (dagrangepre |
|
503 | (dagrangepre | |
3153 | (symbol '1')) |
|
504 | (symbol '1')) | |
3154 | (group |
|
505 | (group | |
3155 | None)) |
|
506 | None)) | |
3156 | * optimized: |
|
507 | * optimized: | |
3157 | (andsmally |
|
508 | (andsmally | |
3158 | (func |
|
509 | (func | |
3159 | (symbol 'ancestors') |
|
510 | (symbol 'ancestors') | |
3160 | (symbol '1')) |
|
511 | (symbol '1')) | |
3161 | None) |
|
512 | None) | |
3162 | hg: parse error: missing argument |
|
513 | hg: parse error: missing argument | |
3163 | [255] |
|
514 | [255] | |
3164 |
|
515 | |||
3165 | optimization to only() works only if ancestors() takes only one argument |
|
516 | optimization to only() works only if ancestors() takes only one argument | |
3166 |
|
517 | |||
3167 | $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' |
|
518 | $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' | |
3168 | * optimized: |
|
519 | * optimized: | |
3169 | (difference |
|
520 | (difference | |
3170 | (func |
|
521 | (func | |
3171 | (symbol 'ancestors') |
|
522 | (symbol 'ancestors') | |
3172 | (symbol '6')) |
|
523 | (symbol '6')) | |
3173 | (func |
|
524 | (func | |
3174 | (symbol 'ancestors') |
|
525 | (symbol 'ancestors') | |
3175 | (list |
|
526 | (list | |
3176 | (symbol '4') |
|
527 | (symbol '4') | |
3177 | (symbol '1')))) |
|
528 | (symbol '1')))) | |
3178 | 0 |
|
529 | 0 | |
3179 | 1 |
|
530 | 1 | |
3180 | 3 |
|
531 | 3 | |
3181 | 5 |
|
532 | 5 | |
3182 | 6 |
|
533 | 6 | |
3183 | $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' |
|
534 | $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' | |
3184 | * optimized: |
|
535 | * optimized: | |
3185 | (difference |
|
536 | (difference | |
3186 | (func |
|
537 | (func | |
3187 | (symbol 'ancestors') |
|
538 | (symbol 'ancestors') | |
3188 | (list |
|
539 | (list | |
3189 | (symbol '6') |
|
540 | (symbol '6') | |
3190 | (symbol '1'))) |
|
541 | (symbol '1'))) | |
3191 | (func |
|
542 | (func | |
3192 | (symbol 'ancestors') |
|
543 | (symbol 'ancestors') | |
3193 | (symbol '4'))) |
|
544 | (symbol '4'))) | |
3194 | 5 |
|
545 | 5 | |
3195 | 6 |
|
546 | 6 | |
3196 |
|
547 | |||
3197 | optimization disabled if keyword arguments passed (because we're too lazy |
|
548 | optimization disabled if keyword arguments passed (because we're too lazy | |
3198 | to support it) |
|
549 | to support it) | |
3199 |
|
550 | |||
3200 | $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' |
|
551 | $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' | |
3201 | * optimized: |
|
552 | * optimized: | |
3202 | (difference |
|
553 | (difference | |
3203 | (func |
|
554 | (func | |
3204 | (symbol 'ancestors') |
|
555 | (symbol 'ancestors') | |
3205 | (keyvalue |
|
556 | (keyvalue | |
3206 | (symbol 'set') |
|
557 | (symbol 'set') | |
3207 | (symbol '6'))) |
|
558 | (symbol '6'))) | |
3208 | (func |
|
559 | (func | |
3209 | (symbol 'ancestors') |
|
560 | (symbol 'ancestors') | |
3210 | (keyvalue |
|
561 | (keyvalue | |
3211 | (symbol 'set') |
|
562 | (symbol 'set') | |
3212 | (symbol '4')))) |
|
563 | (symbol '4')))) | |
3213 | 3 |
|
564 | 3 | |
3214 | 5 |
|
565 | 5 | |
3215 | 6 |
|
566 | 6 | |
3216 |
|
567 | |||
3217 | invalid function call should not be optimized to only() |
|
568 | invalid function call should not be optimized to only() | |
3218 |
|
569 | |||
3219 | $ log '"ancestors"(6) and not ancestors(4)' |
|
570 | $ log '"ancestors"(6) and not ancestors(4)' | |
3220 | hg: parse error: not a symbol |
|
571 | hg: parse error: not a symbol | |
3221 | [255] |
|
572 | [255] | |
3222 |
|
573 | |||
3223 | $ log 'ancestors(6) and not "ancestors"(4)' |
|
574 | $ log 'ancestors(6) and not "ancestors"(4)' | |
3224 | hg: parse error: not a symbol |
|
575 | hg: parse error: not a symbol | |
3225 | [255] |
|
576 | [255] | |
3226 |
|
577 | |||
3227 | we can use patterns when searching for tags |
|
578 | we can use patterns when searching for tags | |
3228 |
|
579 | |||
3229 | $ log 'tag("1..*")' |
|
580 | $ log 'tag("1..*")' | |
3230 | abort: tag '1..*' does not exist! |
|
581 | abort: tag '1..*' does not exist! | |
3231 | [255] |
|
582 | [255] | |
3232 | $ log 'tag("re:1..*")' |
|
583 | $ log 'tag("re:1..*")' | |
3233 | 6 |
|
584 | 6 | |
3234 | $ log 'tag("re:[0-9].[0-9]")' |
|
585 | $ log 'tag("re:[0-9].[0-9]")' | |
3235 | 6 |
|
586 | 6 | |
3236 | $ log 'tag("literal:1.0")' |
|
587 | $ log 'tag("literal:1.0")' | |
3237 | 6 |
|
588 | 6 | |
3238 | $ log 'tag("re:0..*")' |
|
589 | $ log 'tag("re:0..*")' | |
3239 |
|
590 | |||
3240 | $ log 'tag(unknown)' |
|
591 | $ log 'tag(unknown)' | |
3241 | abort: tag 'unknown' does not exist! |
|
592 | abort: tag 'unknown' does not exist! | |
3242 | [255] |
|
593 | [255] | |
3243 | $ log 'tag("re:unknown")' |
|
594 | $ log 'tag("re:unknown")' | |
3244 | $ log 'present(tag("unknown"))' |
|
595 | $ log 'present(tag("unknown"))' | |
3245 | $ log 'present(tag("re:unknown"))' |
|
596 | $ log 'present(tag("re:unknown"))' | |
3246 | $ log 'branch(unknown)' |
|
597 | $ log 'branch(unknown)' | |
3247 | abort: unknown revision 'unknown'! |
|
598 | abort: unknown revision 'unknown'! | |
3248 | [255] |
|
599 | [255] | |
3249 | $ log 'branch("literal:unknown")' |
|
600 | $ log 'branch("literal:unknown")' | |
3250 | abort: branch 'unknown' does not exist! |
|
601 | abort: branch 'unknown' does not exist! | |
3251 | [255] |
|
602 | [255] | |
3252 | $ log 'branch("re:unknown")' |
|
603 | $ log 'branch("re:unknown")' | |
3253 | $ log 'present(branch("unknown"))' |
|
604 | $ log 'present(branch("unknown"))' | |
3254 | $ log 'present(branch("re:unknown"))' |
|
605 | $ log 'present(branch("re:unknown"))' | |
3255 | $ log 'user(bob)' |
|
606 | $ log 'user(bob)' | |
3256 | 2 |
|
607 | 2 | |
3257 |
|
608 | |||
3258 | $ log '4::8' |
|
609 | $ log '4::8' | |
3259 | 4 |
|
610 | 4 | |
3260 | 8 |
|
611 | 8 | |
3261 | $ log '4:8' |
|
612 | $ log '4:8' | |
3262 | 4 |
|
613 | 4 | |
3263 | 5 |
|
614 | 5 | |
3264 | 6 |
|
615 | 6 | |
3265 | 7 |
|
616 | 7 | |
3266 | 8 |
|
617 | 8 | |
3267 |
|
618 | |||
3268 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' |
|
619 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' | |
3269 | 4 |
|
620 | 4 | |
3270 | 2 |
|
621 | 2 | |
3271 | 5 |
|
622 | 5 | |
3272 |
|
623 | |||
3273 | $ log 'not 0 and 0:2' |
|
624 | $ log 'not 0 and 0:2' | |
3274 | 1 |
|
625 | 1 | |
3275 | 2 |
|
626 | 2 | |
3276 | $ log 'not 1 and 0:2' |
|
627 | $ log 'not 1 and 0:2' | |
3277 | 0 |
|
628 | 0 | |
3278 | 2 |
|
629 | 2 | |
3279 | $ log 'not 2 and 0:2' |
|
630 | $ log 'not 2 and 0:2' | |
3280 | 0 |
|
631 | 0 | |
3281 | 1 |
|
632 | 1 | |
3282 | $ log '(1 and 2)::' |
|
633 | $ log '(1 and 2)::' | |
3283 | $ log '(1 and 2):' |
|
634 | $ log '(1 and 2):' | |
3284 | $ log '(1 and 2):3' |
|
635 | $ log '(1 and 2):3' | |
3285 | $ log 'sort(head(), -rev)' |
|
636 | $ log 'sort(head(), -rev)' | |
3286 | 9 |
|
637 | 9 | |
3287 | 7 |
|
638 | 7 | |
3288 | 6 |
|
639 | 6 | |
3289 | 5 |
|
640 | 5 | |
3290 | 4 |
|
641 | 4 | |
3291 | 3 |
|
642 | 3 | |
3292 | 2 |
|
643 | 2 | |
3293 | 1 |
|
644 | 1 | |
3294 | 0 |
|
645 | 0 | |
3295 | $ log '4::8 - 8' |
|
646 | $ log '4::8 - 8' | |
3296 | 4 |
|
647 | 4 | |
3297 |
|
648 | |||
3298 | matching() should preserve the order of the input set: |
|
649 | matching() should preserve the order of the input set: | |
3299 |
|
650 | |||
3300 | $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' |
|
651 | $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' | |
3301 | 2 |
|
652 | 2 | |
3302 | 3 |
|
653 | 3 | |
3303 | 1 |
|
654 | 1 | |
3304 |
|
655 | |||
3305 | $ log 'named("unknown")' |
|
656 | $ log 'named("unknown")' | |
3306 | abort: namespace 'unknown' does not exist! |
|
657 | abort: namespace 'unknown' does not exist! | |
3307 | [255] |
|
658 | [255] | |
3308 | $ log 'named("re:unknown")' |
|
659 | $ log 'named("re:unknown")' | |
3309 | abort: no namespace exists that match 'unknown'! |
|
660 | abort: no namespace exists that match 'unknown'! | |
3310 | [255] |
|
661 | [255] | |
3311 | $ log 'present(named("unknown"))' |
|
662 | $ log 'present(named("unknown"))' | |
3312 | $ log 'present(named("re:unknown"))' |
|
663 | $ log 'present(named("re:unknown"))' | |
3313 |
|
664 | |||
3314 | $ log 'tag()' |
|
665 | $ log 'tag()' | |
3315 | 6 |
|
666 | 6 | |
3316 | $ log 'named("tags")' |
|
667 | $ log 'named("tags")' | |
3317 | 6 |
|
668 | 6 | |
3318 |
|
669 | |||
3319 | issue2437 |
|
670 | issue2437 | |
3320 |
|
671 | |||
3321 | $ log '3 and p1(5)' |
|
672 | $ log '3 and p1(5)' | |
3322 | 3 |
|
673 | 3 | |
3323 | $ log '4 and p2(6)' |
|
674 | $ log '4 and p2(6)' | |
3324 | 4 |
|
675 | 4 | |
3325 | $ log '1 and parents(:2)' |
|
676 | $ log '1 and parents(:2)' | |
3326 | 1 |
|
677 | 1 | |
3327 | $ log '2 and children(1:)' |
|
678 | $ log '2 and children(1:)' | |
3328 | 2 |
|
679 | 2 | |
3329 | $ log 'roots(all()) or roots(all())' |
|
680 | $ log 'roots(all()) or roots(all())' | |
3330 | 0 |
|
681 | 0 | |
3331 | $ hg debugrevspec 'roots(all()) or roots(all())' |
|
682 | $ hg debugrevspec 'roots(all()) or roots(all())' | |
3332 | 0 |
|
683 | 0 | |
3333 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' |
|
684 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' | |
3334 | 9 |
|
685 | 9 | |
3335 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' |
|
686 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' | |
3336 | 4 |
|
687 | 4 | |
3337 |
|
688 | |||
3338 | issue2654: report a parse error if the revset was not completely parsed |
|
689 | issue2654: report a parse error if the revset was not completely parsed | |
3339 |
|
690 | |||
3340 | $ log '1 OR 2' |
|
691 | $ log '1 OR 2' | |
3341 | hg: parse error at 2: invalid token |
|
692 | hg: parse error at 2: invalid token | |
3342 | [255] |
|
693 | [255] | |
3343 |
|
694 | |||
3344 | or operator should preserve ordering: |
|
695 | or operator should preserve ordering: | |
3345 | $ log 'reverse(2::4) or tip' |
|
696 | $ log 'reverse(2::4) or tip' | |
3346 | 4 |
|
697 | 4 | |
3347 | 2 |
|
698 | 2 | |
3348 | 9 |
|
699 | 9 | |
3349 |
|
700 | |||
3350 | parentrevspec |
|
701 | parentrevspec | |
3351 |
|
702 | |||
3352 | $ log 'merge()^0' |
|
703 | $ log 'merge()^0' | |
3353 | 6 |
|
704 | 6 | |
3354 | $ log 'merge()^' |
|
705 | $ log 'merge()^' | |
3355 | 5 |
|
706 | 5 | |
3356 | $ log 'merge()^1' |
|
707 | $ log 'merge()^1' | |
3357 | 5 |
|
708 | 5 | |
3358 | $ log 'merge()^2' |
|
709 | $ log 'merge()^2' | |
3359 | 4 |
|
710 | 4 | |
3360 | $ log '(not merge())^2' |
|
711 | $ log '(not merge())^2' | |
3361 | $ log 'merge()^^' |
|
712 | $ log 'merge()^^' | |
3362 | 3 |
|
713 | 3 | |
3363 | $ log 'merge()^1^' |
|
714 | $ log 'merge()^1^' | |
3364 | 3 |
|
715 | 3 | |
3365 | $ log 'merge()^^^' |
|
716 | $ log 'merge()^^^' | |
3366 | 1 |
|
717 | 1 | |
3367 |
|
718 | |||
3368 | $ hg debugrevspec -s '(merge() | 0)~-1' |
|
719 | $ hg debugrevspec -s '(merge() | 0)~-1' | |
3369 | * set: |
|
720 | * set: | |
3370 | <baseset+ [1, 7]> |
|
721 | <baseset+ [1, 7]> | |
3371 | 1 |
|
722 | 1 | |
3372 | 7 |
|
723 | 7 | |
3373 | $ log 'merge()~-1' |
|
724 | $ log 'merge()~-1' | |
3374 | 7 |
|
725 | 7 | |
3375 | $ log 'tip~-1' |
|
726 | $ log 'tip~-1' | |
3376 | $ log '(tip | merge())~-1' |
|
727 | $ log '(tip | merge())~-1' | |
3377 | 7 |
|
728 | 7 | |
3378 | $ log 'merge()~0' |
|
729 | $ log 'merge()~0' | |
3379 | 6 |
|
730 | 6 | |
3380 | $ log 'merge()~1' |
|
731 | $ log 'merge()~1' | |
3381 | 5 |
|
732 | 5 | |
3382 | $ log 'merge()~2' |
|
733 | $ log 'merge()~2' | |
3383 | 3 |
|
734 | 3 | |
3384 | $ log 'merge()~2^1' |
|
735 | $ log 'merge()~2^1' | |
3385 | 1 |
|
736 | 1 | |
3386 | $ log 'merge()~3' |
|
737 | $ log 'merge()~3' | |
3387 | 1 |
|
738 | 1 | |
3388 |
|
739 | |||
3389 | $ log '(-3:tip)^' |
|
740 | $ log '(-3:tip)^' | |
3390 | 4 |
|
741 | 4 | |
3391 | 6 |
|
742 | 6 | |
3392 | 8 |
|
743 | 8 | |
3393 |
|
744 | |||
3394 | $ log 'tip^foo' |
|
745 | $ log 'tip^foo' | |
3395 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
746 | hg: parse error: ^ expects a number 0, 1, or 2 | |
3396 | [255] |
|
747 | [255] | |
3397 |
|
748 | |||
3398 | $ log 'branchpoint()~-1' |
|
749 | $ log 'branchpoint()~-1' | |
3399 | abort: revision in set has more than one child! |
|
750 | abort: revision in set has more than one child! | |
3400 | [255] |
|
751 | [255] | |
3401 |
|
752 | |||
3402 | Bogus function gets suggestions |
|
753 | Bogus function gets suggestions | |
3403 | $ log 'add()' |
|
754 | $ log 'add()' | |
3404 | hg: parse error: unknown identifier: add |
|
755 | hg: parse error: unknown identifier: add | |
3405 | (did you mean adds?) |
|
756 | (did you mean adds?) | |
3406 | [255] |
|
757 | [255] | |
3407 | $ log 'added()' |
|
758 | $ log 'added()' | |
3408 | hg: parse error: unknown identifier: added |
|
759 | hg: parse error: unknown identifier: added | |
3409 | (did you mean adds?) |
|
760 | (did you mean adds?) | |
3410 | [255] |
|
761 | [255] | |
3411 | $ log 'remo()' |
|
762 | $ log 'remo()' | |
3412 | hg: parse error: unknown identifier: remo |
|
763 | hg: parse error: unknown identifier: remo | |
3413 | (did you mean one of remote, removes?) |
|
764 | (did you mean one of remote, removes?) | |
3414 | [255] |
|
765 | [255] | |
3415 | $ log 'babar()' |
|
766 | $ log 'babar()' | |
3416 | hg: parse error: unknown identifier: babar |
|
767 | hg: parse error: unknown identifier: babar | |
3417 | [255] |
|
768 | [255] | |
3418 |
|
769 | |||
3419 | Bogus function with a similar internal name doesn't suggest the internal name |
|
770 | Bogus function with a similar internal name doesn't suggest the internal name | |
3420 | $ log 'matches()' |
|
771 | $ log 'matches()' | |
3421 | hg: parse error: unknown identifier: matches |
|
772 | hg: parse error: unknown identifier: matches | |
3422 | (did you mean matching?) |
|
773 | (did you mean matching?) | |
3423 | [255] |
|
774 | [255] | |
3424 |
|
775 | |||
3425 | Undocumented functions aren't suggested as similar either |
|
776 | Undocumented functions aren't suggested as similar either | |
3426 | $ log 'tagged2()' |
|
777 | $ log 'tagged2()' | |
3427 | hg: parse error: unknown identifier: tagged2 |
|
778 | hg: parse error: unknown identifier: tagged2 | |
3428 | [255] |
|
779 | [255] | |
3429 |
|
780 | |||
3430 | multiple revspecs |
|
781 | multiple revspecs | |
3431 |
|
782 | |||
3432 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' |
|
783 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' | |
3433 | 8 |
|
784 | 8 | |
3434 | 9 |
|
785 | 9 | |
3435 | 4 |
|
786 | 4 | |
3436 | 5 |
|
787 | 5 | |
3437 | 6 |
|
788 | 6 | |
3438 | 7 |
|
789 | 7 | |
3439 |
|
790 | |||
3440 | test usage in revpair (with "+") |
|
791 | test usage in revpair (with "+") | |
3441 |
|
792 | |||
3442 | (real pair) |
|
793 | (real pair) | |
3443 |
|
794 | |||
3444 | $ hg diff -r 'tip^^' -r 'tip' |
|
795 | $ hg diff -r 'tip^^' -r 'tip' | |
3445 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
796 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
3446 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
797 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
3447 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
798 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
3448 | @@ -0,0 +1,1 @@ |
|
799 | @@ -0,0 +1,1 @@ | |
3449 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
800 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
3450 | $ hg diff -r 'tip^^::tip' |
|
801 | $ hg diff -r 'tip^^::tip' | |
3451 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
802 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
3452 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
803 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
3453 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
804 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
3454 | @@ -0,0 +1,1 @@ |
|
805 | @@ -0,0 +1,1 @@ | |
3455 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
806 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
3456 |
|
807 | |||
3457 | (single rev) |
|
808 | (single rev) | |
3458 |
|
809 | |||
3459 | $ hg diff -r 'tip^' -r 'tip^' |
|
810 | $ hg diff -r 'tip^' -r 'tip^' | |
3460 | $ hg diff -r 'tip^:tip^' |
|
811 | $ hg diff -r 'tip^:tip^' | |
3461 |
|
812 | |||
3462 | (single rev that does not looks like a range) |
|
813 | (single rev that does not looks like a range) | |
3463 |
|
814 | |||
3464 | $ hg diff -r 'tip^::tip^ or tip^' |
|
815 | $ hg diff -r 'tip^::tip^ or tip^' | |
3465 | diff -r d5d0dcbdc4d9 .hgtags |
|
816 | diff -r d5d0dcbdc4d9 .hgtags | |
3466 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
817 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
3467 | +++ b/.hgtags * (glob) |
|
818 | +++ b/.hgtags * (glob) | |
3468 | @@ -0,0 +1,1 @@ |
|
819 | @@ -0,0 +1,1 @@ | |
3469 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
820 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
3470 | $ hg diff -r 'tip^ or tip^' |
|
821 | $ hg diff -r 'tip^ or tip^' | |
3471 | diff -r d5d0dcbdc4d9 .hgtags |
|
822 | diff -r d5d0dcbdc4d9 .hgtags | |
3472 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
823 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
3473 | +++ b/.hgtags * (glob) |
|
824 | +++ b/.hgtags * (glob) | |
3474 | @@ -0,0 +1,1 @@ |
|
825 | @@ -0,0 +1,1 @@ | |
3475 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
826 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
3476 |
|
827 | |||
3477 | (no rev) |
|
828 | (no rev) | |
3478 |
|
829 | |||
3479 | $ hg diff -r 'author("babar") or author("celeste")' |
|
830 | $ hg diff -r 'author("babar") or author("celeste")' | |
3480 | abort: empty revision range |
|
831 | abort: empty revision range | |
3481 | [255] |
|
832 | [255] | |
3482 |
|
833 | |||
3483 | aliases: |
|
834 | aliases: | |
3484 |
|
835 | |||
3485 | $ echo '[revsetalias]' >> .hg/hgrc |
|
836 | $ echo '[revsetalias]' >> .hg/hgrc | |
3486 | $ echo 'm = merge()' >> .hg/hgrc |
|
837 | $ echo 'm = merge()' >> .hg/hgrc | |
3487 | (revset aliases can override builtin revsets) |
|
838 | (revset aliases can override builtin revsets) | |
3488 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc |
|
839 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc | |
3489 | $ echo 'sincem = descendants(m)' >> .hg/hgrc |
|
840 | $ echo 'sincem = descendants(m)' >> .hg/hgrc | |
3490 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc |
|
841 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc | |
3491 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
842 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
3492 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
843 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
3493 |
|
844 | |||
3494 | $ try m |
|
845 | $ try m | |
3495 | (symbol 'm') |
|
846 | (symbol 'm') | |
3496 | * expanded: |
|
847 | * expanded: | |
3497 | (func |
|
848 | (func | |
3498 | (symbol 'merge') |
|
849 | (symbol 'merge') | |
3499 | None) |
|
850 | None) | |
3500 | * set: |
|
851 | * set: | |
3501 | <filteredset |
|
852 | <filteredset | |
3502 | <fullreposet+ 0:10>, |
|
853 | <fullreposet+ 0:10>, | |
3503 | <merge>> |
|
854 | <merge>> | |
3504 | 6 |
|
855 | 6 | |
3505 |
|
856 | |||
3506 | $ HGPLAIN=1 |
|
857 | $ HGPLAIN=1 | |
3507 | $ export HGPLAIN |
|
858 | $ export HGPLAIN | |
3508 | $ try m |
|
859 | $ try m | |
3509 | (symbol 'm') |
|
860 | (symbol 'm') | |
3510 | abort: unknown revision 'm'! |
|
861 | abort: unknown revision 'm'! | |
3511 | [255] |
|
862 | [255] | |
3512 |
|
863 | |||
3513 | $ HGPLAINEXCEPT=revsetalias |
|
864 | $ HGPLAINEXCEPT=revsetalias | |
3514 | $ export HGPLAINEXCEPT |
|
865 | $ export HGPLAINEXCEPT | |
3515 | $ try m |
|
866 | $ try m | |
3516 | (symbol 'm') |
|
867 | (symbol 'm') | |
3517 | * expanded: |
|
868 | * expanded: | |
3518 | (func |
|
869 | (func | |
3519 | (symbol 'merge') |
|
870 | (symbol 'merge') | |
3520 | None) |
|
871 | None) | |
3521 | * set: |
|
872 | * set: | |
3522 | <filteredset |
|
873 | <filteredset | |
3523 | <fullreposet+ 0:10>, |
|
874 | <fullreposet+ 0:10>, | |
3524 | <merge>> |
|
875 | <merge>> | |
3525 | 6 |
|
876 | 6 | |
3526 |
|
877 | |||
3527 | $ unset HGPLAIN |
|
878 | $ unset HGPLAIN | |
3528 | $ unset HGPLAINEXCEPT |
|
879 | $ unset HGPLAINEXCEPT | |
3529 |
|
880 | |||
3530 | $ try 'p2(.)' |
|
881 | $ try 'p2(.)' | |
3531 | (func |
|
882 | (func | |
3532 | (symbol 'p2') |
|
883 | (symbol 'p2') | |
3533 | (symbol '.')) |
|
884 | (symbol '.')) | |
3534 | * expanded: |
|
885 | * expanded: | |
3535 | (func |
|
886 | (func | |
3536 | (symbol 'p1') |
|
887 | (symbol 'p1') | |
3537 | (symbol '.')) |
|
888 | (symbol '.')) | |
3538 | * set: |
|
889 | * set: | |
3539 | <baseset+ [8]> |
|
890 | <baseset+ [8]> | |
3540 | 8 |
|
891 | 8 | |
3541 |
|
892 | |||
3542 | $ HGPLAIN=1 |
|
893 | $ HGPLAIN=1 | |
3543 | $ export HGPLAIN |
|
894 | $ export HGPLAIN | |
3544 | $ try 'p2(.)' |
|
895 | $ try 'p2(.)' | |
3545 | (func |
|
896 | (func | |
3546 | (symbol 'p2') |
|
897 | (symbol 'p2') | |
3547 | (symbol '.')) |
|
898 | (symbol '.')) | |
3548 | * set: |
|
899 | * set: | |
3549 | <baseset+ []> |
|
900 | <baseset+ []> | |
3550 |
|
901 | |||
3551 | $ HGPLAINEXCEPT=revsetalias |
|
902 | $ HGPLAINEXCEPT=revsetalias | |
3552 | $ export HGPLAINEXCEPT |
|
903 | $ export HGPLAINEXCEPT | |
3553 | $ try 'p2(.)' |
|
904 | $ try 'p2(.)' | |
3554 | (func |
|
905 | (func | |
3555 | (symbol 'p2') |
|
906 | (symbol 'p2') | |
3556 | (symbol '.')) |
|
907 | (symbol '.')) | |
3557 | * expanded: |
|
908 | * expanded: | |
3558 | (func |
|
909 | (func | |
3559 | (symbol 'p1') |
|
910 | (symbol 'p1') | |
3560 | (symbol '.')) |
|
911 | (symbol '.')) | |
3561 | * set: |
|
912 | * set: | |
3562 | <baseset+ [8]> |
|
913 | <baseset+ [8]> | |
3563 | 8 |
|
914 | 8 | |
3564 |
|
915 | |||
3565 | $ unset HGPLAIN |
|
916 | $ unset HGPLAIN | |
3566 | $ unset HGPLAINEXCEPT |
|
917 | $ unset HGPLAINEXCEPT | |
3567 |
|
918 | |||
3568 | test alias recursion |
|
919 | test alias recursion | |
3569 |
|
920 | |||
3570 | $ try sincem |
|
921 | $ try sincem | |
3571 | (symbol 'sincem') |
|
922 | (symbol 'sincem') | |
3572 | * expanded: |
|
923 | * expanded: | |
3573 | (func |
|
924 | (func | |
3574 | (symbol 'descendants') |
|
925 | (symbol 'descendants') | |
3575 | (func |
|
926 | (func | |
3576 | (symbol 'merge') |
|
927 | (symbol 'merge') | |
3577 | None)) |
|
928 | None)) | |
3578 | * set: |
|
929 | * set: | |
3579 | <generatorset+> |
|
930 | <generatorset+> | |
3580 | 6 |
|
931 | 6 | |
3581 | 7 |
|
932 | 7 | |
3582 |
|
933 | |||
3583 | test infinite recursion |
|
934 | test infinite recursion | |
3584 |
|
935 | |||
3585 | $ echo 'recurse1 = recurse2' >> .hg/hgrc |
|
936 | $ echo 'recurse1 = recurse2' >> .hg/hgrc | |
3586 | $ echo 'recurse2 = recurse1' >> .hg/hgrc |
|
937 | $ echo 'recurse2 = recurse1' >> .hg/hgrc | |
3587 | $ try recurse1 |
|
938 | $ try recurse1 | |
3588 | (symbol 'recurse1') |
|
939 | (symbol 'recurse1') | |
3589 | hg: parse error: infinite expansion of revset alias "recurse1" detected |
|
940 | hg: parse error: infinite expansion of revset alias "recurse1" detected | |
3590 | [255] |
|
941 | [255] | |
3591 |
|
942 | |||
3592 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc |
|
943 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc | |
3593 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc |
|
944 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc | |
3594 | $ try "level2(level1(1, 2), 3)" |
|
945 | $ try "level2(level1(1, 2), 3)" | |
3595 | (func |
|
946 | (func | |
3596 | (symbol 'level2') |
|
947 | (symbol 'level2') | |
3597 | (list |
|
948 | (list | |
3598 | (func |
|
949 | (func | |
3599 | (symbol 'level1') |
|
950 | (symbol 'level1') | |
3600 | (list |
|
951 | (list | |
3601 | (symbol '1') |
|
952 | (symbol '1') | |
3602 | (symbol '2'))) |
|
953 | (symbol '2'))) | |
3603 | (symbol '3'))) |
|
954 | (symbol '3'))) | |
3604 | * expanded: |
|
955 | * expanded: | |
3605 | (or |
|
956 | (or | |
3606 | (list |
|
957 | (list | |
3607 | (symbol '3') |
|
958 | (symbol '3') | |
3608 | (or |
|
959 | (or | |
3609 | (list |
|
960 | (list | |
3610 | (symbol '1') |
|
961 | (symbol '1') | |
3611 | (symbol '2'))))) |
|
962 | (symbol '2'))))) | |
3612 | * set: |
|
963 | * set: | |
3613 | <addset |
|
964 | <addset | |
3614 | <baseset [3]>, |
|
965 | <baseset [3]>, | |
3615 | <baseset [1, 2]>> |
|
966 | <baseset [1, 2]>> | |
3616 | 3 |
|
967 | 3 | |
3617 | 1 |
|
968 | 1 | |
3618 | 2 |
|
969 | 2 | |
3619 |
|
970 | |||
3620 | test nesting and variable passing |
|
971 | test nesting and variable passing | |
3621 |
|
972 | |||
3622 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc |
|
973 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc | |
3623 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc |
|
974 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc | |
3624 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc |
|
975 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc | |
3625 | $ try 'nested(2:5)' |
|
976 | $ try 'nested(2:5)' | |
3626 | (func |
|
977 | (func | |
3627 | (symbol 'nested') |
|
978 | (symbol 'nested') | |
3628 | (range |
|
979 | (range | |
3629 | (symbol '2') |
|
980 | (symbol '2') | |
3630 | (symbol '5'))) |
|
981 | (symbol '5'))) | |
3631 | * expanded: |
|
982 | * expanded: | |
3632 | (func |
|
983 | (func | |
3633 | (symbol 'max') |
|
984 | (symbol 'max') | |
3634 | (range |
|
985 | (range | |
3635 | (symbol '2') |
|
986 | (symbol '2') | |
3636 | (symbol '5'))) |
|
987 | (symbol '5'))) | |
3637 | * set: |
|
988 | * set: | |
3638 | <baseset |
|
989 | <baseset | |
3639 | <max |
|
990 | <max | |
3640 | <fullreposet+ 0:10>, |
|
991 | <fullreposet+ 0:10>, | |
3641 | <spanset+ 2:6>>> |
|
992 | <spanset+ 2:6>>> | |
3642 | 5 |
|
993 | 5 | |
3643 |
|
994 | |||
3644 | test chained `or` operations are flattened at parsing phase |
|
995 | test chained `or` operations are flattened at parsing phase | |
3645 |
|
996 | |||
3646 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc |
|
997 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc | |
3647 | $ try 'chainedorops(0:1, 1:2, 2:3)' |
|
998 | $ try 'chainedorops(0:1, 1:2, 2:3)' | |
3648 | (func |
|
999 | (func | |
3649 | (symbol 'chainedorops') |
|
1000 | (symbol 'chainedorops') | |
3650 | (list |
|
1001 | (list | |
3651 | (range |
|
1002 | (range | |
3652 | (symbol '0') |
|
1003 | (symbol '0') | |
3653 | (symbol '1')) |
|
1004 | (symbol '1')) | |
3654 | (range |
|
1005 | (range | |
3655 | (symbol '1') |
|
1006 | (symbol '1') | |
3656 | (symbol '2')) |
|
1007 | (symbol '2')) | |
3657 | (range |
|
1008 | (range | |
3658 | (symbol '2') |
|
1009 | (symbol '2') | |
3659 | (symbol '3')))) |
|
1010 | (symbol '3')))) | |
3660 | * expanded: |
|
1011 | * expanded: | |
3661 | (or |
|
1012 | (or | |
3662 | (list |
|
1013 | (list | |
3663 | (range |
|
1014 | (range | |
3664 | (symbol '0') |
|
1015 | (symbol '0') | |
3665 | (symbol '1')) |
|
1016 | (symbol '1')) | |
3666 | (range |
|
1017 | (range | |
3667 | (symbol '1') |
|
1018 | (symbol '1') | |
3668 | (symbol '2')) |
|
1019 | (symbol '2')) | |
3669 | (range |
|
1020 | (range | |
3670 | (symbol '2') |
|
1021 | (symbol '2') | |
3671 | (symbol '3')))) |
|
1022 | (symbol '3')))) | |
3672 | * set: |
|
1023 | * set: | |
3673 | <addset |
|
1024 | <addset | |
3674 | <spanset+ 0:2>, |
|
1025 | <spanset+ 0:2>, | |
3675 | <addset |
|
1026 | <addset | |
3676 | <spanset+ 1:3>, |
|
1027 | <spanset+ 1:3>, | |
3677 | <spanset+ 2:4>>> |
|
1028 | <spanset+ 2:4>>> | |
3678 | 0 |
|
1029 | 0 | |
3679 | 1 |
|
1030 | 1 | |
3680 | 2 |
|
1031 | 2 | |
3681 | 3 |
|
1032 | 3 | |
3682 |
|
1033 | |||
3683 | test variable isolation, variable placeholders are rewritten as string |
|
1034 | test variable isolation, variable placeholders are rewritten as string | |
3684 | then parsed and matched again as string. Check they do not leak too |
|
1035 | then parsed and matched again as string. Check they do not leak too | |
3685 | far away. |
|
1036 | far away. | |
3686 |
|
1037 | |||
3687 |
|
|
1038 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc | |
3688 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc |
|
1039 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc | |
3689 | $ try 'callinjection(2:5)' |
|
1040 | $ try 'callinjection(2:5)' | |
3690 | (func |
|
1041 | (func | |
3691 | (symbol 'callinjection') |
|
1042 | (symbol 'callinjection') | |
3692 | (range |
|
1043 | (range | |
3693 | (symbol '2') |
|
1044 | (symbol '2') | |
3694 | (symbol '5'))) |
|
1045 | (symbol '5'))) | |
3695 | * expanded: |
|
1046 | * expanded: | |
3696 | (func |
|
1047 | (func | |
3697 | (symbol 'descendants') |
|
1048 | (symbol 'descendants') | |
3698 | (func |
|
1049 | (func | |
3699 | (symbol 'max') |
|
1050 | (symbol 'max') | |
3700 | (string '$1'))) |
|
1051 | (string '$1'))) | |
3701 | abort: unknown revision '$1'! |
|
1052 | abort: unknown revision '$1'! | |
3702 | [255] |
|
1053 | [255] | |
3703 |
|
1054 | |||
3704 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', |
|
1055 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', | |
3705 | but 'all()' should never be substituted to '0()'. |
|
1056 | but 'all()' should never be substituted to '0()'. | |
3706 |
|
1057 | |||
3707 | $ echo 'universe = all()' >> .hg/hgrc |
|
1058 | $ echo 'universe = all()' >> .hg/hgrc | |
3708 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc |
|
1059 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc | |
3709 | $ try 'shadowall(0)' |
|
1060 | $ try 'shadowall(0)' | |
3710 | (func |
|
1061 | (func | |
3711 | (symbol 'shadowall') |
|
1062 | (symbol 'shadowall') | |
3712 | (symbol '0')) |
|
1063 | (symbol '0')) | |
3713 | * expanded: |
|
1064 | * expanded: | |
3714 | (and |
|
1065 | (and | |
3715 | (symbol '0') |
|
1066 | (symbol '0') | |
3716 | (func |
|
1067 | (func | |
3717 | (symbol 'all') |
|
1068 | (symbol 'all') | |
3718 | None)) |
|
1069 | None)) | |
3719 | * set: |
|
1070 | * set: | |
3720 | <filteredset |
|
1071 | <filteredset | |
3721 | <baseset [0]>, |
|
1072 | <baseset [0]>, | |
3722 | <spanset+ 0:10>> |
|
1073 | <spanset+ 0:10>> | |
3723 | 0 |
|
1074 | 0 | |
3724 |
|
1075 | |||
3725 | test unknown reference: |
|
1076 | test unknown reference: | |
3726 |
|
1077 | |||
3727 | $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' |
|
1078 | $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' | |
3728 | (func |
|
1079 | (func | |
3729 | (symbol 'unknownref') |
|
1080 | (symbol 'unknownref') | |
3730 | (symbol '0')) |
|
1081 | (symbol '0')) | |
3731 | abort: bad definition of revset alias "unknownref": invalid symbol '$2' |
|
1082 | abort: bad definition of revset alias "unknownref": invalid symbol '$2' | |
3732 | [255] |
|
1083 | [255] | |
3733 |
|
1084 | |||
3734 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
|
1085 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" | |
3735 | (symbol 'tip') |
|
1086 | (symbol 'tip') | |
3736 | warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end |
|
1087 | warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end | |
3737 | * set: |
|
1088 | * set: | |
3738 | <baseset [9]> |
|
1089 | <baseset [9]> | |
3739 | 9 |
|
1090 | 9 | |
3740 |
|
1091 | |||
3741 | $ try 'tip' |
|
1092 | $ try 'tip' | |
3742 | (symbol 'tip') |
|
1093 | (symbol 'tip') | |
3743 | * set: |
|
1094 | * set: | |
3744 | <baseset [9]> |
|
1095 | <baseset [9]> | |
3745 | 9 |
|
1096 | 9 | |
3746 |
|
1097 | |||
3747 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" |
|
1098 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" | |
3748 | (symbol 'tip') |
|
1099 | (symbol 'tip') | |
3749 |
warning: |
|
1100 | warning: bad declaration of revset alias "bad name": at 4: invalid token | |
3750 | * set: |
|
1101 | * set: | |
3751 | <baseset [9]> |
|
1102 | <baseset [9]> | |
3752 | 9 |
|
1103 | 9 | |
3753 |
|
|
1104 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc | |
3754 | $ try 'strictreplacing("foo", tip)' |
|
1105 | $ try 'strictreplacing("foo", tip)' | |
3755 | (func |
|
1106 | (func | |
3756 | (symbol 'strictreplacing') |
|
1107 | (symbol 'strictreplacing') | |
3757 | (list |
|
1108 | (list | |
3758 | (string 'foo') |
|
1109 | (string 'foo') | |
3759 | (symbol 'tip'))) |
|
1110 | (symbol 'tip'))) | |
3760 | * expanded: |
|
1111 | * expanded: | |
3761 | (or |
|
1112 | (or | |
3762 | (list |
|
1113 | (list | |
3763 | (symbol 'tip') |
|
1114 | (symbol 'tip') | |
3764 | (func |
|
1115 | (func | |
3765 | (symbol 'desc') |
|
1116 | (symbol 'desc') | |
3766 | (string '$1')))) |
|
1117 | (string '$1')))) | |
3767 | * set: |
|
1118 | * set: | |
3768 | <addset |
|
1119 | <addset | |
3769 | <baseset [9]>, |
|
1120 | <baseset [9]>, | |
3770 | <filteredset |
|
1121 | <filteredset | |
3771 | <fullreposet+ 0:10>, |
|
1122 | <fullreposet+ 0:10>, | |
3772 | <desc '$1'>>> |
|
1123 | <desc '$1'>>> | |
3773 | 9 |
|
1124 | 9 | |
3774 |
|
1125 | |||
3775 | $ try 'd(2:5)' |
|
1126 | $ try 'd(2:5)' | |
3776 | (func |
|
1127 | (func | |
3777 | (symbol 'd') |
|
1128 | (symbol 'd') | |
3778 | (range |
|
1129 | (range | |
3779 | (symbol '2') |
|
1130 | (symbol '2') | |
3780 | (symbol '5'))) |
|
1131 | (symbol '5'))) | |
3781 | * expanded: |
|
1132 | * expanded: | |
3782 | (func |
|
1133 | (func | |
3783 | (symbol 'reverse') |
|
1134 | (symbol 'reverse') | |
3784 | (func |
|
1135 | (func | |
3785 | (symbol 'sort') |
|
1136 | (symbol 'sort') | |
3786 | (list |
|
1137 | (list | |
3787 | (range |
|
1138 | (range | |
3788 | (symbol '2') |
|
1139 | (symbol '2') | |
3789 | (symbol '5')) |
|
1140 | (symbol '5')) | |
3790 | (symbol 'date')))) |
|
1141 | (symbol 'date')))) | |
3791 | * set: |
|
1142 | * set: | |
3792 | <baseset [4, 5, 3, 2]> |
|
1143 | <baseset [4, 5, 3, 2]> | |
3793 | 4 |
|
1144 | 4 | |
3794 | 5 |
|
1145 | 5 | |
3795 | 3 |
|
1146 | 3 | |
3796 | 2 |
|
1147 | 2 | |
3797 | $ try 'rs(2 or 3, date)' |
|
1148 | $ try 'rs(2 or 3, date)' | |
3798 | (func |
|
1149 | (func | |
3799 | (symbol 'rs') |
|
1150 | (symbol 'rs') | |
3800 | (list |
|
1151 | (list | |
3801 | (or |
|
1152 | (or | |
3802 | (list |
|
1153 | (list | |
3803 | (symbol '2') |
|
1154 | (symbol '2') | |
3804 | (symbol '3'))) |
|
1155 | (symbol '3'))) | |
3805 | (symbol 'date'))) |
|
1156 | (symbol 'date'))) | |
3806 | * expanded: |
|
1157 | * expanded: | |
3807 | (func |
|
1158 | (func | |
3808 | (symbol 'reverse') |
|
1159 | (symbol 'reverse') | |
3809 | (func |
|
1160 | (func | |
3810 | (symbol 'sort') |
|
1161 | (symbol 'sort') | |
3811 | (list |
|
1162 | (list | |
3812 | (or |
|
1163 | (or | |
3813 | (list |
|
1164 | (list | |
3814 | (symbol '2') |
|
1165 | (symbol '2') | |
3815 | (symbol '3'))) |
|
1166 | (symbol '3'))) | |
3816 | (symbol 'date')))) |
|
1167 | (symbol 'date')))) | |
3817 | * set: |
|
1168 | * set: | |
3818 | <baseset [3, 2]> |
|
1169 | <baseset [3, 2]> | |
3819 | 3 |
|
1170 | 3 | |
3820 | 2 |
|
1171 | 2 | |
3821 | $ try 'rs()' |
|
1172 | $ try 'rs()' | |
3822 | (func |
|
1173 | (func | |
3823 | (symbol 'rs') |
|
1174 | (symbol 'rs') | |
3824 | None) |
|
1175 | None) | |
3825 | hg: parse error: invalid number of arguments: 0 |
|
1176 | hg: parse error: invalid number of arguments: 0 | |
3826 | [255] |
|
1177 | [255] | |
3827 | $ try 'rs(2)' |
|
1178 | $ try 'rs(2)' | |
3828 | (func |
|
1179 | (func | |
3829 | (symbol 'rs') |
|
1180 | (symbol 'rs') | |
3830 | (symbol '2')) |
|
1181 | (symbol '2')) | |
3831 | hg: parse error: invalid number of arguments: 1 |
|
1182 | hg: parse error: invalid number of arguments: 1 | |
3832 | [255] |
|
1183 | [255] | |
3833 | $ try 'rs(2, data, 7)' |
|
1184 | $ try 'rs(2, data, 7)' | |
3834 | (func |
|
1185 | (func | |
3835 | (symbol 'rs') |
|
1186 | (symbol 'rs') | |
3836 | (list |
|
1187 | (list | |
3837 | (symbol '2') |
|
1188 | (symbol '2') | |
3838 | (symbol 'data') |
|
1189 | (symbol 'data') | |
3839 | (symbol '7'))) |
|
1190 | (symbol '7'))) | |
3840 | hg: parse error: invalid number of arguments: 3 |
|
1191 | hg: parse error: invalid number of arguments: 3 | |
3841 | [255] |
|
1192 | [255] | |
3842 | $ try 'rs4(2 or 3, x, x, date)' |
|
1193 | $ try 'rs4(2 or 3, x, x, date)' | |
3843 | (func |
|
1194 | (func | |
3844 | (symbol 'rs4') |
|
1195 | (symbol 'rs4') | |
3845 | (list |
|
1196 | (list | |
3846 | (or |
|
1197 | (or | |
3847 | (list |
|
1198 | (list | |
3848 | (symbol '2') |
|
1199 | (symbol '2') | |
3849 | (symbol '3'))) |
|
1200 | (symbol '3'))) | |
3850 | (symbol 'x') |
|
1201 | (symbol 'x') | |
3851 | (symbol 'x') |
|
1202 | (symbol 'x') | |
3852 | (symbol 'date'))) |
|
1203 | (symbol 'date'))) | |
3853 | * expanded: |
|
1204 | * expanded: | |
3854 | (func |
|
1205 | (func | |
3855 | (symbol 'reverse') |
|
1206 | (symbol 'reverse') | |
3856 | (func |
|
1207 | (func | |
3857 | (symbol 'sort') |
|
1208 | (symbol 'sort') | |
3858 | (list |
|
1209 | (list | |
3859 | (or |
|
1210 | (or | |
3860 | (list |
|
1211 | (list | |
3861 | (symbol '2') |
|
1212 | (symbol '2') | |
3862 | (symbol '3'))) |
|
1213 | (symbol '3'))) | |
3863 | (symbol 'date')))) |
|
1214 | (symbol 'date')))) | |
3864 | * set: |
|
1215 | * set: | |
3865 | <baseset [3, 2]> |
|
1216 | <baseset [3, 2]> | |
3866 | 3 |
|
1217 | 3 | |
3867 | 2 |
|
1218 | 2 | |
3868 |
|
1219 | |||
3869 | issue4553: check that revset aliases override existing hash prefix |
|
1220 | issue4553: check that revset aliases override existing hash prefix | |
3870 |
|
1221 | |||
3871 | $ hg log -qr e |
|
1222 | $ hg log -qr e | |
3872 | 6:e0cc66ef77e8 |
|
1223 | 6:e0cc66ef77e8 | |
3873 |
|
1224 | |||
3874 | $ hg log -qr e --config revsetalias.e="all()" |
|
1225 | $ hg log -qr e --config revsetalias.e="all()" | |
3875 | 0:2785f51eece5 |
|
1226 | 0:2785f51eece5 | |
3876 | 1:d75937da8da0 |
|
1227 | 1:d75937da8da0 | |
3877 | 2:5ed5505e9f1c |
|
1228 | 2:5ed5505e9f1c | |
3878 | 3:8528aa5637f2 |
|
1229 | 3:8528aa5637f2 | |
3879 | 4:2326846efdab |
|
1230 | 4:2326846efdab | |
3880 | 5:904fa392b941 |
|
1231 | 5:904fa392b941 | |
3881 | 6:e0cc66ef77e8 |
|
1232 | 6:e0cc66ef77e8 | |
3882 | 7:013af1973af4 |
|
1233 | 7:013af1973af4 | |
3883 | 8:d5d0dcbdc4d9 |
|
1234 | 8:d5d0dcbdc4d9 | |
3884 | 9:24286f4ae135 |
|
1235 | 9:24286f4ae135 | |
3885 |
|
1236 | |||
3886 | $ hg log -qr e: --config revsetalias.e="0" |
|
1237 | $ hg log -qr e: --config revsetalias.e="0" | |
3887 | 0:2785f51eece5 |
|
1238 | 0:2785f51eece5 | |
3888 | 1:d75937da8da0 |
|
1239 | 1:d75937da8da0 | |
3889 | 2:5ed5505e9f1c |
|
1240 | 2:5ed5505e9f1c | |
3890 | 3:8528aa5637f2 |
|
1241 | 3:8528aa5637f2 | |
3891 | 4:2326846efdab |
|
1242 | 4:2326846efdab | |
3892 | 5:904fa392b941 |
|
1243 | 5:904fa392b941 | |
3893 | 6:e0cc66ef77e8 |
|
1244 | 6:e0cc66ef77e8 | |
3894 | 7:013af1973af4 |
|
1245 | 7:013af1973af4 | |
3895 | 8:d5d0dcbdc4d9 |
|
1246 | 8:d5d0dcbdc4d9 | |
3896 | 9:24286f4ae135 |
|
1247 | 9:24286f4ae135 | |
3897 |
|
1248 | |||
3898 | $ hg log -qr :e --config revsetalias.e="9" |
|
1249 | $ hg log -qr :e --config revsetalias.e="9" | |
3899 | 0:2785f51eece5 |
|
1250 | 0:2785f51eece5 | |
3900 | 1:d75937da8da0 |
|
1251 | 1:d75937da8da0 | |
3901 | 2:5ed5505e9f1c |
|
1252 | 2:5ed5505e9f1c | |
3902 | 3:8528aa5637f2 |
|
1253 | 3:8528aa5637f2 | |
3903 | 4:2326846efdab |
|
1254 | 4:2326846efdab | |
3904 | 5:904fa392b941 |
|
1255 | 5:904fa392b941 | |
3905 | 6:e0cc66ef77e8 |
|
1256 | 6:e0cc66ef77e8 | |
3906 | 7:013af1973af4 |
|
1257 | 7:013af1973af4 | |
3907 | 8:d5d0dcbdc4d9 |
|
1258 | 8:d5d0dcbdc4d9 | |
3908 | 9:24286f4ae135 |
|
1259 | 9:24286f4ae135 | |
3909 |
|
1260 | |||
3910 | $ hg log -qr e: |
|
1261 | $ hg log -qr e: | |
3911 | 6:e0cc66ef77e8 |
|
1262 | 6:e0cc66ef77e8 | |
3912 | 7:013af1973af4 |
|
1263 | 7:013af1973af4 | |
3913 | 8:d5d0dcbdc4d9 |
|
1264 | 8:d5d0dcbdc4d9 | |
3914 | 9:24286f4ae135 |
|
1265 | 9:24286f4ae135 | |
3915 |
|
1266 | |||
3916 | $ hg log -qr :e |
|
1267 | $ hg log -qr :e | |
3917 | 0:2785f51eece5 |
|
1268 | 0:2785f51eece5 | |
3918 | 1:d75937da8da0 |
|
1269 | 1:d75937da8da0 | |
3919 | 2:5ed5505e9f1c |
|
1270 | 2:5ed5505e9f1c | |
3920 | 3:8528aa5637f2 |
|
1271 | 3:8528aa5637f2 | |
3921 | 4:2326846efdab |
|
1272 | 4:2326846efdab | |
3922 | 5:904fa392b941 |
|
1273 | 5:904fa392b941 | |
3923 | 6:e0cc66ef77e8 |
|
1274 | 6:e0cc66ef77e8 | |
3924 |
|
1275 | |||
3925 | issue2549 - correct optimizations |
|
1276 | issue2549 - correct optimizations | |
3926 |
|
1277 | |||
3927 | $ try 'limit(1 or 2 or 3, 2) and not 2' |
|
1278 | $ try 'limit(1 or 2 or 3, 2) and not 2' | |
3928 | (and |
|
1279 | (and | |
3929 | (func |
|
1280 | (func | |
3930 | (symbol 'limit') |
|
1281 | (symbol 'limit') | |
3931 | (list |
|
1282 | (list | |
3932 | (or |
|
1283 | (or | |
3933 | (list |
|
1284 | (list | |
3934 | (symbol '1') |
|
1285 | (symbol '1') | |
3935 | (symbol '2') |
|
1286 | (symbol '2') | |
3936 | (symbol '3'))) |
|
1287 | (symbol '3'))) | |
3937 | (symbol '2'))) |
|
1288 | (symbol '2'))) | |
3938 | (not |
|
1289 | (not | |
3939 | (symbol '2'))) |
|
1290 | (symbol '2'))) | |
3940 | * set: |
|
1291 | * set: | |
3941 | <filteredset |
|
1292 | <filteredset | |
3942 | <baseset [1, 2]>, |
|
1293 | <baseset [1, 2]>, | |
3943 | <not |
|
1294 | <not | |
3944 | <baseset [2]>>> |
|
1295 | <baseset [2]>>> | |
3945 | 1 |
|
1296 | 1 | |
3946 | $ try 'max(1 or 2) and not 2' |
|
1297 | $ try 'max(1 or 2) and not 2' | |
3947 | (and |
|
1298 | (and | |
3948 | (func |
|
1299 | (func | |
3949 | (symbol 'max') |
|
1300 | (symbol 'max') | |
3950 | (or |
|
1301 | (or | |
3951 | (list |
|
1302 | (list | |
3952 | (symbol '1') |
|
1303 | (symbol '1') | |
3953 | (symbol '2')))) |
|
1304 | (symbol '2')))) | |
3954 | (not |
|
1305 | (not | |
3955 | (symbol '2'))) |
|
1306 | (symbol '2'))) | |
3956 | * set: |
|
1307 | * set: | |
3957 | <filteredset |
|
1308 | <filteredset | |
3958 | <baseset |
|
1309 | <baseset | |
3959 | <max |
|
1310 | <max | |
3960 | <fullreposet+ 0:10>, |
|
1311 | <fullreposet+ 0:10>, | |
3961 | <baseset [1, 2]>>>, |
|
1312 | <baseset [1, 2]>>>, | |
3962 | <not |
|
1313 | <not | |
3963 | <baseset [2]>>> |
|
1314 | <baseset [2]>>> | |
3964 | $ try 'min(1 or 2) and not 1' |
|
1315 | $ try 'min(1 or 2) and not 1' | |
3965 | (and |
|
1316 | (and | |
3966 | (func |
|
1317 | (func | |
3967 | (symbol 'min') |
|
1318 | (symbol 'min') | |
3968 | (or |
|
1319 | (or | |
3969 | (list |
|
1320 | (list | |
3970 | (symbol '1') |
|
1321 | (symbol '1') | |
3971 | (symbol '2')))) |
|
1322 | (symbol '2')))) | |
3972 | (not |
|
1323 | (not | |
3973 | (symbol '1'))) |
|
1324 | (symbol '1'))) | |
3974 | * set: |
|
1325 | * set: | |
3975 | <filteredset |
|
1326 | <filteredset | |
3976 | <baseset |
|
1327 | <baseset | |
3977 | <min |
|
1328 | <min | |
3978 | <fullreposet+ 0:10>, |
|
1329 | <fullreposet+ 0:10>, | |
3979 | <baseset [1, 2]>>>, |
|
1330 | <baseset [1, 2]>>>, | |
3980 | <not |
|
1331 | <not | |
3981 | <baseset [1]>>> |
|
1332 | <baseset [1]>>> | |
3982 | $ try 'last(1 or 2, 1) and not 2' |
|
1333 | $ try 'last(1 or 2, 1) and not 2' | |
3983 | (and |
|
1334 | (and | |
3984 | (func |
|
1335 | (func | |
3985 | (symbol 'last') |
|
1336 | (symbol 'last') | |
3986 | (list |
|
1337 | (list | |
3987 | (or |
|
1338 | (or | |
3988 | (list |
|
1339 | (list | |
3989 | (symbol '1') |
|
1340 | (symbol '1') | |
3990 | (symbol '2'))) |
|
1341 | (symbol '2'))) | |
3991 | (symbol '1'))) |
|
1342 | (symbol '1'))) | |
3992 | (not |
|
1343 | (not | |
3993 | (symbol '2'))) |
|
1344 | (symbol '2'))) | |
3994 | * set: |
|
1345 | * set: | |
3995 | <filteredset |
|
1346 | <filteredset | |
3996 | <baseset [2]>, |
|
1347 | <baseset [2]>, | |
3997 | <not |
|
1348 | <not | |
3998 | <baseset [2]>>> |
|
1349 | <baseset [2]>>> | |
3999 |
|
1350 | |||
4000 | issue4289 - ordering of built-ins |
|
1351 | issue4289 - ordering of built-ins | |
4001 | $ hg log -M -q -r 3:2 |
|
1352 | $ hg log -M -q -r 3:2 | |
4002 | 3:8528aa5637f2 |
|
1353 | 3:8528aa5637f2 | |
4003 | 2:5ed5505e9f1c |
|
1354 | 2:5ed5505e9f1c | |
4004 |
|
1355 | |||
4005 | test revsets started with 40-chars hash (issue3669) |
|
1356 | test revsets started with 40-chars hash (issue3669) | |
4006 |
|
1357 | |||
4007 | $ ISSUE3669_TIP=`hg tip --template '{node}'` |
|
1358 | $ ISSUE3669_TIP=`hg tip --template '{node}'` | |
4008 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' |
|
1359 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' | |
4009 | 9 |
|
1360 | 9 | |
4010 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' |
|
1361 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' | |
4011 | 8 |
|
1362 | 8 | |
4012 |
|
1363 | |||
4013 | test or-ed indirect predicates (issue3775) |
|
1364 | test or-ed indirect predicates (issue3775) | |
4014 |
|
1365 | |||
4015 | $ log '6 or 6^1' | sort |
|
1366 | $ log '6 or 6^1' | sort | |
4016 | 5 |
|
1367 | 5 | |
4017 | 6 |
|
1368 | 6 | |
4018 | $ log '6^1 or 6' | sort |
|
1369 | $ log '6^1 or 6' | sort | |
4019 | 5 |
|
1370 | 5 | |
4020 | 6 |
|
1371 | 6 | |
4021 | $ log '4 or 4~1' | sort |
|
1372 | $ log '4 or 4~1' | sort | |
4022 | 2 |
|
1373 | 2 | |
4023 | 4 |
|
1374 | 4 | |
4024 | $ log '4~1 or 4' | sort |
|
1375 | $ log '4~1 or 4' | sort | |
4025 | 2 |
|
1376 | 2 | |
4026 | 4 |
|
1377 | 4 | |
4027 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort |
|
1378 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort | |
4028 | 0 |
|
1379 | 0 | |
4029 | 1 |
|
1380 | 1 | |
4030 | 2 |
|
1381 | 2 | |
4031 | 3 |
|
1382 | 3 | |
4032 | 4 |
|
1383 | 4 | |
4033 | 5 |
|
1384 | 5 | |
4034 | 6 |
|
1385 | 6 | |
4035 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort |
|
1386 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort | |
4036 | 0 |
|
1387 | 0 | |
4037 | 1 |
|
1388 | 1 | |
4038 | 2 |
|
1389 | 2 | |
4039 | 3 |
|
1390 | 3 | |
4040 | 4 |
|
1391 | 4 | |
4041 | 5 |
|
1392 | 5 | |
4042 | 6 |
|
1393 | 6 | |
4043 |
|
1394 | |||
4044 | tests for 'remote()' predicate: |
|
1395 | tests for 'remote()' predicate: | |
4045 | #. (csets in remote) (id) (remote) |
|
1396 | #. (csets in remote) (id) (remote) | |
4046 | 1. less than local current branch "default" |
|
1397 | 1. less than local current branch "default" | |
4047 | 2. same with local specified "default" |
|
1398 | 2. same with local specified "default" | |
4048 | 3. more than local specified specified |
|
1399 | 3. more than local specified specified | |
4049 |
|
1400 | |||
4050 | $ hg clone --quiet -U . ../remote3 |
|
1401 | $ hg clone --quiet -U . ../remote3 | |
4051 | $ cd ../remote3 |
|
1402 | $ cd ../remote3 | |
4052 | $ hg update -q 7 |
|
1403 | $ hg update -q 7 | |
4053 | $ echo r > r |
|
1404 | $ echo r > r | |
4054 | $ hg ci -Aqm 10 |
|
1405 | $ hg ci -Aqm 10 | |
4055 | $ log 'remote()' |
|
1406 | $ log 'remote()' | |
4056 | 7 |
|
1407 | 7 | |
4057 | $ log 'remote("a-b-c-")' |
|
1408 | $ log 'remote("a-b-c-")' | |
4058 | 2 |
|
1409 | 2 | |
4059 | $ cd ../repo |
|
1410 | $ cd ../repo | |
4060 | $ log 'remote(".a.b.c.", "../remote3")' |
|
1411 | $ log 'remote(".a.b.c.", "../remote3")' | |
4061 |
|
1412 | |||
4062 | tests for concatenation of strings/symbols by "##" |
|
1413 | tests for concatenation of strings/symbols by "##" | |
4063 |
|
1414 | |||
4064 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" |
|
1415 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" | |
4065 | (_concat |
|
1416 | (_concat | |
4066 | (_concat |
|
1417 | (_concat | |
4067 | (_concat |
|
1418 | (_concat | |
4068 | (symbol '278') |
|
1419 | (symbol '278') | |
4069 | (string '5f5')) |
|
1420 | (string '5f5')) | |
4070 | (symbol '1ee')) |
|
1421 | (symbol '1ee')) | |
4071 | (string 'ce5')) |
|
1422 | (string 'ce5')) | |
4072 | * concatenated: |
|
1423 | * concatenated: | |
4073 | (string '2785f51eece5') |
|
1424 | (string '2785f51eece5') | |
4074 | * set: |
|
1425 | * set: | |
4075 | <baseset [0]> |
|
1426 | <baseset [0]> | |
4076 | 0 |
|
1427 | 0 | |
4077 |
|
1428 | |||
4078 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc |
|
1429 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc | |
4079 | $ try "cat4(278, '5f5', 1ee, 'ce5')" |
|
1430 | $ try "cat4(278, '5f5', 1ee, 'ce5')" | |
4080 | (func |
|
1431 | (func | |
4081 | (symbol 'cat4') |
|
1432 | (symbol 'cat4') | |
4082 | (list |
|
1433 | (list | |
4083 | (symbol '278') |
|
1434 | (symbol '278') | |
4084 | (string '5f5') |
|
1435 | (string '5f5') | |
4085 | (symbol '1ee') |
|
1436 | (symbol '1ee') | |
4086 | (string 'ce5'))) |
|
1437 | (string 'ce5'))) | |
4087 | * expanded: |
|
1438 | * expanded: | |
4088 | (_concat |
|
1439 | (_concat | |
4089 | (_concat |
|
1440 | (_concat | |
4090 | (_concat |
|
1441 | (_concat | |
4091 | (symbol '278') |
|
1442 | (symbol '278') | |
4092 | (string '5f5')) |
|
1443 | (string '5f5')) | |
4093 | (symbol '1ee')) |
|
1444 | (symbol '1ee')) | |
4094 | (string 'ce5')) |
|
1445 | (string 'ce5')) | |
4095 | * concatenated: |
|
1446 | * concatenated: | |
4096 | (string '2785f51eece5') |
|
1447 | (string '2785f51eece5') | |
4097 | * set: |
|
1448 | * set: | |
4098 | <baseset [0]> |
|
1449 | <baseset [0]> | |
4099 | 0 |
|
1450 | 0 | |
4100 |
|
1451 | |||
4101 | (check concatenation in alias nesting) |
|
1452 | (check concatenation in alias nesting) | |
4102 |
|
1453 | |||
4103 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc |
|
1454 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc | |
4104 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc |
|
1455 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc | |
4105 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" |
|
1456 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" | |
4106 | 0 |
|
1457 | 0 | |
4107 |
|
1458 | |||
4108 | (check operator priority) |
|
1459 | (check operator priority) | |
4109 |
|
1460 | |||
4110 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc |
|
1461 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc | |
4111 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" |
|
1462 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" | |
4112 | 0 |
|
1463 | 0 | |
4113 | 4 |
|
1464 | 4 | |
4114 |
|
1465 | |||
4115 | $ cd .. |
|
1466 | $ cd .. | |
4116 |
|
1467 | |||
4117 | prepare repository that has "default" branches of multiple roots |
|
1468 | prepare repository that has "default" branches of multiple roots | |
4118 |
|
1469 | |||
4119 | $ hg init namedbranch |
|
1470 | $ hg init namedbranch | |
4120 | $ cd namedbranch |
|
1471 | $ cd namedbranch | |
4121 |
|
1472 | |||
4122 | $ echo default0 >> a |
|
1473 | $ echo default0 >> a | |
4123 | $ hg ci -Aqm0 |
|
1474 | $ hg ci -Aqm0 | |
4124 | $ echo default1 >> a |
|
1475 | $ echo default1 >> a | |
4125 | $ hg ci -m1 |
|
1476 | $ hg ci -m1 | |
4126 |
|
1477 | |||
4127 | $ hg branch -q stable |
|
1478 | $ hg branch -q stable | |
4128 | $ echo stable2 >> a |
|
1479 | $ echo stable2 >> a | |
4129 | $ hg ci -m2 |
|
1480 | $ hg ci -m2 | |
4130 | $ echo stable3 >> a |
|
1481 | $ echo stable3 >> a | |
4131 | $ hg ci -m3 |
|
1482 | $ hg ci -m3 | |
4132 |
|
1483 | |||
4133 | $ hg update -q null |
|
1484 | $ hg update -q null | |
4134 | $ echo default4 >> a |
|
1485 | $ echo default4 >> a | |
4135 | $ hg ci -Aqm4 |
|
1486 | $ hg ci -Aqm4 | |
4136 | $ echo default5 >> a |
|
1487 | $ echo default5 >> a | |
4137 | $ hg ci -m5 |
|
1488 | $ hg ci -m5 | |
4138 |
|
1489 | |||
4139 | "null" revision belongs to "default" branch (issue4683) |
|
1490 | "null" revision belongs to "default" branch (issue4683) | |
4140 |
|
1491 | |||
4141 | $ log 'branch(null)' |
|
1492 | $ log 'branch(null)' | |
4142 | 0 |
|
1493 | 0 | |
4143 | 1 |
|
1494 | 1 | |
4144 | 4 |
|
1495 | 4 | |
4145 | 5 |
|
1496 | 5 | |
4146 |
|
1497 | |||
4147 | "null" revision belongs to "default" branch, but it shouldn't appear in set |
|
1498 | "null" revision belongs to "default" branch, but it shouldn't appear in set | |
4148 | unless explicitly specified (issue4682) |
|
1499 | unless explicitly specified (issue4682) | |
4149 |
|
1500 | |||
4150 | $ log 'children(branch(default))' |
|
1501 | $ log 'children(branch(default))' | |
4151 | 1 |
|
1502 | 1 | |
4152 | 2 |
|
1503 | 2 | |
4153 | 5 |
|
1504 | 5 | |
4154 |
|
1505 | |||
4155 | $ cd .. |
|
1506 | $ cd .. | |
4156 |
|
1507 | |||
4157 | test author/desc/keyword in problematic encoding |
|
1508 | test author/desc/keyword in problematic encoding | |
4158 | # unicode: cp932: |
|
1509 | # unicode: cp932: | |
4159 | # u30A2 0x83 0x41(= 'A') |
|
1510 | # u30A2 0x83 0x41(= 'A') | |
4160 | # u30C2 0x83 0x61(= 'a') |
|
1511 | # u30C2 0x83 0x61(= 'a') | |
4161 |
|
1512 | |||
4162 | $ hg init problematicencoding |
|
1513 | $ hg init problematicencoding | |
4163 | $ cd problematicencoding |
|
1514 | $ cd problematicencoding | |
4164 |
|
1515 | |||
4165 | $ $PYTHON > setup.sh <<EOF |
|
1516 | $ $PYTHON > setup.sh <<EOF | |
4166 | > print u''' |
|
1517 | > print u''' | |
4167 | > echo a > text |
|
1518 | > echo a > text | |
4168 | > hg add text |
|
1519 | > hg add text | |
4169 | > hg --encoding utf-8 commit -u '\u30A2' -m none |
|
1520 | > hg --encoding utf-8 commit -u '\u30A2' -m none | |
4170 | > echo b > text |
|
1521 | > echo b > text | |
4171 | > hg --encoding utf-8 commit -u '\u30C2' -m none |
|
1522 | > hg --encoding utf-8 commit -u '\u30C2' -m none | |
4172 | > echo c > text |
|
1523 | > echo c > text | |
4173 | > hg --encoding utf-8 commit -u none -m '\u30A2' |
|
1524 | > hg --encoding utf-8 commit -u none -m '\u30A2' | |
4174 | > echo d > text |
|
1525 | > echo d > text | |
4175 | > hg --encoding utf-8 commit -u none -m '\u30C2' |
|
1526 | > hg --encoding utf-8 commit -u none -m '\u30C2' | |
4176 | > '''.encode('utf-8') |
|
1527 | > '''.encode('utf-8') | |
4177 | > EOF |
|
1528 | > EOF | |
4178 | $ sh < setup.sh |
|
1529 | $ sh < setup.sh | |
4179 |
|
1530 | |||
4180 | test in problematic encoding |
|
1531 | test in problematic encoding | |
4181 | $ $PYTHON > test.sh <<EOF |
|
1532 | $ $PYTHON > test.sh <<EOF | |
4182 | > print u''' |
|
1533 | > print u''' | |
4183 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' |
|
1534 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' | |
4184 | > echo ==== |
|
1535 | > echo ==== | |
4185 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' |
|
1536 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' | |
4186 | > echo ==== |
|
1537 | > echo ==== | |
4187 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' |
|
1538 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' | |
4188 | > echo ==== |
|
1539 | > echo ==== | |
4189 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' |
|
1540 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' | |
4190 | > echo ==== |
|
1541 | > echo ==== | |
4191 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' |
|
1542 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' | |
4192 | > echo ==== |
|
1543 | > echo ==== | |
4193 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' |
|
1544 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' | |
4194 | > '''.encode('cp932') |
|
1545 | > '''.encode('cp932') | |
4195 | > EOF |
|
1546 | > EOF | |
4196 | $ sh < test.sh |
|
1547 | $ sh < test.sh | |
4197 | 0 |
|
1548 | 0 | |
4198 | ==== |
|
1549 | ==== | |
4199 | 1 |
|
1550 | 1 | |
4200 | ==== |
|
1551 | ==== | |
4201 | 2 |
|
1552 | 2 | |
4202 | ==== |
|
1553 | ==== | |
4203 | 3 |
|
1554 | 3 | |
4204 | ==== |
|
1555 | ==== | |
4205 | 0 |
|
1556 | 0 | |
4206 | 2 |
|
1557 | 2 | |
4207 | ==== |
|
1558 | ==== | |
4208 | 1 |
|
1559 | 1 | |
4209 | 3 |
|
1560 | 3 | |
4210 |
|
1561 | |||
4211 | test error message of bad revset |
|
1562 | test error message of bad revset | |
4212 | $ hg log -r 'foo\\' |
|
1563 | $ hg log -r 'foo\\' | |
4213 | hg: parse error at 3: syntax error in revset 'foo\\' |
|
1564 | hg: parse error at 3: syntax error in revset 'foo\\' | |
4214 | [255] |
|
1565 | [255] | |
4215 |
|
1566 | |||
4216 | $ cd .. |
|
1567 | $ cd .. | |
4217 |
|
1568 | |||
4218 | Test that revset predicate of extension isn't loaded at failure of |
|
1569 | Test that revset predicate of extension isn't loaded at failure of | |
4219 | loading it |
|
1570 | loading it | |
4220 |
|
1571 | |||
4221 | $ cd repo |
|
1572 | $ cd repo | |
4222 |
|
1573 | |||
4223 | $ cat <<EOF > $TESTTMP/custompredicate.py |
|
1574 | $ cat <<EOF > $TESTTMP/custompredicate.py | |
4224 | > from mercurial import error, registrar, revset |
|
1575 | > from mercurial import error, registrar, revset | |
4225 | > |
|
1576 | > | |
4226 | > revsetpredicate = registrar.revsetpredicate() |
|
1577 | > revsetpredicate = registrar.revsetpredicate() | |
4227 | > |
|
1578 | > | |
4228 | > @revsetpredicate('custom1()') |
|
1579 | > @revsetpredicate('custom1()') | |
4229 | > def custom1(repo, subset, x): |
|
1580 | > def custom1(repo, subset, x): | |
4230 | > return revset.baseset([1]) |
|
1581 | > return revset.baseset([1]) | |
4231 | > |
|
1582 | > | |
4232 | > raise error.Abort('intentional failure of loading extension') |
|
1583 | > raise error.Abort('intentional failure of loading extension') | |
4233 | > EOF |
|
1584 | > EOF | |
4234 | $ cat <<EOF > .hg/hgrc |
|
1585 | $ cat <<EOF > .hg/hgrc | |
4235 | > [extensions] |
|
1586 | > [extensions] | |
4236 | > custompredicate = $TESTTMP/custompredicate.py |
|
1587 | > custompredicate = $TESTTMP/custompredicate.py | |
4237 | > EOF |
|
1588 | > EOF | |
4238 |
|
1589 | |||
4239 | $ hg debugrevspec "custom1()" |
|
1590 | $ hg debugrevspec "custom1()" | |
4240 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension |
|
1591 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension | |
4241 | hg: parse error: unknown identifier: custom1 |
|
1592 | hg: parse error: unknown identifier: custom1 | |
4242 | [255] |
|
1593 | [255] | |
4243 |
|
1594 | |||
4244 | Test repo.anyrevs with customized revset overrides |
|
1595 | Test repo.anyrevs with customized revset overrides | |
4245 |
|
1596 | |||
4246 | $ cat > $TESTTMP/printprevset.py <<EOF |
|
1597 | $ cat > $TESTTMP/printprevset.py <<EOF | |
4247 | > from mercurial import encoding, registrar |
|
1598 | > from mercurial import encoding, registrar | |
4248 | > cmdtable = {} |
|
1599 | > cmdtable = {} | |
4249 | > command = registrar.command(cmdtable) |
|
1600 | > command = registrar.command(cmdtable) | |
4250 | > @command('printprevset') |
|
1601 | > @command('printprevset') | |
4251 | > def printprevset(ui, repo): |
|
1602 | > def printprevset(ui, repo): | |
4252 | > alias = {} |
|
1603 | > alias = {} | |
4253 | > p = encoding.environ.get('P') |
|
1604 | > p = encoding.environ.get('P') | |
4254 | > if p: |
|
1605 | > if p: | |
4255 | > alias['P'] = p |
|
1606 | > alias['P'] = p | |
4256 | > revs = repo.anyrevs(['P'], user=True, localalias=alias) |
|
1607 | > revs = repo.anyrevs(['P'], user=True, localalias=alias) | |
4257 | > ui.write('P=%r\n' % list(revs)) |
|
1608 | > ui.write('P=%r\n' % list(revs)) | |
4258 | > EOF |
|
1609 | > EOF | |
4259 |
|
1610 | |||
4260 | $ cat >> .hg/hgrc <<EOF |
|
1611 | $ cat >> .hg/hgrc <<EOF | |
4261 | > custompredicate = ! |
|
1612 | > custompredicate = ! | |
4262 | > printprevset = $TESTTMP/printprevset.py |
|
1613 | > printprevset = $TESTTMP/printprevset.py | |
4263 | > EOF |
|
1614 | > EOF | |
4264 |
|
1615 | |||
4265 | $ hg --config revsetalias.P=1 printprevset |
|
1616 | $ hg --config revsetalias.P=1 printprevset | |
4266 | P=[1] |
|
1617 | P=[1] | |
4267 | $ P=3 hg --config revsetalias.P=2 printprevset |
|
1618 | $ P=3 hg --config revsetalias.P=2 printprevset | |
4268 | P=[3] |
|
1619 | P=[3] | |
4269 |
|
1620 | |||
4270 | $ cd .. |
|
1621 | $ cd .. | |
4271 |
|
1622 | |||
4272 | Test obsstore related revsets |
|
1623 | Test obsstore related revsets | |
4273 |
|
1624 | |||
4274 | $ hg init repo1 |
|
1625 | $ hg init repo1 | |
4275 | $ cd repo1 |
|
1626 | $ cd repo1 | |
4276 | $ cat <<EOF >> .hg/hgrc |
|
1627 | $ cat <<EOF >> .hg/hgrc | |
4277 | > [experimental] |
|
1628 | > [experimental] | |
4278 | > stabilization = createmarkers |
|
1629 | > stabilization = createmarkers | |
4279 | > EOF |
|
1630 | > EOF | |
4280 |
|
1631 | |||
4281 | $ hg debugdrawdag <<'EOS' |
|
1632 | $ hg debugdrawdag <<'EOS' | |
4282 | > F G |
|
1633 | > F G | |
4283 | > |/ # split: B -> E, F |
|
1634 | > |/ # split: B -> E, F | |
4284 | > B C D E # amend: B -> C -> D |
|
1635 | > B C D E # amend: B -> C -> D | |
4285 | > \|/ | # amend: F -> G |
|
1636 | > \|/ | # amend: F -> G | |
4286 | > A A Z # amend: A -> Z |
|
1637 | > A A Z # amend: A -> Z | |
4287 | > EOS |
|
1638 | > EOS | |
4288 |
|
1639 | |||
4289 | $ hg log -r 'successors(Z)' -T '{desc}\n' |
|
1640 | $ hg log -r 'successors(Z)' -T '{desc}\n' | |
4290 | Z |
|
1641 | Z | |
4291 |
|
1642 | |||
4292 | $ hg log -r 'successors(F)' -T '{desc}\n' |
|
1643 | $ hg log -r 'successors(F)' -T '{desc}\n' | |
4293 | F |
|
1644 | F | |
4294 | G |
|
1645 | G | |
4295 |
|
1646 | |||
4296 | $ hg tag --remove --local C D E F G |
|
1647 | $ hg tag --remove --local C D E F G | |
4297 |
|
1648 | |||
4298 | $ hg log -r 'successors(B)' -T '{desc}\n' |
|
1649 | $ hg log -r 'successors(B)' -T '{desc}\n' | |
4299 | B |
|
1650 | B | |
4300 | D |
|
1651 | D | |
4301 | E |
|
1652 | E | |
4302 | G |
|
1653 | G | |
4303 |
|
1654 | |||
4304 | $ hg log -r 'successors(B)' -T '{desc}\n' --hidden |
|
1655 | $ hg log -r 'successors(B)' -T '{desc}\n' --hidden | |
4305 | B |
|
1656 | B | |
4306 | C |
|
1657 | C | |
4307 | D |
|
1658 | D | |
4308 | E |
|
1659 | E | |
4309 | F |
|
1660 | F | |
4310 | G |
|
1661 | G | |
4311 |
|
1662 | |||
4312 | $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden |
|
1663 | $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden | |
4313 | D |
|
1664 | D | |
4314 | E |
|
1665 | E | |
4315 | G |
|
1666 | G | |
4316 |
|
1667 | |||
4317 | $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' |
|
1668 | $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' | |
4318 | A |
|
1669 | A | |
4319 | Z |
|
1670 | Z | |
4320 | B |
|
1671 | B | |
4321 |
|
1672 | |||
4322 | $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' |
|
1673 | $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' | |
4323 | Z |
|
1674 | Z | |
4324 |
|
1675 | |||
4325 | Test `draft() & ::x` optimization |
|
1676 | Test `draft() & ::x` optimization | |
4326 |
|
1677 | |||
4327 | $ hg init $TESTTMP/repo2 |
|
1678 | $ hg init $TESTTMP/repo2 | |
4328 | $ cd $TESTTMP/repo2 |
|
1679 | $ cd $TESTTMP/repo2 | |
4329 | $ hg debugdrawdag <<'EOS' |
|
1680 | $ hg debugdrawdag <<'EOS' | |
4330 | > P5 S1 |
|
1681 | > P5 S1 | |
4331 | > | | |
|
1682 | > | | | |
4332 | > S2 | D3 |
|
1683 | > S2 | D3 | |
4333 | > \|/ |
|
1684 | > \|/ | |
4334 | > P4 |
|
1685 | > P4 | |
4335 | > | |
|
1686 | > | | |
4336 | > P3 D2 |
|
1687 | > P3 D2 | |
4337 | > | | |
|
1688 | > | | | |
4338 | > P2 D1 |
|
1689 | > P2 D1 | |
4339 | > |/ |
|
1690 | > |/ | |
4340 | > P1 |
|
1691 | > P1 | |
4341 | > | |
|
1692 | > | | |
4342 | > P0 |
|
1693 | > P0 | |
4343 | > EOS |
|
1694 | > EOS | |
4344 | $ hg phase --public -r P5 |
|
1695 | $ hg phase --public -r P5 | |
4345 | $ hg phase --force --secret -r S1+S2 |
|
1696 | $ hg phase --force --secret -r S1+S2 | |
4346 | $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' |
|
1697 | $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' | |
4347 | o 8 P5 public |
|
1698 | o 8 P5 public | |
4348 | | |
|
1699 | | | |
4349 | | o 10 S1 secret |
|
1700 | | o 10 S1 secret | |
4350 | | | |
|
1701 | | | | |
4351 | | o 7 D3 draft |
|
1702 | | o 7 D3 draft | |
4352 | |/ |
|
1703 | |/ | |
4353 | | o 9 S2 secret |
|
1704 | | o 9 S2 secret | |
4354 | |/ |
|
1705 | |/ | |
4355 | o 6 P4 public |
|
1706 | o 6 P4 public | |
4356 | | |
|
1707 | | | |
4357 | o 5 P3 public |
|
1708 | o 5 P3 public | |
4358 | | |
|
1709 | | | |
4359 | o 3 P2 public |
|
1710 | o 3 P2 public | |
4360 | | |
|
1711 | | | |
4361 | | o 4 D2 draft |
|
1712 | | o 4 D2 draft | |
4362 | | | |
|
1713 | | | | |
4363 | | o 2 D1 draft |
|
1714 | | o 2 D1 draft | |
4364 | |/ |
|
1715 | |/ | |
4365 | o 1 P1 public |
|
1716 | o 1 P1 public | |
4366 | | |
|
1717 | | | |
4367 | o 0 P0 public |
|
1718 | o 0 P0 public | |
4368 |
|
1719 | |||
4369 | $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' |
|
1720 | $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' | |
4370 | * analyzed: |
|
1721 | * analyzed: | |
4371 | (and |
|
1722 | (and | |
4372 | (func |
|
1723 | (func | |
4373 | (symbol 'draft') |
|
1724 | (symbol 'draft') | |
4374 | None) |
|
1725 | None) | |
4375 | (func |
|
1726 | (func | |
4376 | (symbol 'ancestors') |
|
1727 | (symbol 'ancestors') | |
4377 | (or |
|
1728 | (or | |
4378 | (list |
|
1729 | (list | |
4379 | (and |
|
1730 | (and | |
4380 | (or |
|
1731 | (or | |
4381 | (list |
|
1732 | (list | |
4382 | (symbol 'S1') |
|
1733 | (symbol 'S1') | |
4383 | (symbol 'D1') |
|
1734 | (symbol 'D1') | |
4384 | (symbol 'P5'))) |
|
1735 | (symbol 'P5'))) | |
4385 | (not |
|
1736 | (not | |
4386 | (symbol 'D3'))) |
|
1737 | (symbol 'D3'))) | |
4387 | (symbol 'S2'))))) |
|
1738 | (symbol 'S2'))))) | |
4388 | * optimized: |
|
1739 | * optimized: | |
4389 | (func |
|
1740 | (func | |
4390 | (symbol '_phaseandancestors') |
|
1741 | (symbol '_phaseandancestors') | |
4391 | (list |
|
1742 | (list | |
4392 | (symbol 'draft') |
|
1743 | (symbol 'draft') | |
4393 | (or |
|
1744 | (or | |
4394 | (list |
|
1745 | (list | |
4395 | (difference |
|
1746 | (difference | |
4396 | (func |
|
1747 | (func | |
4397 | (symbol '_list') |
|
1748 | (symbol '_list') | |
4398 | (string 'S1\x00D1\x00P5')) |
|
1749 | (string 'S1\x00D1\x00P5')) | |
4399 | (symbol 'D3')) |
|
1750 | (symbol 'D3')) | |
4400 | (symbol 'S2'))))) |
|
1751 | (symbol 'S2'))))) | |
4401 | $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' |
|
1752 | $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' | |
4402 | * analyzed: |
|
1753 | * analyzed: | |
4403 | (and |
|
1754 | (and | |
4404 | (func |
|
1755 | (func | |
4405 | (symbol 'secret') |
|
1756 | (symbol 'secret') | |
4406 | None) |
|
1757 | None) | |
4407 | (func |
|
1758 | (func | |
4408 | (symbol 'ancestors') |
|
1759 | (symbol 'ancestors') | |
4409 | (symbol '9'))) |
|
1760 | (symbol '9'))) | |
4410 | * optimized: |
|
1761 | * optimized: | |
4411 | (func |
|
1762 | (func | |
4412 | (symbol '_phaseandancestors') |
|
1763 | (symbol '_phaseandancestors') | |
4413 | (list |
|
1764 | (list | |
4414 | (symbol 'secret') |
|
1765 | (symbol 'secret') | |
4415 | (symbol '9'))) |
|
1766 | (symbol '9'))) | |
4416 | $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' |
|
1767 | $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' | |
4417 | * analyzed: |
|
1768 | * analyzed: | |
4418 | (and |
|
1769 | (and | |
4419 | (symbol '7') |
|
1770 | (symbol '7') | |
4420 | (and |
|
1771 | (and | |
4421 | (not |
|
1772 | (not | |
4422 | (func |
|
1773 | (func | |
4423 | (symbol 'public') |
|
1774 | (symbol 'public') | |
4424 | None)) |
|
1775 | None)) | |
4425 | (func |
|
1776 | (func | |
4426 | (symbol 'ancestors') |
|
1777 | (symbol 'ancestors') | |
4427 | (func |
|
1778 | (func | |
4428 | (symbol 'tag') |
|
1779 | (symbol 'tag') | |
4429 | None)))) |
|
1780 | None)))) | |
4430 | * optimized: |
|
1781 | * optimized: | |
4431 | (and |
|
1782 | (and | |
4432 | (symbol '7') |
|
1783 | (symbol '7') | |
4433 | (func |
|
1784 | (func | |
4434 | (symbol '_phaseandancestors') |
|
1785 | (symbol '_phaseandancestors') | |
4435 | (list |
|
1786 | (list | |
4436 | (symbol '_notpublic') |
|
1787 | (symbol '_notpublic') | |
4437 | (func |
|
1788 | (func | |
4438 | (symbol 'tag') |
|
1789 | (symbol 'tag') | |
4439 | None)))) |
|
1790 | None)))) | |
4440 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' |
|
1791 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' | |
4441 | * optimized: |
|
1792 | * optimized: | |
4442 | (and |
|
1793 | (and | |
4443 | (func |
|
1794 | (func | |
4444 | (symbol '_notpublic') |
|
1795 | (symbol '_notpublic') | |
4445 | None) |
|
1796 | None) | |
4446 | (func |
|
1797 | (func | |
4447 | (symbol 'ancestors') |
|
1798 | (symbol 'ancestors') | |
4448 | (list |
|
1799 | (list | |
4449 | (func |
|
1800 | (func | |
4450 | (symbol '_list') |
|
1801 | (symbol '_list') | |
4451 | (string 'S1\x00D2\x00P5')) |
|
1802 | (string 'S1\x00D2\x00P5')) | |
4452 | (symbol '1')))) |
|
1803 | (symbol '1')))) | |
4453 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' |
|
1804 | $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' | |
4454 | * optimized: |
|
1805 | * optimized: | |
4455 | (and |
|
1806 | (and | |
4456 | (func |
|
1807 | (func | |
4457 | (symbol '_notpublic') |
|
1808 | (symbol '_notpublic') | |
4458 | None) |
|
1809 | None) | |
4459 | (func |
|
1810 | (func | |
4460 | (symbol 'ancestors') |
|
1811 | (symbol 'ancestors') | |
4461 | (list |
|
1812 | (list | |
4462 | (func |
|
1813 | (func | |
4463 | (symbol '_list') |
|
1814 | (symbol '_list') | |
4464 | (string 'S1\x00D2\x00P5')) |
|
1815 | (string 'S1\x00D2\x00P5')) | |
4465 | (keyvalue |
|
1816 | (keyvalue | |
4466 | (symbol 'depth') |
|
1817 | (symbol 'depth') | |
4467 | (symbol '1'))))) |
|
1818 | (symbol '1'))))) |
General Comments 0
You need to be logged in to leave comments.
Login now