##// END OF EJS Templates
revsets: show current revset abort behavior
Ryan McElroy -
r24707:57f58f96 default
parent child Browse files
Show More
@@ -1,1536 +1,1541
1 $ HGENCODING=utf-8
1 $ HGENCODING=utf-8
2 $ export HGENCODING
2 $ export HGENCODING
3
3
4 $ try() {
4 $ try() {
5 > hg debugrevspec --debug "$@"
5 > hg debugrevspec --debug "$@"
6 > }
6 > }
7
7
8 $ log() {
8 $ log() {
9 > hg log --template '{rev}\n' -r "$1"
9 > hg log --template '{rev}\n' -r "$1"
10 > }
10 > }
11
11
12 $ hg init repo
12 $ hg init repo
13 $ cd repo
13 $ cd repo
14
14
15 $ echo a > a
15 $ echo a > a
16 $ hg branch a
16 $ hg branch a
17 marked working directory as branch a
17 marked working directory as branch a
18 (branches are permanent and global, did you want a bookmark?)
18 (branches are permanent and global, did you want a bookmark?)
19 $ hg ci -Aqm0
19 $ hg ci -Aqm0
20
20
21 $ echo b > b
21 $ echo b > b
22 $ hg branch b
22 $ hg branch b
23 marked working directory as branch b
23 marked working directory as branch b
24 (branches are permanent and global, did you want a bookmark?)
24 (branches are permanent and global, did you want a bookmark?)
25 $ hg ci -Aqm1
25 $ hg ci -Aqm1
26
26
27 $ rm a
27 $ rm a
28 $ hg branch a-b-c-
28 $ hg branch a-b-c-
29 marked working directory as branch a-b-c-
29 marked working directory as branch a-b-c-
30 (branches are permanent and global, did you want a bookmark?)
30 (branches are permanent and global, did you want a bookmark?)
31 $ hg ci -Aqm2 -u Bob
31 $ hg ci -Aqm2 -u Bob
32
32
33 $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
33 $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
34 2
34 2
35 $ hg log -r "extra('branch')" --template '{rev}\n'
35 $ hg log -r "extra('branch')" --template '{rev}\n'
36 0
36 0
37 1
37 1
38 2
38 2
39 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
39 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
40 0 a
40 0 a
41 2 a-b-c-
41 2 a-b-c-
42
42
43 $ hg co 1
43 $ hg co 1
44 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 $ hg branch +a+b+c+
45 $ hg branch +a+b+c+
46 marked working directory as branch +a+b+c+
46 marked working directory as branch +a+b+c+
47 (branches are permanent and global, did you want a bookmark?)
47 (branches are permanent and global, did you want a bookmark?)
48 $ hg ci -Aqm3
48 $ hg ci -Aqm3
49
49
50 $ hg co 2 # interleave
50 $ hg co 2 # interleave
51 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
51 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
52 $ echo bb > b
52 $ echo bb > b
53 $ hg branch -- -a-b-c-
53 $ hg branch -- -a-b-c-
54 marked working directory as branch -a-b-c-
54 marked working directory as branch -a-b-c-
55 (branches are permanent and global, did you want a bookmark?)
55 (branches are permanent and global, did you want a bookmark?)
56 $ hg ci -Aqm4 -d "May 12 2005"
56 $ hg ci -Aqm4 -d "May 12 2005"
57
57
58 $ hg co 3
58 $ hg co 3
59 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
60 $ hg branch !a/b/c/
60 $ hg branch !a/b/c/
61 marked working directory as branch !a/b/c/
61 marked working directory as branch !a/b/c/
62 (branches are permanent and global, did you want a bookmark?)
62 (branches are permanent and global, did you want a bookmark?)
63 $ hg ci -Aqm"5 bug"
63 $ hg ci -Aqm"5 bug"
64
64
65 $ hg merge 4
65 $ hg merge 4
66 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
66 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
67 (branch merge, don't forget to commit)
67 (branch merge, don't forget to commit)
68 $ hg branch _a_b_c_
68 $ hg branch _a_b_c_
69 marked working directory as branch _a_b_c_
69 marked working directory as branch _a_b_c_
70 (branches are permanent and global, did you want a bookmark?)
70 (branches are permanent and global, did you want a bookmark?)
71 $ hg ci -Aqm"6 issue619"
71 $ hg ci -Aqm"6 issue619"
72
72
73 $ hg branch .a.b.c.
73 $ hg branch .a.b.c.
74 marked working directory as branch .a.b.c.
74 marked working directory as branch .a.b.c.
75 (branches are permanent and global, did you want a bookmark?)
75 (branches are permanent and global, did you want a bookmark?)
76 $ hg ci -Aqm7
76 $ hg ci -Aqm7
77
77
78 $ hg branch all
78 $ hg branch all
79 marked working directory as branch all
79 marked working directory as branch all
80 (branches are permanent and global, did you want a bookmark?)
80 (branches are permanent and global, did you want a bookmark?)
81
81
82 $ hg co 4
82 $ hg co 4
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 $ hg branch Γ©
84 $ hg branch Γ©
85 marked working directory as branch \xc3\xa9 (esc)
85 marked working directory as branch \xc3\xa9 (esc)
86 (branches are permanent and global, did you want a bookmark?)
86 (branches are permanent and global, did you want a bookmark?)
87 $ hg ci -Aqm9
87 $ hg ci -Aqm9
88
88
89 $ hg tag -r6 1.0
89 $ hg tag -r6 1.0
90
90
91 $ hg clone --quiet -U -r 7 . ../remote1
91 $ hg clone --quiet -U -r 7 . ../remote1
92 $ hg clone --quiet -U -r 8 . ../remote2
92 $ hg clone --quiet -U -r 8 . ../remote2
93 $ echo "[paths]" >> .hg/hgrc
93 $ echo "[paths]" >> .hg/hgrc
94 $ echo "default = ../remote1" >> .hg/hgrc
94 $ echo "default = ../remote1" >> .hg/hgrc
95
95
96 trivial
96 trivial
97
97
98 $ try 0:1
98 $ try 0:1
99 (range
99 (range
100 ('symbol', '0')
100 ('symbol', '0')
101 ('symbol', '1'))
101 ('symbol', '1'))
102 * set:
102 * set:
103 <spanset+ 0:1>
103 <spanset+ 0:1>
104 0
104 0
105 1
105 1
106 $ try 3::6
106 $ try 3::6
107 (dagrange
107 (dagrange
108 ('symbol', '3')
108 ('symbol', '3')
109 ('symbol', '6'))
109 ('symbol', '6'))
110 * set:
110 * set:
111 <baseset [3, 5, 6]>
111 <baseset [3, 5, 6]>
112 3
112 3
113 5
113 5
114 6
114 6
115 $ try '0|1|2'
115 $ try '0|1|2'
116 (or
116 (or
117 (or
117 (or
118 ('symbol', '0')
118 ('symbol', '0')
119 ('symbol', '1'))
119 ('symbol', '1'))
120 ('symbol', '2'))
120 ('symbol', '2'))
121 * set:
121 * set:
122 <addset
122 <addset
123 <addset
123 <addset
124 <baseset [0]>,
124 <baseset [0]>,
125 <baseset [1]>>,
125 <baseset [1]>>,
126 <baseset [2]>>
126 <baseset [2]>>
127 0
127 0
128 1
128 1
129 2
129 2
130
130
131 names that should work without quoting
131 names that should work without quoting
132
132
133 $ try a
133 $ try a
134 ('symbol', 'a')
134 ('symbol', 'a')
135 * set:
135 * set:
136 <baseset [0]>
136 <baseset [0]>
137 0
137 0
138 $ try b-a
138 $ try b-a
139 (minus
139 (minus
140 ('symbol', 'b')
140 ('symbol', 'b')
141 ('symbol', 'a'))
141 ('symbol', 'a'))
142 * set:
142 * set:
143 <filteredset
143 <filteredset
144 <baseset [1]>>
144 <baseset [1]>>
145 1
145 1
146 $ try _a_b_c_
146 $ try _a_b_c_
147 ('symbol', '_a_b_c_')
147 ('symbol', '_a_b_c_')
148 * set:
148 * set:
149 <baseset [6]>
149 <baseset [6]>
150 6
150 6
151 $ try _a_b_c_-a
151 $ try _a_b_c_-a
152 (minus
152 (minus
153 ('symbol', '_a_b_c_')
153 ('symbol', '_a_b_c_')
154 ('symbol', 'a'))
154 ('symbol', 'a'))
155 * set:
155 * set:
156 <filteredset
156 <filteredset
157 <baseset [6]>>
157 <baseset [6]>>
158 6
158 6
159 $ try .a.b.c.
159 $ try .a.b.c.
160 ('symbol', '.a.b.c.')
160 ('symbol', '.a.b.c.')
161 * set:
161 * set:
162 <baseset [7]>
162 <baseset [7]>
163 7
163 7
164 $ try .a.b.c.-a
164 $ try .a.b.c.-a
165 (minus
165 (minus
166 ('symbol', '.a.b.c.')
166 ('symbol', '.a.b.c.')
167 ('symbol', 'a'))
167 ('symbol', 'a'))
168 * set:
168 * set:
169 <filteredset
169 <filteredset
170 <baseset [7]>>
170 <baseset [7]>>
171 7
171 7
172 $ try -- '-a-b-c-' # complains
172 $ try -- '-a-b-c-' # complains
173 hg: parse error at 7: not a prefix: end
173 hg: parse error at 7: not a prefix: end
174 [255]
174 [255]
175 $ log -a-b-c- # succeeds with fallback
175 $ log -a-b-c- # succeeds with fallback
176 4
176 4
177
177
178 $ try -- -a-b-c--a # complains
178 $ try -- -a-b-c--a # complains
179 (minus
179 (minus
180 (minus
180 (minus
181 (minus
181 (minus
182 (negate
182 (negate
183 ('symbol', 'a'))
183 ('symbol', 'a'))
184 ('symbol', 'b'))
184 ('symbol', 'b'))
185 ('symbol', 'c'))
185 ('symbol', 'c'))
186 (negate
186 (negate
187 ('symbol', 'a')))
187 ('symbol', 'a')))
188 abort: unknown revision '-a'!
188 abort: unknown revision '-a'!
189 [255]
189 [255]
190 $ try Γ©
190 $ try Γ©
191 ('symbol', '\xc3\xa9')
191 ('symbol', '\xc3\xa9')
192 * set:
192 * set:
193 <baseset [9]>
193 <baseset [9]>
194 9
194 9
195
195
196 no quoting needed
196 no quoting needed
197
197
198 $ log ::a-b-c-
198 $ log ::a-b-c-
199 0
199 0
200 1
200 1
201 2
201 2
202
202
203 quoting needed
203 quoting needed
204
204
205 $ try '"-a-b-c-"-a'
205 $ try '"-a-b-c-"-a'
206 (minus
206 (minus
207 ('string', '-a-b-c-')
207 ('string', '-a-b-c-')
208 ('symbol', 'a'))
208 ('symbol', 'a'))
209 * set:
209 * set:
210 <filteredset
210 <filteredset
211 <baseset [4]>>
211 <baseset [4]>>
212 4
212 4
213
213
214 $ log '1 or 2'
214 $ log '1 or 2'
215 1
215 1
216 2
216 2
217 $ log '1|2'
217 $ log '1|2'
218 1
218 1
219 2
219 2
220 $ log '1 and 2'
220 $ log '1 and 2'
221 $ log '1&2'
221 $ log '1&2'
222 $ try '1&2|3' # precedence - and is higher
222 $ try '1&2|3' # precedence - and is higher
223 (or
223 (or
224 (and
224 (and
225 ('symbol', '1')
225 ('symbol', '1')
226 ('symbol', '2'))
226 ('symbol', '2'))
227 ('symbol', '3'))
227 ('symbol', '3'))
228 * set:
228 * set:
229 <addset
229 <addset
230 <baseset []>,
230 <baseset []>,
231 <baseset [3]>>
231 <baseset [3]>>
232 3
232 3
233 $ try '1|2&3'
233 $ try '1|2&3'
234 (or
234 (or
235 ('symbol', '1')
235 ('symbol', '1')
236 (and
236 (and
237 ('symbol', '2')
237 ('symbol', '2')
238 ('symbol', '3')))
238 ('symbol', '3')))
239 * set:
239 * set:
240 <addset
240 <addset
241 <baseset [1]>,
241 <baseset [1]>,
242 <baseset []>>
242 <baseset []>>
243 1
243 1
244 $ try '1&2&3' # associativity
244 $ try '1&2&3' # associativity
245 (and
245 (and
246 (and
246 (and
247 ('symbol', '1')
247 ('symbol', '1')
248 ('symbol', '2'))
248 ('symbol', '2'))
249 ('symbol', '3'))
249 ('symbol', '3'))
250 * set:
250 * set:
251 <baseset []>
251 <baseset []>
252 $ try '1|(2|3)'
252 $ try '1|(2|3)'
253 (or
253 (or
254 ('symbol', '1')
254 ('symbol', '1')
255 (group
255 (group
256 (or
256 (or
257 ('symbol', '2')
257 ('symbol', '2')
258 ('symbol', '3'))))
258 ('symbol', '3'))))
259 * set:
259 * set:
260 <addset
260 <addset
261 <baseset [1]>,
261 <baseset [1]>,
262 <addset
262 <addset
263 <baseset [2]>,
263 <baseset [2]>,
264 <baseset [3]>>>
264 <baseset [3]>>>
265 1
265 1
266 2
266 2
267 3
267 3
268 $ log '1.0' # tag
268 $ log '1.0' # tag
269 6
269 6
270 $ log 'a' # branch
270 $ log 'a' # branch
271 0
271 0
272 $ log '2785f51ee'
272 $ log '2785f51ee'
273 0
273 0
274 $ log 'date(2005)'
274 $ log 'date(2005)'
275 4
275 4
276 $ log 'date(this is a test)'
276 $ log 'date(this is a test)'
277 hg: parse error at 10: unexpected token: symbol
277 hg: parse error at 10: unexpected token: symbol
278 [255]
278 [255]
279 $ log 'date()'
279 $ log 'date()'
280 hg: parse error: date requires a string
280 hg: parse error: date requires a string
281 [255]
281 [255]
282 $ log 'date'
282 $ log 'date'
283 hg: parse error: can't use date here
283 hg: parse error: can't use date here
284 [255]
284 [255]
285 $ log 'date('
285 $ log 'date('
286 hg: parse error at 5: not a prefix: end
286 hg: parse error at 5: not a prefix: end
287 [255]
287 [255]
288 $ log 'date(tip)'
288 $ log 'date(tip)'
289 abort: invalid date: 'tip'
289 abort: invalid date: 'tip'
290 [255]
290 [255]
291 $ log '"date"'
291 $ log '"date"'
292 abort: unknown revision 'date'!
292 abort: unknown revision 'date'!
293 [255]
293 [255]
294 $ log 'date(2005) and 1::'
294 $ log 'date(2005) and 1::'
295 4
295 4
296
296
297 ancestor can accept 0 or more arguments
297 ancestor can accept 0 or more arguments
298
298
299 $ log 'ancestor()'
299 $ log 'ancestor()'
300 $ log 'ancestor(1)'
300 $ log 'ancestor(1)'
301 1
301 1
302 $ log 'ancestor(4,5)'
302 $ log 'ancestor(4,5)'
303 1
303 1
304 $ log 'ancestor(4,5) and 4'
304 $ log 'ancestor(4,5) and 4'
305 $ log 'ancestor(0,0,1,3)'
305 $ log 'ancestor(0,0,1,3)'
306 0
306 0
307 $ log 'ancestor(3,1,5,3,5,1)'
307 $ log 'ancestor(3,1,5,3,5,1)'
308 1
308 1
309 $ log 'ancestor(0,1,3,5)'
309 $ log 'ancestor(0,1,3,5)'
310 0
310 0
311 $ log 'ancestor(1,2,3,4,5)'
311 $ log 'ancestor(1,2,3,4,5)'
312 1
312 1
313 $ log 'ancestors(5)'
313 $ log 'ancestors(5)'
314 0
314 0
315 1
315 1
316 3
316 3
317 5
317 5
318 $ log 'ancestor(ancestors(5))'
318 $ log 'ancestor(ancestors(5))'
319 0
319 0
320 $ log 'author(bob)'
320 $ log 'author(bob)'
321 2
321 2
322 $ log 'author("re:bob|test")'
322 $ log 'author("re:bob|test")'
323 0
323 0
324 1
324 1
325 2
325 2
326 3
326 3
327 4
327 4
328 5
328 5
329 6
329 6
330 7
330 7
331 8
331 8
332 9
332 9
333 $ log 'branch(Γ©)'
333 $ log 'branch(Γ©)'
334 8
334 8
335 9
335 9
336 $ log 'branch(a)'
336 $ log 'branch(a)'
337 0
337 0
338 $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
338 $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
339 0 a
339 0 a
340 2 a-b-c-
340 2 a-b-c-
341 3 +a+b+c+
341 3 +a+b+c+
342 4 -a-b-c-
342 4 -a-b-c-
343 5 !a/b/c/
343 5 !a/b/c/
344 6 _a_b_c_
344 6 _a_b_c_
345 7 .a.b.c.
345 7 .a.b.c.
346 $ log 'children(ancestor(4,5))'
346 $ log 'children(ancestor(4,5))'
347 2
347 2
348 3
348 3
349 $ log 'closed()'
349 $ log 'closed()'
350 $ log 'contains(a)'
350 $ log 'contains(a)'
351 0
351 0
352 1
352 1
353 3
353 3
354 5
354 5
355 $ log 'contains("../repo/a")'
355 $ log 'contains("../repo/a")'
356 0
356 0
357 1
357 1
358 3
358 3
359 5
359 5
360 $ log 'desc(B)'
360 $ log 'desc(B)'
361 5
361 5
362 $ log 'descendants(2 or 3)'
362 $ log 'descendants(2 or 3)'
363 2
363 2
364 3
364 3
365 4
365 4
366 5
366 5
367 6
367 6
368 7
368 7
369 8
369 8
370 9
370 9
371 $ log 'file("b*")'
371 $ log 'file("b*")'
372 1
372 1
373 4
373 4
374 $ log 'filelog("b")'
374 $ log 'filelog("b")'
375 1
375 1
376 4
376 4
377 $ log 'filelog("../repo/b")'
377 $ log 'filelog("../repo/b")'
378 1
378 1
379 4
379 4
380 $ log 'follow()'
380 $ log 'follow()'
381 0
381 0
382 1
382 1
383 2
383 2
384 4
384 4
385 8
385 8
386 9
386 9
387 $ log 'grep("issue\d+")'
387 $ log 'grep("issue\d+")'
388 6
388 6
389 $ try 'grep("(")' # invalid regular expression
389 $ try 'grep("(")' # invalid regular expression
390 (func
390 (func
391 ('symbol', 'grep')
391 ('symbol', 'grep')
392 ('string', '('))
392 ('string', '('))
393 hg: parse error: invalid match pattern: unbalanced parenthesis
393 hg: parse error: invalid match pattern: unbalanced parenthesis
394 [255]
394 [255]
395 $ try 'grep("\bissue\d+")'
395 $ try 'grep("\bissue\d+")'
396 (func
396 (func
397 ('symbol', 'grep')
397 ('symbol', 'grep')
398 ('string', '\x08issue\\d+'))
398 ('string', '\x08issue\\d+'))
399 * set:
399 * set:
400 <filteredset
400 <filteredset
401 <fullreposet+ 0:9>>
401 <fullreposet+ 0:9>>
402 $ try 'grep(r"\bissue\d+")'
402 $ try 'grep(r"\bissue\d+")'
403 (func
403 (func
404 ('symbol', 'grep')
404 ('symbol', 'grep')
405 ('string', '\\bissue\\d+'))
405 ('string', '\\bissue\\d+'))
406 * set:
406 * set:
407 <filteredset
407 <filteredset
408 <fullreposet+ 0:9>>
408 <fullreposet+ 0:9>>
409 6
409 6
410 $ try 'grep(r"\")'
410 $ try 'grep(r"\")'
411 hg: parse error at 7: unterminated string
411 hg: parse error at 7: unterminated string
412 [255]
412 [255]
413 $ log 'head()'
413 $ log 'head()'
414 0
414 0
415 1
415 1
416 2
416 2
417 3
417 3
418 4
418 4
419 5
419 5
420 6
420 6
421 7
421 7
422 9
422 9
423 $ log 'heads(6::)'
423 $ log 'heads(6::)'
424 7
424 7
425 $ log 'keyword(issue)'
425 $ log 'keyword(issue)'
426 6
426 6
427 $ log 'keyword("test a")'
427 $ log 'keyword("test a")'
428 $ log 'limit(head(), 1)'
428 $ log 'limit(head(), 1)'
429 0
429 0
430 $ log 'matching(6)'
430 $ log 'matching(6)'
431 6
431 6
432 $ log 'matching(6:7, "phase parents user date branch summary files description substate")'
432 $ log 'matching(6:7, "phase parents user date branch summary files description substate")'
433 6
433 6
434 7
434 7
435
435
436 Testing min and max
436 Testing min and max
437
437
438 max: simple
438 max: simple
439
439
440 $ log 'max(contains(a))'
440 $ log 'max(contains(a))'
441 5
441 5
442
442
443 max: simple on unordered set)
443 max: simple on unordered set)
444
444
445 $ log 'max((4+0+2+5+7) and contains(a))'
445 $ log 'max((4+0+2+5+7) and contains(a))'
446 5
446 5
447
447
448 max: no result
448 max: no result
449
449
450 $ log 'max(contains(stringthatdoesnotappearanywhere))'
450 $ log 'max(contains(stringthatdoesnotappearanywhere))'
451
451
452 max: no result on unordered set
452 max: no result on unordered set
453
453
454 $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
454 $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
455
455
456 min: simple
456 min: simple
457
457
458 $ log 'min(contains(a))'
458 $ log 'min(contains(a))'
459 0
459 0
460
460
461 min: simple on unordered set
461 min: simple on unordered set
462
462
463 $ log 'min((4+0+2+5+7) and contains(a))'
463 $ log 'min((4+0+2+5+7) and contains(a))'
464 0
464 0
465
465
466 min: empty
466 min: empty
467
467
468 $ log 'min(contains(stringthatdoesnotappearanywhere))'
468 $ log 'min(contains(stringthatdoesnotappearanywhere))'
469
469
470 min: empty on unordered set
470 min: empty on unordered set
471
471
472 $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
472 $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
473
473
474
474
475 $ log 'merge()'
475 $ log 'merge()'
476 6
476 6
477 $ log 'branchpoint()'
477 $ log 'branchpoint()'
478 1
478 1
479 4
479 4
480 $ log 'modifies(b)'
480 $ log 'modifies(b)'
481 4
481 4
482 $ log 'modifies("path:b")'
482 $ log 'modifies("path:b")'
483 4
483 4
484 $ log 'modifies("*")'
484 $ log 'modifies("*")'
485 4
485 4
486 6
486 6
487 $ log 'modifies("set:modified()")'
487 $ log 'modifies("set:modified()")'
488 4
488 4
489 $ log 'id(5)'
489 $ log 'id(5)'
490 2
490 2
491 $ log 'only(9)'
491 $ log 'only(9)'
492 8
492 8
493 9
493 9
494 $ log 'only(8)'
494 $ log 'only(8)'
495 8
495 8
496 $ log 'only(9, 5)'
496 $ log 'only(9, 5)'
497 2
497 2
498 4
498 4
499 8
499 8
500 9
500 9
501 $ log 'only(7 + 9, 5 + 2)'
501 $ log 'only(7 + 9, 5 + 2)'
502 4
502 4
503 6
503 6
504 7
504 7
505 8
505 8
506 9
506 9
507
507
508 Test empty set input
508 Test empty set input
509 $ log 'only(p2())'
509 $ log 'only(p2())'
510 $ log 'only(p1(), p2())'
510 $ log 'only(p1(), p2())'
511 0
511 0
512 1
512 1
513 2
513 2
514 4
514 4
515 8
515 8
516 9
516 9
517
517
518 Test '%' operator
518 Test '%' operator
519
519
520 $ log '9%'
520 $ log '9%'
521 8
521 8
522 9
522 9
523 $ log '9%5'
523 $ log '9%5'
524 2
524 2
525 4
525 4
526 8
526 8
527 9
527 9
528 $ log '(7 + 9)%(5 + 2)'
528 $ log '(7 + 9)%(5 + 2)'
529 4
529 4
530 6
530 6
531 7
531 7
532 8
532 8
533 9
533 9
534
534
535 Test the order of operations
535 Test the order of operations
536
536
537 $ log '7 + 9%5 + 2'
537 $ log '7 + 9%5 + 2'
538 7
538 7
539 2
539 2
540 4
540 4
541 8
541 8
542 9
542 9
543
543
544 Test explicit numeric revision
544 Test explicit numeric revision
545 $ log 'rev(-2)'
545 $ log 'rev(-2)'
546 $ log 'rev(-1)'
546 $ log 'rev(-1)'
547 -1
547 -1
548 $ log 'rev(0)'
548 $ log 'rev(0)'
549 0
549 0
550 $ log 'rev(9)'
550 $ log 'rev(9)'
551 9
551 9
552 $ log 'rev(10)'
552 $ log 'rev(10)'
553 $ log 'rev(tip)'
553 $ log 'rev(tip)'
554 hg: parse error: rev expects a number
554 hg: parse error: rev expects a number
555 [255]
555 [255]
556
556
557 Test null revision
557 Test null revision
558 $ log '(null)'
558 $ log '(null)'
559 -1
559 -1
560 $ log '(null:0)'
560 $ log '(null:0)'
561 -1
561 -1
562 0
562 0
563 $ log '(0:null)'
563 $ log '(0:null)'
564 0
564 0
565 -1
565 -1
566 $ log 'null::0'
566 $ log 'null::0'
567 -1
567 -1
568 0
568 0
569 $ log 'null:tip - 0:'
569 $ log 'null:tip - 0:'
570 -1
570 -1
571 $ log 'null: and null::' | head -1
571 $ log 'null: and null::' | head -1
572 -1
572 -1
573 $ log 'null: or 0:' | head -2
573 $ log 'null: or 0:' | head -2
574 -1
574 -1
575 0
575 0
576 $ log 'ancestors(null)'
576 $ log 'ancestors(null)'
577 -1
577 -1
578 $ log 'reverse(null:)' | tail -2
578 $ log 'reverse(null:)' | tail -2
579 0
579 0
580 -1
580 -1
581 $ log 'first(null:)'
581 $ log 'first(null:)'
582 -1
582 -1
583 $ log 'min(null:)'
583 $ log 'min(null:)'
584 -1
584 -1
585 $ log 'tip:null and all()' | tail -2
585 $ log 'tip:null and all()' | tail -2
586 1
586 1
587 0
587 0
588
588
589 Test working-directory revision
589 Test working-directory revision
590 $ hg debugrevspec 'wdir()'
590 $ hg debugrevspec 'wdir()'
591 None
591 None
592 $ hg debugrevspec 'tip or wdir()'
592 $ hg debugrevspec 'tip or wdir()'
593 9
593 9
594 None
594 None
595 $ hg debugrevspec '0:tip and wdir()'
595 $ hg debugrevspec '0:tip and wdir()'
596
596
597 $ log 'outgoing()'
597 $ log 'outgoing()'
598 8
598 8
599 9
599 9
600 $ log 'outgoing("../remote1")'
600 $ log 'outgoing("../remote1")'
601 8
601 8
602 9
602 9
603 $ log 'outgoing("../remote2")'
603 $ log 'outgoing("../remote2")'
604 3
604 3
605 5
605 5
606 6
606 6
607 7
607 7
608 9
608 9
609 $ log 'p1(merge())'
609 $ log 'p1(merge())'
610 5
610 5
611 $ log 'p2(merge())'
611 $ log 'p2(merge())'
612 4
612 4
613 $ log 'parents(merge())'
613 $ log 'parents(merge())'
614 4
614 4
615 5
615 5
616 $ log 'p1(branchpoint())'
616 $ log 'p1(branchpoint())'
617 0
617 0
618 2
618 2
619 $ log 'p2(branchpoint())'
619 $ log 'p2(branchpoint())'
620 $ log 'parents(branchpoint())'
620 $ log 'parents(branchpoint())'
621 0
621 0
622 2
622 2
623 $ log 'removes(a)'
623 $ log 'removes(a)'
624 2
624 2
625 6
625 6
626 $ log 'roots(all())'
626 $ log 'roots(all())'
627 0
627 0
628 $ log 'reverse(2 or 3 or 4 or 5)'
628 $ log 'reverse(2 or 3 or 4 or 5)'
629 5
629 5
630 4
630 4
631 3
631 3
632 2
632 2
633 $ log 'reverse(all())'
633 $ log 'reverse(all())'
634 9
634 9
635 8
635 8
636 7
636 7
637 6
637 6
638 5
638 5
639 4
639 4
640 3
640 3
641 2
641 2
642 1
642 1
643 0
643 0
644 $ log 'reverse(all()) & filelog(b)'
644 $ log 'reverse(all()) & filelog(b)'
645 4
645 4
646 1
646 1
647 $ log 'rev(5)'
647 $ log 'rev(5)'
648 5
648 5
649 $ log 'sort(limit(reverse(all()), 3))'
649 $ log 'sort(limit(reverse(all()), 3))'
650 7
650 7
651 8
651 8
652 9
652 9
653 $ log 'sort(2 or 3 or 4 or 5, date)'
653 $ log 'sort(2 or 3 or 4 or 5, date)'
654 2
654 2
655 3
655 3
656 5
656 5
657 4
657 4
658 $ log 'tagged()'
658 $ log 'tagged()'
659 6
659 6
660 $ log 'tag()'
660 $ log 'tag()'
661 6
661 6
662 $ log 'tag(1.0)'
662 $ log 'tag(1.0)'
663 6
663 6
664 $ log 'tag(tip)'
664 $ log 'tag(tip)'
665 9
665 9
666
666
667 test sort revset
667 test sort revset
668 --------------------------------------------
668 --------------------------------------------
669
669
670 test when adding two unordered revsets
670 test when adding two unordered revsets
671
671
672 $ log 'sort(keyword(issue) or modifies(b))'
672 $ log 'sort(keyword(issue) or modifies(b))'
673 4
673 4
674 6
674 6
675
675
676 test when sorting a reversed collection in the same way it is
676 test when sorting a reversed collection in the same way it is
677
677
678 $ log 'sort(reverse(all()), -rev)'
678 $ log 'sort(reverse(all()), -rev)'
679 9
679 9
680 8
680 8
681 7
681 7
682 6
682 6
683 5
683 5
684 4
684 4
685 3
685 3
686 2
686 2
687 1
687 1
688 0
688 0
689
689
690 test when sorting a reversed collection
690 test when sorting a reversed collection
691
691
692 $ log 'sort(reverse(all()), rev)'
692 $ log 'sort(reverse(all()), rev)'
693 0
693 0
694 1
694 1
695 2
695 2
696 3
696 3
697 4
697 4
698 5
698 5
699 6
699 6
700 7
700 7
701 8
701 8
702 9
702 9
703
703
704
704
705 test sorting two sorted collections in different orders
705 test sorting two sorted collections in different orders
706
706
707 $ log 'sort(outgoing() or reverse(removes(a)), rev)'
707 $ log 'sort(outgoing() or reverse(removes(a)), rev)'
708 2
708 2
709 6
709 6
710 8
710 8
711 9
711 9
712
712
713 test sorting two sorted collections in different orders backwards
713 test sorting two sorted collections in different orders backwards
714
714
715 $ log 'sort(outgoing() or reverse(removes(a)), -rev)'
715 $ log 'sort(outgoing() or reverse(removes(a)), -rev)'
716 9
716 9
717 8
717 8
718 6
718 6
719 2
719 2
720
720
721 test subtracting something from an addset
721 test subtracting something from an addset
722
722
723 $ log '(outgoing() or removes(a)) - removes(a)'
723 $ log '(outgoing() or removes(a)) - removes(a)'
724 8
724 8
725 9
725 9
726
726
727 test intersecting something with an addset
727 test intersecting something with an addset
728
728
729 $ log 'parents(outgoing() or removes(a))'
729 $ log 'parents(outgoing() or removes(a))'
730 1
730 1
731 4
731 4
732 5
732 5
733 8
733 8
734
734
735 test that `or` operation combines elements in the right order:
735 test that `or` operation combines elements in the right order:
736
736
737 $ log '3:4 or 2:5'
737 $ log '3:4 or 2:5'
738 3
738 3
739 4
739 4
740 2
740 2
741 5
741 5
742 $ log '3:4 or 5:2'
742 $ log '3:4 or 5:2'
743 3
743 3
744 4
744 4
745 5
745 5
746 2
746 2
747 $ log 'sort(3:4 or 2:5)'
747 $ log 'sort(3:4 or 2:5)'
748 2
748 2
749 3
749 3
750 4
750 4
751 5
751 5
752 $ log 'sort(3:4 or 5:2)'
752 $ log 'sort(3:4 or 5:2)'
753 2
753 2
754 3
754 3
755 4
755 4
756 5
756 5
757
757
758 check that conversion to only works
758 check that conversion to only works
759 $ try --optimize '::3 - ::1'
759 $ try --optimize '::3 - ::1'
760 (minus
760 (minus
761 (dagrangepre
761 (dagrangepre
762 ('symbol', '3'))
762 ('symbol', '3'))
763 (dagrangepre
763 (dagrangepre
764 ('symbol', '1')))
764 ('symbol', '1')))
765 * optimized:
765 * optimized:
766 (func
766 (func
767 ('symbol', 'only')
767 ('symbol', 'only')
768 (list
768 (list
769 ('symbol', '3')
769 ('symbol', '3')
770 ('symbol', '1')))
770 ('symbol', '1')))
771 * set:
771 * set:
772 <baseset+ [3]>
772 <baseset+ [3]>
773 3
773 3
774 $ try --optimize 'ancestors(1) - ancestors(3)'
774 $ try --optimize 'ancestors(1) - ancestors(3)'
775 (minus
775 (minus
776 (func
776 (func
777 ('symbol', 'ancestors')
777 ('symbol', 'ancestors')
778 ('symbol', '1'))
778 ('symbol', '1'))
779 (func
779 (func
780 ('symbol', 'ancestors')
780 ('symbol', 'ancestors')
781 ('symbol', '3')))
781 ('symbol', '3')))
782 * optimized:
782 * optimized:
783 (func
783 (func
784 ('symbol', 'only')
784 ('symbol', 'only')
785 (list
785 (list
786 ('symbol', '1')
786 ('symbol', '1')
787 ('symbol', '3')))
787 ('symbol', '3')))
788 * set:
788 * set:
789 <baseset+ []>
789 <baseset+ []>
790 $ try --optimize 'not ::2 and ::6'
790 $ try --optimize 'not ::2 and ::6'
791 (and
791 (and
792 (not
792 (not
793 (dagrangepre
793 (dagrangepre
794 ('symbol', '2')))
794 ('symbol', '2')))
795 (dagrangepre
795 (dagrangepre
796 ('symbol', '6')))
796 ('symbol', '6')))
797 * optimized:
797 * optimized:
798 (func
798 (func
799 ('symbol', 'only')
799 ('symbol', 'only')
800 (list
800 (list
801 ('symbol', '6')
801 ('symbol', '6')
802 ('symbol', '2')))
802 ('symbol', '2')))
803 * set:
803 * set:
804 <baseset+ [3, 4, 5, 6]>
804 <baseset+ [3, 4, 5, 6]>
805 3
805 3
806 4
806 4
807 5
807 5
808 6
808 6
809 $ try --optimize 'ancestors(6) and not ancestors(4)'
809 $ try --optimize 'ancestors(6) and not ancestors(4)'
810 (and
810 (and
811 (func
811 (func
812 ('symbol', 'ancestors')
812 ('symbol', 'ancestors')
813 ('symbol', '6'))
813 ('symbol', '6'))
814 (not
814 (not
815 (func
815 (func
816 ('symbol', 'ancestors')
816 ('symbol', 'ancestors')
817 ('symbol', '4'))))
817 ('symbol', '4'))))
818 * optimized:
818 * optimized:
819 (func
819 (func
820 ('symbol', 'only')
820 ('symbol', 'only')
821 (list
821 (list
822 ('symbol', '6')
822 ('symbol', '6')
823 ('symbol', '4')))
823 ('symbol', '4')))
824 * set:
824 * set:
825 <baseset+ [3, 5, 6]>
825 <baseset+ [3, 5, 6]>
826 3
826 3
827 5
827 5
828 6
828 6
829
829
830 we can use patterns when searching for tags
830 we can use patterns when searching for tags
831
831
832 $ log 'tag("1..*")'
832 $ log 'tag("1..*")'
833 abort: tag '1..*' does not exist!
833 abort: tag '1..*' does not exist!
834 [255]
834 [255]
835 $ log 'tag("re:1..*")'
835 $ log 'tag("re:1..*")'
836 6
836 6
837 $ log 'tag("re:[0-9].[0-9]")'
837 $ log 'tag("re:[0-9].[0-9]")'
838 6
838 6
839 $ log 'tag("literal:1.0")'
839 $ log 'tag("literal:1.0")'
840 6
840 6
841 $ log 'tag("re:0..*")'
841 $ log 'tag("re:0..*")'
842
842
843 $ log 'tag(unknown)'
843 $ log 'tag(unknown)'
844 abort: tag 'unknown' does not exist!
844 abort: tag 'unknown' does not exist!
845 [255]
845 [255]
846 $ log 'tag("re:unknown")'
846 $ log 'tag("re:unknown")'
847 $ log 'present(tag("unknown"))'
847 $ log 'present(tag("unknown"))'
848 $ log 'present(tag("re:unknown"))'
848 $ log 'present(tag("re:unknown"))'
849 $ log 'branch(unknown)'
849 $ log 'branch(unknown)'
850 abort: unknown revision 'unknown'!
850 abort: unknown revision 'unknown'!
851 [255]
851 [255]
852 $ log 'branch("re:unknown")'
852 $ log 'branch("re:unknown")'
853 $ log 'present(branch("unknown"))'
853 $ log 'present(branch("unknown"))'
854 $ log 'present(branch("re:unknown"))'
854 $ log 'present(branch("re:unknown"))'
855 $ log 'user(bob)'
855 $ log 'user(bob)'
856 2
856 2
857
857
858 $ log '4::8'
858 $ log '4::8'
859 4
859 4
860 8
860 8
861 $ log '4:8'
861 $ log '4:8'
862 4
862 4
863 5
863 5
864 6
864 6
865 7
865 7
866 8
866 8
867
867
868 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
868 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
869 4
869 4
870 2
870 2
871 5
871 5
872
872
873 $ log 'not 0 and 0:2'
873 $ log 'not 0 and 0:2'
874 1
874 1
875 2
875 2
876 $ log 'not 1 and 0:2'
876 $ log 'not 1 and 0:2'
877 0
877 0
878 2
878 2
879 $ log 'not 2 and 0:2'
879 $ log 'not 2 and 0:2'
880 0
880 0
881 1
881 1
882 $ log '(1 and 2)::'
882 $ log '(1 and 2)::'
883 $ log '(1 and 2):'
883 $ log '(1 and 2):'
884 $ log '(1 and 2):3'
884 $ log '(1 and 2):3'
885 $ log 'sort(head(), -rev)'
885 $ log 'sort(head(), -rev)'
886 9
886 9
887 7
887 7
888 6
888 6
889 5
889 5
890 4
890 4
891 3
891 3
892 2
892 2
893 1
893 1
894 0
894 0
895 $ log '4::8 - 8'
895 $ log '4::8 - 8'
896 4
896 4
897 $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
897 $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
898 2
898 2
899 3
899 3
900 1
900 1
901
901
902 $ log 'named("unknown")'
902 $ log 'named("unknown")'
903 abort: namespace 'unknown' does not exist!
903 abort: namespace 'unknown' does not exist!
904 [255]
904 [255]
905 $ log 'named("re:unknown")'
905 $ log 'named("re:unknown")'
906 abort: no namespace exists that match 'unknown'!
906 abort: no namespace exists that match 'unknown'!
907 [255]
907 [255]
908 $ log 'present(named("unknown"))'
908 $ log 'present(named("unknown"))'
909 $ log 'present(named("re:unknown"))'
909 $ log 'present(named("re:unknown"))'
910
910
911 $ log 'tag()'
911 $ log 'tag()'
912 6
912 6
913 $ log 'named("tags")'
913 $ log 'named("tags")'
914 6
914 6
915
915
916 issue2437
916 issue2437
917
917
918 $ log '3 and p1(5)'
918 $ log '3 and p1(5)'
919 3
919 3
920 $ log '4 and p2(6)'
920 $ log '4 and p2(6)'
921 4
921 4
922 $ log '1 and parents(:2)'
922 $ log '1 and parents(:2)'
923 1
923 1
924 $ log '2 and children(1:)'
924 $ log '2 and children(1:)'
925 2
925 2
926 $ log 'roots(all()) or roots(all())'
926 $ log 'roots(all()) or roots(all())'
927 0
927 0
928 $ hg debugrevspec 'roots(all()) or roots(all())'
928 $ hg debugrevspec 'roots(all()) or roots(all())'
929 0
929 0
930 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
930 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
931 9
931 9
932 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
932 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
933 4
933 4
934
934
935 issue2654: report a parse error if the revset was not completely parsed
935 issue2654: report a parse error if the revset was not completely parsed
936
936
937 $ log '1 OR 2'
937 $ log '1 OR 2'
938 hg: parse error at 2: invalid token
938 hg: parse error at 2: invalid token
939 [255]
939 [255]
940
940
941 or operator should preserve ordering:
941 or operator should preserve ordering:
942 $ log 'reverse(2::4) or tip'
942 $ log 'reverse(2::4) or tip'
943 4
943 4
944 2
944 2
945 9
945 9
946
946
947 parentrevspec
947 parentrevspec
948
948
949 $ log 'merge()^0'
949 $ log 'merge()^0'
950 6
950 6
951 $ log 'merge()^'
951 $ log 'merge()^'
952 5
952 5
953 $ log 'merge()^1'
953 $ log 'merge()^1'
954 5
954 5
955 $ log 'merge()^2'
955 $ log 'merge()^2'
956 4
956 4
957 $ log 'merge()^^'
957 $ log 'merge()^^'
958 3
958 3
959 $ log 'merge()^1^'
959 $ log 'merge()^1^'
960 3
960 3
961 $ log 'merge()^^^'
961 $ log 'merge()^^^'
962 1
962 1
963
963
964 $ log 'merge()~0'
964 $ log 'merge()~0'
965 6
965 6
966 $ log 'merge()~1'
966 $ log 'merge()~1'
967 5
967 5
968 $ log 'merge()~2'
968 $ log 'merge()~2'
969 3
969 3
970 $ log 'merge()~2^1'
970 $ log 'merge()~2^1'
971 1
971 1
972 $ log 'merge()~3'
972 $ log 'merge()~3'
973 1
973 1
974
974
975 $ log '(-3:tip)^'
975 $ log '(-3:tip)^'
976 4
976 4
977 6
977 6
978 8
978 8
979
979
980 $ log 'tip^foo'
980 $ log 'tip^foo'
981 hg: parse error: ^ expects a number 0, 1, or 2
981 hg: parse error: ^ expects a number 0, 1, or 2
982 [255]
982 [255]
983
983
984 Bogus function gets suggestions
984 Bogus function gets suggestions
985 $ log 'add()'
985 $ log 'add()'
986 hg: parse error: unknown identifier: add
986 hg: parse error: unknown identifier: add
987 (did you mean 'adds'?)
987 (did you mean 'adds'?)
988 [255]
988 [255]
989 $ log 'added()'
989 $ log 'added()'
990 hg: parse error: unknown identifier: added
990 hg: parse error: unknown identifier: added
991 (did you mean 'adds'?)
991 (did you mean 'adds'?)
992 [255]
992 [255]
993 $ log 'remo()'
993 $ log 'remo()'
994 hg: parse error: unknown identifier: remo
994 hg: parse error: unknown identifier: remo
995 (did you mean one of remote, removes?)
995 (did you mean one of remote, removes?)
996 [255]
996 [255]
997 $ log 'babar()'
997 $ log 'babar()'
998 hg: parse error: unknown identifier: babar
998 hg: parse error: unknown identifier: babar
999 [255]
999 [255]
1000
1000
1001 multiple revspecs
1001 multiple revspecs
1002
1002
1003 $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
1003 $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
1004 8
1004 8
1005 9
1005 9
1006 4
1006 4
1007 5
1007 5
1008 6
1008 6
1009 7
1009 7
1010
1010
1011 test usage in revpair (with "+")
1011 test usage in revpair (with "+")
1012
1012
1013 (real pair)
1013 (real pair)
1014
1014
1015 $ hg diff -r 'tip^^' -r 'tip'
1015 $ hg diff -r 'tip^^' -r 'tip'
1016 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1016 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1017 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1017 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1018 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1018 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1019 @@ -0,0 +1,1 @@
1019 @@ -0,0 +1,1 @@
1020 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1020 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1021 $ hg diff -r 'tip^^::tip'
1021 $ hg diff -r 'tip^^::tip'
1022 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1022 diff -r 2326846efdab -r 24286f4ae135 .hgtags
1023 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1023 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1024 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1024 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1025 @@ -0,0 +1,1 @@
1025 @@ -0,0 +1,1 @@
1026 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1026 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1027
1027
1028 (single rev)
1028 (single rev)
1029
1029
1030 $ hg diff -r 'tip^' -r 'tip^'
1030 $ hg diff -r 'tip^' -r 'tip^'
1031 $ hg diff -r 'tip^::tip^ or tip^'
1031 $ hg diff -r 'tip^::tip^ or tip^'
1032
1032
1033 (single rev that does not looks like a range)
1033 (single rev that does not looks like a range)
1034
1034
1035 $ hg diff -r 'tip^ or tip^'
1035 $ hg diff -r 'tip^ or tip^'
1036 diff -r d5d0dcbdc4d9 .hgtags
1036 diff -r d5d0dcbdc4d9 .hgtags
1037 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1037 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1038 +++ b/.hgtags * (glob)
1038 +++ b/.hgtags * (glob)
1039 @@ -0,0 +1,1 @@
1039 @@ -0,0 +1,1 @@
1040 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1040 +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
1041
1041
1042 (no rev)
1042 (no rev)
1043
1043
1044 $ hg diff -r 'author("babar") or author("celeste")'
1044 $ hg diff -r 'author("babar") or author("celeste")'
1045 abort: empty revision range
1045 abort: empty revision range
1046 [255]
1046 [255]
1047
1047
1048 aliases:
1048 aliases:
1049
1049
1050 $ echo '[revsetalias]' >> .hg/hgrc
1050 $ echo '[revsetalias]' >> .hg/hgrc
1051 $ echo 'm = merge()' >> .hg/hgrc
1051 $ echo 'm = merge()' >> .hg/hgrc
1052 $ echo 'sincem = descendants(m)' >> .hg/hgrc
1052 $ echo 'sincem = descendants(m)' >> .hg/hgrc
1053 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
1053 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
1054 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1054 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1055 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1055 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
1056
1056
1057 $ try m
1057 $ try m
1058 ('symbol', 'm')
1058 ('symbol', 'm')
1059 (func
1059 (func
1060 ('symbol', 'merge')
1060 ('symbol', 'merge')
1061 None)
1061 None)
1062 * set:
1062 * set:
1063 <filteredset
1063 <filteredset
1064 <fullreposet+ 0:9>>
1064 <fullreposet+ 0:9>>
1065 6
1065 6
1066
1066
1067 test alias recursion
1067 test alias recursion
1068
1068
1069 $ try sincem
1069 $ try sincem
1070 ('symbol', 'sincem')
1070 ('symbol', 'sincem')
1071 (func
1071 (func
1072 ('symbol', 'descendants')
1072 ('symbol', 'descendants')
1073 (func
1073 (func
1074 ('symbol', 'merge')
1074 ('symbol', 'merge')
1075 None))
1075 None))
1076 * set:
1076 * set:
1077 <addset+
1077 <addset+
1078 <filteredset
1078 <filteredset
1079 <fullreposet+ 0:9>>,
1079 <fullreposet+ 0:9>>,
1080 <generatorset+>>
1080 <generatorset+>>
1081 6
1081 6
1082 7
1082 7
1083
1083
1084 test infinite recursion
1084 test infinite recursion
1085
1085
1086 $ echo 'recurse1 = recurse2' >> .hg/hgrc
1086 $ echo 'recurse1 = recurse2' >> .hg/hgrc
1087 $ echo 'recurse2 = recurse1' >> .hg/hgrc
1087 $ echo 'recurse2 = recurse1' >> .hg/hgrc
1088 $ try recurse1
1088 $ try recurse1
1089 ('symbol', 'recurse1')
1089 ('symbol', 'recurse1')
1090 hg: parse error: infinite expansion of revset alias "recurse1" detected
1090 hg: parse error: infinite expansion of revset alias "recurse1" detected
1091 [255]
1091 [255]
1092
1092
1093 $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
1093 $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
1094 $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
1094 $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
1095 $ try "level2(level1(1, 2), 3)"
1095 $ try "level2(level1(1, 2), 3)"
1096 (func
1096 (func
1097 ('symbol', 'level2')
1097 ('symbol', 'level2')
1098 (list
1098 (list
1099 (func
1099 (func
1100 ('symbol', 'level1')
1100 ('symbol', 'level1')
1101 (list
1101 (list
1102 ('symbol', '1')
1102 ('symbol', '1')
1103 ('symbol', '2')))
1103 ('symbol', '2')))
1104 ('symbol', '3')))
1104 ('symbol', '3')))
1105 (or
1105 (or
1106 ('symbol', '3')
1106 ('symbol', '3')
1107 (or
1107 (or
1108 ('symbol', '1')
1108 ('symbol', '1')
1109 ('symbol', '2')))
1109 ('symbol', '2')))
1110 * set:
1110 * set:
1111 <addset
1111 <addset
1112 <baseset [3]>,
1112 <baseset [3]>,
1113 <addset
1113 <addset
1114 <baseset [1]>,
1114 <baseset [1]>,
1115 <baseset [2]>>>
1115 <baseset [2]>>>
1116 3
1116 3
1117 1
1117 1
1118 2
1118 2
1119
1119
1120 test nesting and variable passing
1120 test nesting and variable passing
1121
1121
1122 $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
1122 $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
1123 $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
1123 $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
1124 $ echo 'nested3($1) = max($1)' >> .hg/hgrc
1124 $ echo 'nested3($1) = max($1)' >> .hg/hgrc
1125 $ try 'nested(2:5)'
1125 $ try 'nested(2:5)'
1126 (func
1126 (func
1127 ('symbol', 'nested')
1127 ('symbol', 'nested')
1128 (range
1128 (range
1129 ('symbol', '2')
1129 ('symbol', '2')
1130 ('symbol', '5')))
1130 ('symbol', '5')))
1131 (func
1131 (func
1132 ('symbol', 'max')
1132 ('symbol', 'max')
1133 (range
1133 (range
1134 ('symbol', '2')
1134 ('symbol', '2')
1135 ('symbol', '5')))
1135 ('symbol', '5')))
1136 * set:
1136 * set:
1137 <baseset [5]>
1137 <baseset [5]>
1138 5
1138 5
1139
1139
1140 test variable isolation, variable placeholders are rewritten as string
1140 test variable isolation, variable placeholders are rewritten as string
1141 then parsed and matched again as string. Check they do not leak too
1141 then parsed and matched again as string. Check they do not leak too
1142 far away.
1142 far away.
1143
1143
1144 $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
1144 $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
1145 $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
1145 $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
1146 $ try 'callinjection(2:5)'
1146 $ try 'callinjection(2:5)'
1147 (func
1147 (func
1148 ('symbol', 'callinjection')
1148 ('symbol', 'callinjection')
1149 (range
1149 (range
1150 ('symbol', '2')
1150 ('symbol', '2')
1151 ('symbol', '5')))
1151 ('symbol', '5')))
1152 (func
1152 (func
1153 ('symbol', 'descendants')
1153 ('symbol', 'descendants')
1154 (func
1154 (func
1155 ('symbol', 'max')
1155 ('symbol', 'max')
1156 ('string', '$1')))
1156 ('string', '$1')))
1157 abort: unknown revision '$1'!
1157 abort: unknown revision '$1'!
1158 [255]
1158 [255]
1159
1159
1160 $ echo 'injectparamasstring2 = max(_aliasarg("$1"))' >> .hg/hgrc
1160 $ echo 'injectparamasstring2 = max(_aliasarg("$1"))' >> .hg/hgrc
1161 $ echo 'callinjection2($1) = descendants(injectparamasstring2)' >> .hg/hgrc
1161 $ echo 'callinjection2($1) = descendants(injectparamasstring2)' >> .hg/hgrc
1162 $ try 'callinjection2(2:5)'
1162 $ try 'callinjection2(2:5)'
1163 (func
1163 (func
1164 ('symbol', 'callinjection2')
1164 ('symbol', 'callinjection2')
1165 (range
1165 (range
1166 ('symbol', '2')
1166 ('symbol', '2')
1167 ('symbol', '5')))
1167 ('symbol', '5')))
1168 abort: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
1168 abort: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
1169 [255]
1169 [255]
1170 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
1170 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
1171 ('symbol', 'tip')
1171 ('symbol', 'tip')
1172 warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end
1172 warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end
1173 warning: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
1173 warning: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
1174 * set:
1174 * set:
1175 <baseset [9]>
1175 <baseset [9]>
1176 9
1176 9
1177 >>> data = file('.hg/hgrc', 'rb').read()
1177 >>> data = file('.hg/hgrc', 'rb').read()
1178 >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', ''))
1178 >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', ''))
1179
1179
1180 $ try 'tip'
1180 $ try 'tip'
1181 ('symbol', 'tip')
1181 ('symbol', 'tip')
1182 * set:
1182 * set:
1183 <baseset [9]>
1183 <baseset [9]>
1184 9
1184 9
1185
1185
1186 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
1186 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
1187 ('symbol', 'tip')
1187 ('symbol', 'tip')
1188 warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token
1188 warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token
1189 * set:
1189 * set:
1190 <baseset [9]>
1190 <baseset [9]>
1191 9
1191 9
1192 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
1192 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
1193 $ try 'strictreplacing("foo", tip)'
1193 $ try 'strictreplacing("foo", tip)'
1194 (func
1194 (func
1195 ('symbol', 'strictreplacing')
1195 ('symbol', 'strictreplacing')
1196 (list
1196 (list
1197 ('string', 'foo')
1197 ('string', 'foo')
1198 ('symbol', 'tip')))
1198 ('symbol', 'tip')))
1199 (or
1199 (or
1200 ('symbol', 'tip')
1200 ('symbol', 'tip')
1201 (func
1201 (func
1202 ('symbol', 'desc')
1202 ('symbol', 'desc')
1203 ('string', '$1')))
1203 ('string', '$1')))
1204 * set:
1204 * set:
1205 <addset
1205 <addset
1206 <baseset [9]>,
1206 <baseset [9]>,
1207 <filteredset
1207 <filteredset
1208 <filteredset
1208 <filteredset
1209 <fullreposet+ 0:9>>>>
1209 <fullreposet+ 0:9>>>>
1210 9
1210 9
1211
1211
1212 $ try 'd(2:5)'
1212 $ try 'd(2:5)'
1213 (func
1213 (func
1214 ('symbol', 'd')
1214 ('symbol', 'd')
1215 (range
1215 (range
1216 ('symbol', '2')
1216 ('symbol', '2')
1217 ('symbol', '5')))
1217 ('symbol', '5')))
1218 (func
1218 (func
1219 ('symbol', 'reverse')
1219 ('symbol', 'reverse')
1220 (func
1220 (func
1221 ('symbol', 'sort')
1221 ('symbol', 'sort')
1222 (list
1222 (list
1223 (range
1223 (range
1224 ('symbol', '2')
1224 ('symbol', '2')
1225 ('symbol', '5'))
1225 ('symbol', '5'))
1226 ('symbol', 'date'))))
1226 ('symbol', 'date'))))
1227 * set:
1227 * set:
1228 <baseset [4, 5, 3, 2]>
1228 <baseset [4, 5, 3, 2]>
1229 4
1229 4
1230 5
1230 5
1231 3
1231 3
1232 2
1232 2
1233 $ try 'rs(2 or 3, date)'
1233 $ try 'rs(2 or 3, date)'
1234 (func
1234 (func
1235 ('symbol', 'rs')
1235 ('symbol', 'rs')
1236 (list
1236 (list
1237 (or
1237 (or
1238 ('symbol', '2')
1238 ('symbol', '2')
1239 ('symbol', '3'))
1239 ('symbol', '3'))
1240 ('symbol', 'date')))
1240 ('symbol', 'date')))
1241 (func
1241 (func
1242 ('symbol', 'reverse')
1242 ('symbol', 'reverse')
1243 (func
1243 (func
1244 ('symbol', 'sort')
1244 ('symbol', 'sort')
1245 (list
1245 (list
1246 (or
1246 (or
1247 ('symbol', '2')
1247 ('symbol', '2')
1248 ('symbol', '3'))
1248 ('symbol', '3'))
1249 ('symbol', 'date'))))
1249 ('symbol', 'date'))))
1250 * set:
1250 * set:
1251 <baseset [3, 2]>
1251 <baseset [3, 2]>
1252 3
1252 3
1253 2
1253 2
1254 $ try 'rs()'
1254 $ try 'rs()'
1255 (func
1255 (func
1256 ('symbol', 'rs')
1256 ('symbol', 'rs')
1257 None)
1257 None)
1258 hg: parse error: invalid number of arguments: 0
1258 hg: parse error: invalid number of arguments: 0
1259 [255]
1259 [255]
1260 $ try 'rs(2)'
1260 $ try 'rs(2)'
1261 (func
1261 (func
1262 ('symbol', 'rs')
1262 ('symbol', 'rs')
1263 ('symbol', '2'))
1263 ('symbol', '2'))
1264 hg: parse error: invalid number of arguments: 1
1264 hg: parse error: invalid number of arguments: 1
1265 [255]
1265 [255]
1266 $ try 'rs(2, data, 7)'
1266 $ try 'rs(2, data, 7)'
1267 (func
1267 (func
1268 ('symbol', 'rs')
1268 ('symbol', 'rs')
1269 (list
1269 (list
1270 (list
1270 (list
1271 ('symbol', '2')
1271 ('symbol', '2')
1272 ('symbol', 'data'))
1272 ('symbol', 'data'))
1273 ('symbol', '7')))
1273 ('symbol', '7')))
1274 hg: parse error: invalid number of arguments: 3
1274 hg: parse error: invalid number of arguments: 3
1275 [255]
1275 [255]
1276 $ try 'rs4(2 or 3, x, x, date)'
1276 $ try 'rs4(2 or 3, x, x, date)'
1277 (func
1277 (func
1278 ('symbol', 'rs4')
1278 ('symbol', 'rs4')
1279 (list
1279 (list
1280 (list
1280 (list
1281 (list
1281 (list
1282 (or
1282 (or
1283 ('symbol', '2')
1283 ('symbol', '2')
1284 ('symbol', '3'))
1284 ('symbol', '3'))
1285 ('symbol', 'x'))
1285 ('symbol', 'x'))
1286 ('symbol', 'x'))
1286 ('symbol', 'x'))
1287 ('symbol', 'date')))
1287 ('symbol', 'date')))
1288 (func
1288 (func
1289 ('symbol', 'reverse')
1289 ('symbol', 'reverse')
1290 (func
1290 (func
1291 ('symbol', 'sort')
1291 ('symbol', 'sort')
1292 (list
1292 (list
1293 (or
1293 (or
1294 ('symbol', '2')
1294 ('symbol', '2')
1295 ('symbol', '3'))
1295 ('symbol', '3'))
1296 ('symbol', 'date'))))
1296 ('symbol', 'date'))))
1297 * set:
1297 * set:
1298 <baseset [3, 2]>
1298 <baseset [3, 2]>
1299 3
1299 3
1300 2
1300 2
1301
1301
1302 issue4553: check that revset aliases override existing hash prefix
1302 issue4553: check that revset aliases override existing hash prefix
1303
1303
1304 $ hg log -qr e
1304 $ hg log -qr e
1305 6:e0cc66ef77e8
1305 6:e0cc66ef77e8
1306
1306
1307 $ hg log -qr e --config revsetalias.e="all()"
1307 $ hg log -qr e --config revsetalias.e="all()"
1308 0:2785f51eece5
1308 0:2785f51eece5
1309 1:d75937da8da0
1309 1:d75937da8da0
1310 2:5ed5505e9f1c
1310 2:5ed5505e9f1c
1311 3:8528aa5637f2
1311 3:8528aa5637f2
1312 4:2326846efdab
1312 4:2326846efdab
1313 5:904fa392b941
1313 5:904fa392b941
1314 6:e0cc66ef77e8
1314 6:e0cc66ef77e8
1315 7:013af1973af4
1315 7:013af1973af4
1316 8:d5d0dcbdc4d9
1316 8:d5d0dcbdc4d9
1317 9:24286f4ae135
1317 9:24286f4ae135
1318
1318
1319 $ hg log -qr e: --config revsetalias.e="0"
1319 $ hg log -qr e: --config revsetalias.e="0"
1320 0:2785f51eece5
1320 0:2785f51eece5
1321 1:d75937da8da0
1321 1:d75937da8da0
1322 2:5ed5505e9f1c
1322 2:5ed5505e9f1c
1323 3:8528aa5637f2
1323 3:8528aa5637f2
1324 4:2326846efdab
1324 4:2326846efdab
1325 5:904fa392b941
1325 5:904fa392b941
1326 6:e0cc66ef77e8
1326 6:e0cc66ef77e8
1327 7:013af1973af4
1327 7:013af1973af4
1328 8:d5d0dcbdc4d9
1328 8:d5d0dcbdc4d9
1329 9:24286f4ae135
1329 9:24286f4ae135
1330
1330
1331 $ hg log -qr :e --config revsetalias.e="9"
1331 $ hg log -qr :e --config revsetalias.e="9"
1332 0:2785f51eece5
1332 0:2785f51eece5
1333 1:d75937da8da0
1333 1:d75937da8da0
1334 2:5ed5505e9f1c
1334 2:5ed5505e9f1c
1335 3:8528aa5637f2
1335 3:8528aa5637f2
1336 4:2326846efdab
1336 4:2326846efdab
1337 5:904fa392b941
1337 5:904fa392b941
1338 6:e0cc66ef77e8
1338 6:e0cc66ef77e8
1339 7:013af1973af4
1339 7:013af1973af4
1340 8:d5d0dcbdc4d9
1340 8:d5d0dcbdc4d9
1341 9:24286f4ae135
1341 9:24286f4ae135
1342
1342
1343 $ hg log -qr e:
1343 $ hg log -qr e:
1344 6:e0cc66ef77e8
1344 6:e0cc66ef77e8
1345 7:013af1973af4
1345 7:013af1973af4
1346 8:d5d0dcbdc4d9
1346 8:d5d0dcbdc4d9
1347 9:24286f4ae135
1347 9:24286f4ae135
1348
1348
1349 $ hg log -qr :e
1349 $ hg log -qr :e
1350 0:2785f51eece5
1350 0:2785f51eece5
1351 1:d75937da8da0
1351 1:d75937da8da0
1352 2:5ed5505e9f1c
1352 2:5ed5505e9f1c
1353 3:8528aa5637f2
1353 3:8528aa5637f2
1354 4:2326846efdab
1354 4:2326846efdab
1355 5:904fa392b941
1355 5:904fa392b941
1356 6:e0cc66ef77e8
1356 6:e0cc66ef77e8
1357
1357
1358 issue2549 - correct optimizations
1358 issue2549 - correct optimizations
1359
1359
1360 $ log 'limit(1 or 2 or 3, 2) and not 2'
1360 $ log 'limit(1 or 2 or 3, 2) and not 2'
1361 1
1361 1
1362 $ log 'max(1 or 2) and not 2'
1362 $ log 'max(1 or 2) and not 2'
1363 $ log 'min(1 or 2) and not 1'
1363 $ log 'min(1 or 2) and not 1'
1364 $ log 'last(1 or 2, 1) and not 2'
1364 $ log 'last(1 or 2, 1) and not 2'
1365
1365
1366 issue4289 - ordering of built-ins
1366 issue4289 - ordering of built-ins
1367 $ hg log -M -q -r 3:2
1367 $ hg log -M -q -r 3:2
1368 3:8528aa5637f2
1368 3:8528aa5637f2
1369 2:5ed5505e9f1c
1369 2:5ed5505e9f1c
1370
1370
1371 test revsets started with 40-chars hash (issue3669)
1371 test revsets started with 40-chars hash (issue3669)
1372
1372
1373 $ ISSUE3669_TIP=`hg tip --template '{node}'`
1373 $ ISSUE3669_TIP=`hg tip --template '{node}'`
1374 $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
1374 $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
1375 9
1375 9
1376 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
1376 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
1377 8
1377 8
1378
1378
1379 test or-ed indirect predicates (issue3775)
1379 test or-ed indirect predicates (issue3775)
1380
1380
1381 $ log '6 or 6^1' | sort
1381 $ log '6 or 6^1' | sort
1382 5
1382 5
1383 6
1383 6
1384 $ log '6^1 or 6' | sort
1384 $ log '6^1 or 6' | sort
1385 5
1385 5
1386 6
1386 6
1387 $ log '4 or 4~1' | sort
1387 $ log '4 or 4~1' | sort
1388 2
1388 2
1389 4
1389 4
1390 $ log '4~1 or 4' | sort
1390 $ log '4~1 or 4' | sort
1391 2
1391 2
1392 4
1392 4
1393 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
1393 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
1394 0
1394 0
1395 1
1395 1
1396 2
1396 2
1397 3
1397 3
1398 4
1398 4
1399 5
1399 5
1400 6
1400 6
1401 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
1401 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
1402 0
1402 0
1403 1
1403 1
1404 2
1404 2
1405 3
1405 3
1406 4
1406 4
1407 5
1407 5
1408 6
1408 6
1409
1409
1410 tests for 'remote()' predicate:
1410 tests for 'remote()' predicate:
1411 #. (csets in remote) (id) (remote)
1411 #. (csets in remote) (id) (remote)
1412 1. less than local current branch "default"
1412 1. less than local current branch "default"
1413 2. same with local specified "default"
1413 2. same with local specified "default"
1414 3. more than local specified specified
1414 3. more than local specified specified
1415
1415
1416 $ hg clone --quiet -U . ../remote3
1416 $ hg clone --quiet -U . ../remote3
1417 $ cd ../remote3
1417 $ cd ../remote3
1418 $ hg update -q 7
1418 $ hg update -q 7
1419 $ echo r > r
1419 $ echo r > r
1420 $ hg ci -Aqm 10
1420 $ hg ci -Aqm 10
1421 $ log 'remote()'
1421 $ log 'remote()'
1422 7
1422 7
1423 $ log 'remote("a-b-c-")'
1423 $ log 'remote("a-b-c-")'
1424 2
1424 2
1425 $ cd ../repo
1425 $ cd ../repo
1426 $ log 'remote(".a.b.c.", "../remote3")'
1426 $ log 'remote(".a.b.c.", "../remote3")'
1427
1427
1428 tests for concatenation of strings/symbols by "##"
1428 tests for concatenation of strings/symbols by "##"
1429
1429
1430 $ try "278 ## '5f5' ## 1ee ## 'ce5'"
1430 $ try "278 ## '5f5' ## 1ee ## 'ce5'"
1431 (_concat
1431 (_concat
1432 (_concat
1432 (_concat
1433 (_concat
1433 (_concat
1434 ('symbol', '278')
1434 ('symbol', '278')
1435 ('string', '5f5'))
1435 ('string', '5f5'))
1436 ('symbol', '1ee'))
1436 ('symbol', '1ee'))
1437 ('string', 'ce5'))
1437 ('string', 'ce5'))
1438 ('string', '2785f51eece5')
1438 ('string', '2785f51eece5')
1439 * set:
1439 * set:
1440 <baseset [0]>
1440 <baseset [0]>
1441 0
1441 0
1442
1442
1443 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
1443 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
1444 $ try "cat4(278, '5f5', 1ee, 'ce5')"
1444 $ try "cat4(278, '5f5', 1ee, 'ce5')"
1445 (func
1445 (func
1446 ('symbol', 'cat4')
1446 ('symbol', 'cat4')
1447 (list
1447 (list
1448 (list
1448 (list
1449 (list
1449 (list
1450 ('symbol', '278')
1450 ('symbol', '278')
1451 ('string', '5f5'))
1451 ('string', '5f5'))
1452 ('symbol', '1ee'))
1452 ('symbol', '1ee'))
1453 ('string', 'ce5')))
1453 ('string', 'ce5')))
1454 (_concat
1454 (_concat
1455 (_concat
1455 (_concat
1456 (_concat
1456 (_concat
1457 ('symbol', '278')
1457 ('symbol', '278')
1458 ('string', '5f5'))
1458 ('string', '5f5'))
1459 ('symbol', '1ee'))
1459 ('symbol', '1ee'))
1460 ('string', 'ce5'))
1460 ('string', 'ce5'))
1461 ('string', '2785f51eece5')
1461 ('string', '2785f51eece5')
1462 * set:
1462 * set:
1463 <baseset [0]>
1463 <baseset [0]>
1464 0
1464 0
1465
1465
1466 (check concatenation in alias nesting)
1466 (check concatenation in alias nesting)
1467
1467
1468 $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
1468 $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
1469 $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
1469 $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
1470 $ log "cat2x2(278, '5f5', 1ee, 'ce5')"
1470 $ log "cat2x2(278, '5f5', 1ee, 'ce5')"
1471 0
1471 0
1472
1472
1473 (check operator priority)
1473 (check operator priority)
1474
1474
1475 $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
1475 $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
1476 $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
1476 $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
1477 0
1477 0
1478 4
1478 4
1479
1479
1480 $ cd ..
1480 $ cd ..
1481
1481
1482 test author/desc/keyword in problematic encoding
1482 test author/desc/keyword in problematic encoding
1483 # unicode: cp932:
1483 # unicode: cp932:
1484 # u30A2 0x83 0x41(= 'A')
1484 # u30A2 0x83 0x41(= 'A')
1485 # u30C2 0x83 0x61(= 'a')
1485 # u30C2 0x83 0x61(= 'a')
1486
1486
1487 $ hg init problematicencoding
1487 $ hg init problematicencoding
1488 $ cd problematicencoding
1488 $ cd problematicencoding
1489
1489
1490 $ python > setup.sh <<EOF
1490 $ python > setup.sh <<EOF
1491 > print u'''
1491 > print u'''
1492 > echo a > text
1492 > echo a > text
1493 > hg add text
1493 > hg add text
1494 > hg --encoding utf-8 commit -u '\u30A2' -m none
1494 > hg --encoding utf-8 commit -u '\u30A2' -m none
1495 > echo b > text
1495 > echo b > text
1496 > hg --encoding utf-8 commit -u '\u30C2' -m none
1496 > hg --encoding utf-8 commit -u '\u30C2' -m none
1497 > echo c > text
1497 > echo c > text
1498 > hg --encoding utf-8 commit -u none -m '\u30A2'
1498 > hg --encoding utf-8 commit -u none -m '\u30A2'
1499 > echo d > text
1499 > echo d > text
1500 > hg --encoding utf-8 commit -u none -m '\u30C2'
1500 > hg --encoding utf-8 commit -u none -m '\u30C2'
1501 > '''.encode('utf-8')
1501 > '''.encode('utf-8')
1502 > EOF
1502 > EOF
1503 $ sh < setup.sh
1503 $ sh < setup.sh
1504
1504
1505 test in problematic encoding
1505 test in problematic encoding
1506 $ python > test.sh <<EOF
1506 $ python > test.sh <<EOF
1507 > print u'''
1507 > print u'''
1508 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
1508 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
1509 > echo ====
1509 > echo ====
1510 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
1510 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
1511 > echo ====
1511 > echo ====
1512 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
1512 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
1513 > echo ====
1513 > echo ====
1514 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
1514 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
1515 > echo ====
1515 > echo ====
1516 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
1516 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
1517 > echo ====
1517 > echo ====
1518 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
1518 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
1519 > '''.encode('cp932')
1519 > '''.encode('cp932')
1520 > EOF
1520 > EOF
1521 $ sh < test.sh
1521 $ sh < test.sh
1522 0
1522 0
1523 ====
1523 ====
1524 1
1524 1
1525 ====
1525 ====
1526 2
1526 2
1527 ====
1527 ====
1528 3
1528 3
1529 ====
1529 ====
1530 0
1530 0
1531 2
1531 2
1532 ====
1532 ====
1533 1
1533 1
1534 3
1534 3
1535
1535
1536 test error message of bad revset
1537 $ hg log -r 'foo\\'
1538 hg: parse error at 3: syntax error
1539 [255]
1540
1536 $ cd ..
1541 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now