##// END OF EJS Templates
revset: add tests for 'remote()' predicate
FUJIWARA Katsunori -
r16008:02a497a1 stable
parent child Browse files
Show More
@@ -1,535 +1,553 b''
1 $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate /a/b/c/ as if it was a real file path
1 $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate /a/b/c/ as if it was a real file path
2
2
3 $ HGENCODING=utf-8
3 $ HGENCODING=utf-8
4 $ export HGENCODING
4 $ export HGENCODING
5
5
6 $ try() {
6 $ try() {
7 > hg debugrevspec --debug "$@"
7 > hg debugrevspec --debug "$@"
8 > }
8 > }
9
9
10 $ log() {
10 $ log() {
11 > hg log --template '{rev}\n' -r "$1"
11 > hg log --template '{rev}\n' -r "$1"
12 > }
12 > }
13
13
14 $ hg init repo
14 $ hg init repo
15 $ cd repo
15 $ cd repo
16
16
17 $ echo a > a
17 $ echo a > a
18 $ hg branch a
18 $ hg branch a
19 marked working directory as branch a
19 marked working directory as branch a
20 (branches are permanent and global, did you want a bookmark?)
20 (branches are permanent and global, did you want a bookmark?)
21 $ hg ci -Aqm0
21 $ hg ci -Aqm0
22
22
23 $ echo b > b
23 $ echo b > b
24 $ hg branch b
24 $ hg branch b
25 marked working directory as branch b
25 marked working directory as branch b
26 (branches are permanent and global, did you want a bookmark?)
26 (branches are permanent and global, did you want a bookmark?)
27 $ hg ci -Aqm1
27 $ hg ci -Aqm1
28
28
29 $ rm a
29 $ rm a
30 $ hg branch a-b-c-
30 $ hg branch a-b-c-
31 marked working directory as branch a-b-c-
31 marked working directory as branch a-b-c-
32 (branches are permanent and global, did you want a bookmark?)
32 (branches are permanent and global, did you want a bookmark?)
33 $ hg ci -Aqm2 -u Bob
33 $ hg ci -Aqm2 -u Bob
34
34
35 $ hg co 1
35 $ hg co 1
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 $ hg branch +a+b+c+
37 $ hg branch +a+b+c+
38 marked working directory as branch +a+b+c+
38 marked working directory as branch +a+b+c+
39 (branches are permanent and global, did you want a bookmark?)
39 (branches are permanent and global, did you want a bookmark?)
40 $ hg ci -Aqm3
40 $ hg ci -Aqm3
41
41
42 $ hg co 2 # interleave
42 $ hg co 2 # interleave
43 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
43 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
44 $ echo bb > b
44 $ echo bb > b
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 -Aqm4 -d "May 12 2005"
48 $ hg ci -Aqm4 -d "May 12 2005"
49
49
50 $ hg co 3
50 $ hg co 3
51 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ hg branch /a/b/c/
52 $ hg branch /a/b/c/
53 marked working directory as branch /a/b/c/
53 marked working directory as branch /a/b/c/
54 (branches are permanent and global, did you want a bookmark?)
54 (branches are permanent and global, did you want a bookmark?)
55 $ hg ci -Aqm"5 bug"
55 $ hg ci -Aqm"5 bug"
56
56
57 $ hg merge 4
57 $ hg merge 4
58 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
58 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
59 (branch merge, don't forget to commit)
59 (branch merge, don't forget to commit)
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"6 issue619"
63 $ hg ci -Aqm"6 issue619"
64
64
65 $ hg branch .a.b.c.
65 $ hg branch .a.b.c.
66 marked working directory as branch .a.b.c.
66 marked working directory as branch .a.b.c.
67 (branches are permanent and global, did you want a bookmark?)
67 (branches are permanent and global, did you want a bookmark?)
68 $ hg ci -Aqm7
68 $ hg ci -Aqm7
69
69
70 $ hg branch all
70 $ hg branch all
71 marked working directory as branch all
71 marked working directory as branch all
72 (branches are permanent and global, did you want a bookmark?)
72 (branches are permanent and global, did you want a bookmark?)
73 $ hg ci --close-branch -Aqm8
73 $ hg ci --close-branch -Aqm8
74 abort: can only close branch heads
74 abort: can only close branch heads
75 [255]
75 [255]
76
76
77 $ hg co 4
77 $ hg co 4
78 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 $ hg branch Γ©
79 $ hg branch Γ©
80 marked working directory as branch \xc3\xa9 (esc)
80 marked working directory as branch \xc3\xa9 (esc)
81 (branches are permanent and global, did you want a bookmark?)
81 (branches are permanent and global, did you want a bookmark?)
82 $ hg ci -Aqm9
82 $ hg ci -Aqm9
83
83
84 $ hg tag -r6 1.0
84 $ hg tag -r6 1.0
85
85
86 $ hg clone --quiet -U -r 7 . ../remote1
86 $ hg clone --quiet -U -r 7 . ../remote1
87 $ hg clone --quiet -U -r 8 . ../remote2
87 $ hg clone --quiet -U -r 8 . ../remote2
88 $ echo "[paths]" >> .hg/hgrc
88 $ echo "[paths]" >> .hg/hgrc
89 $ echo "default = ../remote1" >> .hg/hgrc
89 $ echo "default = ../remote1" >> .hg/hgrc
90
90
91 names that should work without quoting
91 names that should work without quoting
92
92
93 $ try a
93 $ try a
94 ('symbol', 'a')
94 ('symbol', 'a')
95 0
95 0
96 $ try b-a
96 $ try b-a
97 ('minus', ('symbol', 'b'), ('symbol', 'a'))
97 ('minus', ('symbol', 'b'), ('symbol', 'a'))
98 1
98 1
99 $ try _a_b_c_
99 $ try _a_b_c_
100 ('symbol', '_a_b_c_')
100 ('symbol', '_a_b_c_')
101 6
101 6
102 $ try _a_b_c_-a
102 $ try _a_b_c_-a
103 ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
103 ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
104 6
104 6
105 $ try .a.b.c.
105 $ try .a.b.c.
106 ('symbol', '.a.b.c.')
106 ('symbol', '.a.b.c.')
107 7
107 7
108 $ try .a.b.c.-a
108 $ try .a.b.c.-a
109 ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
109 ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
110 7
110 7
111 $ try -- '-a-b-c-' # complains
111 $ try -- '-a-b-c-' # complains
112 hg: parse error at 7: not a prefix: end
112 hg: parse error at 7: not a prefix: end
113 [255]
113 [255]
114 $ log -a-b-c- # succeeds with fallback
114 $ log -a-b-c- # succeeds with fallback
115 4
115 4
116 $ try -- -a-b-c--a # complains
116 $ try -- -a-b-c--a # complains
117 ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
117 ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
118 abort: unknown revision '-a'!
118 abort: unknown revision '-a'!
119 [255]
119 [255]
120 $ try Γ©
120 $ try Γ©
121 ('symbol', '\xc3\xa9')
121 ('symbol', '\xc3\xa9')
122 9
122 9
123
123
124 quoting needed
124 quoting needed
125
125
126 $ try '"-a-b-c-"-a'
126 $ try '"-a-b-c-"-a'
127 ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
127 ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
128 4
128 4
129
129
130 $ log '1 or 2'
130 $ log '1 or 2'
131 1
131 1
132 2
132 2
133 $ log '1|2'
133 $ log '1|2'
134 1
134 1
135 2
135 2
136 $ log '1 and 2'
136 $ log '1 and 2'
137 $ log '1&2'
137 $ log '1&2'
138 $ try '1&2|3' # precedence - and is higher
138 $ try '1&2|3' # precedence - and is higher
139 ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
139 ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
140 3
140 3
141 $ try '1|2&3'
141 $ try '1|2&3'
142 ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
142 ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
143 1
143 1
144 $ try '1&2&3' # associativity
144 $ try '1&2&3' # associativity
145 ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
145 ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
146 $ try '1|(2|3)'
146 $ try '1|(2|3)'
147 ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
147 ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
148 1
148 1
149 2
149 2
150 3
150 3
151 $ log '1.0' # tag
151 $ log '1.0' # tag
152 6
152 6
153 $ log 'a' # branch
153 $ log 'a' # branch
154 0
154 0
155 $ log '2785f51ee'
155 $ log '2785f51ee'
156 0
156 0
157 $ log 'date(2005)'
157 $ log 'date(2005)'
158 4
158 4
159 $ log 'date(this is a test)'
159 $ log 'date(this is a test)'
160 hg: parse error at 10: unexpected token: symbol
160 hg: parse error at 10: unexpected token: symbol
161 [255]
161 [255]
162 $ log 'date()'
162 $ log 'date()'
163 hg: parse error: date requires a string
163 hg: parse error: date requires a string
164 [255]
164 [255]
165 $ log 'date'
165 $ log 'date'
166 hg: parse error: can't use date here
166 hg: parse error: can't use date here
167 [255]
167 [255]
168 $ log 'date('
168 $ log 'date('
169 hg: parse error at 5: not a prefix: end
169 hg: parse error at 5: not a prefix: end
170 [255]
170 [255]
171 $ log 'date(tip)'
171 $ log 'date(tip)'
172 abort: invalid date: 'tip'
172 abort: invalid date: 'tip'
173 [255]
173 [255]
174 $ log '"date"'
174 $ log '"date"'
175 abort: unknown revision 'date'!
175 abort: unknown revision 'date'!
176 [255]
176 [255]
177 $ log 'date(2005) and 1::'
177 $ log 'date(2005) and 1::'
178 4
178 4
179
179
180 $ log 'ancestor(1)'
180 $ log 'ancestor(1)'
181 hg: parse error: ancestor requires two arguments
181 hg: parse error: ancestor requires two arguments
182 [255]
182 [255]
183 $ log 'ancestor(4,5)'
183 $ log 'ancestor(4,5)'
184 1
184 1
185 $ log 'ancestor(4,5) and 4'
185 $ log 'ancestor(4,5) and 4'
186 $ log 'ancestors(5)'
186 $ log 'ancestors(5)'
187 0
187 0
188 1
188 1
189 3
189 3
190 5
190 5
191 $ log 'author(bob)'
191 $ log 'author(bob)'
192 2
192 2
193 $ log 'branch(Γ©)'
193 $ log 'branch(Γ©)'
194 8
194 8
195 9
195 9
196 $ log 'children(ancestor(4,5))'
196 $ log 'children(ancestor(4,5))'
197 2
197 2
198 3
198 3
199 $ log 'closed()'
199 $ log 'closed()'
200 $ log 'contains(a)'
200 $ log 'contains(a)'
201 0
201 0
202 1
202 1
203 3
203 3
204 5
204 5
205 $ log 'desc(B)'
205 $ log 'desc(B)'
206 5
206 5
207 $ log 'descendants(2 or 3)'
207 $ log 'descendants(2 or 3)'
208 2
208 2
209 3
209 3
210 4
210 4
211 5
211 5
212 6
212 6
213 7
213 7
214 8
214 8
215 9
215 9
216 $ log 'file(b)'
216 $ log 'file(b)'
217 1
217 1
218 4
218 4
219 $ log 'follow()'
219 $ log 'follow()'
220 0
220 0
221 1
221 1
222 2
222 2
223 4
223 4
224 8
224 8
225 9
225 9
226 $ log 'grep("issue\d+")'
226 $ log 'grep("issue\d+")'
227 6
227 6
228 $ try 'grep("(")' # invalid regular expression
228 $ try 'grep("(")' # invalid regular expression
229 ('func', ('symbol', 'grep'), ('string', '('))
229 ('func', ('symbol', 'grep'), ('string', '('))
230 hg: parse error: invalid match pattern: unbalanced parenthesis
230 hg: parse error: invalid match pattern: unbalanced parenthesis
231 [255]
231 [255]
232 $ try 'grep("\bissue\d+")'
232 $ try 'grep("\bissue\d+")'
233 ('func', ('symbol', 'grep'), ('string', '\x08issue\\d+'))
233 ('func', ('symbol', 'grep'), ('string', '\x08issue\\d+'))
234 $ try 'grep(r"\bissue\d+")'
234 $ try 'grep(r"\bissue\d+")'
235 ('func', ('symbol', 'grep'), ('string', '\\bissue\\d+'))
235 ('func', ('symbol', 'grep'), ('string', '\\bissue\\d+'))
236 6
236 6
237 $ try 'grep(r"\")'
237 $ try 'grep(r"\")'
238 hg: parse error at 7: unterminated string
238 hg: parse error at 7: unterminated string
239 [255]
239 [255]
240 $ log 'head()'
240 $ log 'head()'
241 0
241 0
242 1
242 1
243 2
243 2
244 3
244 3
245 4
245 4
246 5
246 5
247 6
247 6
248 7
248 7
249 9
249 9
250 $ log 'heads(6::)'
250 $ log 'heads(6::)'
251 7
251 7
252 $ log 'keyword(issue)'
252 $ log 'keyword(issue)'
253 6
253 6
254 $ log 'limit(head(), 1)'
254 $ log 'limit(head(), 1)'
255 0
255 0
256 $ log 'max(contains(a))'
256 $ log 'max(contains(a))'
257 5
257 5
258 $ log 'min(contains(a))'
258 $ log 'min(contains(a))'
259 0
259 0
260 $ log 'merge()'
260 $ log 'merge()'
261 6
261 6
262 $ log 'modifies(b)'
262 $ log 'modifies(b)'
263 4
263 4
264 $ log 'id(5)'
264 $ log 'id(5)'
265 2
265 2
266 $ log 'outgoing()'
266 $ log 'outgoing()'
267 8
267 8
268 9
268 9
269 $ log 'outgoing("../remote1")'
269 $ log 'outgoing("../remote1")'
270 8
270 8
271 9
271 9
272 $ log 'outgoing("../remote2")'
272 $ log 'outgoing("../remote2")'
273 3
273 3
274 5
274 5
275 6
275 6
276 7
276 7
277 9
277 9
278 $ log 'p1(merge())'
278 $ log 'p1(merge())'
279 5
279 5
280 $ log 'p2(merge())'
280 $ log 'p2(merge())'
281 4
281 4
282 $ log 'parents(merge())'
282 $ log 'parents(merge())'
283 4
283 4
284 5
284 5
285 $ log 'removes(a)'
285 $ log 'removes(a)'
286 2
286 2
287 6
287 6
288 $ log 'roots(all())'
288 $ log 'roots(all())'
289 0
289 0
290 $ log 'reverse(2 or 3 or 4 or 5)'
290 $ log 'reverse(2 or 3 or 4 or 5)'
291 5
291 5
292 4
292 4
293 3
293 3
294 2
294 2
295 $ log 'rev(5)'
295 $ log 'rev(5)'
296 5
296 5
297 $ log 'sort(limit(reverse(all()), 3))'
297 $ log 'sort(limit(reverse(all()), 3))'
298 7
298 7
299 8
299 8
300 9
300 9
301 $ log 'sort(2 or 3 or 4 or 5, date)'
301 $ log 'sort(2 or 3 or 4 or 5, date)'
302 2
302 2
303 3
303 3
304 5
304 5
305 4
305 4
306 $ log 'tagged()'
306 $ log 'tagged()'
307 6
307 6
308 $ log 'tag()'
308 $ log 'tag()'
309 6
309 6
310 $ log 'tag(1.0)'
310 $ log 'tag(1.0)'
311 6
311 6
312 $ log 'tag(tip)'
312 $ log 'tag(tip)'
313 9
313 9
314 $ log 'tag(unknown)'
314 $ log 'tag(unknown)'
315 abort: tag 'unknown' does not exist
315 abort: tag 'unknown' does not exist
316 [255]
316 [255]
317 $ log 'branch(unknown)'
317 $ log 'branch(unknown)'
318 abort: unknown revision 'unknown'!
318 abort: unknown revision 'unknown'!
319 [255]
319 [255]
320 $ log 'user(bob)'
320 $ log 'user(bob)'
321 2
321 2
322
322
323 $ log '4::8'
323 $ log '4::8'
324 4
324 4
325 8
325 8
326 $ log '4:8'
326 $ log '4:8'
327 4
327 4
328 5
328 5
329 6
329 6
330 7
330 7
331 8
331 8
332
332
333 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
333 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
334 4
334 4
335 2
335 2
336 5
336 5
337
337
338 $ log 'not 0 and 0:2'
338 $ log 'not 0 and 0:2'
339 1
339 1
340 2
340 2
341 $ log 'not 1 and 0:2'
341 $ log 'not 1 and 0:2'
342 0
342 0
343 2
343 2
344 $ log 'not 2 and 0:2'
344 $ log 'not 2 and 0:2'
345 0
345 0
346 1
346 1
347 $ log '(1 and 2)::'
347 $ log '(1 and 2)::'
348 $ log '(1 and 2):'
348 $ log '(1 and 2):'
349 $ log '(1 and 2):3'
349 $ log '(1 and 2):3'
350 $ log 'sort(head(), -rev)'
350 $ log 'sort(head(), -rev)'
351 9
351 9
352 7
352 7
353 6
353 6
354 5
354 5
355 4
355 4
356 3
356 3
357 2
357 2
358 1
358 1
359 0
359 0
360 $ log '4::8 - 8'
360 $ log '4::8 - 8'
361 4
361 4
362
362
363 issue2437
363 issue2437
364
364
365 $ log '3 and p1(5)'
365 $ log '3 and p1(5)'
366 3
366 3
367 $ log '4 and p2(6)'
367 $ log '4 and p2(6)'
368 4
368 4
369 $ log '1 and parents(:2)'
369 $ log '1 and parents(:2)'
370 1
370 1
371 $ log '2 and children(1:)'
371 $ log '2 and children(1:)'
372 2
372 2
373 $ log 'roots(all()) or roots(all())'
373 $ log 'roots(all()) or roots(all())'
374 0
374 0
375 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
375 $ log 'heads(branch(Γ©)) or heads(branch(Γ©))'
376 9
376 9
377 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
377 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))'
378 4
378 4
379
379
380 issue2654: report a parse error if the revset was not completely parsed
380 issue2654: report a parse error if the revset was not completely parsed
381
381
382 $ log '1 OR 2'
382 $ log '1 OR 2'
383 hg: parse error at 2: invalid token
383 hg: parse error at 2: invalid token
384 [255]
384 [255]
385
385
386 or operator should preserve ordering:
386 or operator should preserve ordering:
387 $ log 'reverse(2::4) or tip'
387 $ log 'reverse(2::4) or tip'
388 4
388 4
389 2
389 2
390 9
390 9
391
391
392 parentrevspec
392 parentrevspec
393
393
394 $ log 'merge()^0'
394 $ log 'merge()^0'
395 6
395 6
396 $ log 'merge()^'
396 $ log 'merge()^'
397 5
397 5
398 $ log 'merge()^1'
398 $ log 'merge()^1'
399 5
399 5
400 $ log 'merge()^2'
400 $ log 'merge()^2'
401 4
401 4
402 $ log 'merge()^^'
402 $ log 'merge()^^'
403 3
403 3
404 $ log 'merge()^1^'
404 $ log 'merge()^1^'
405 3
405 3
406 $ log 'merge()^^^'
406 $ log 'merge()^^^'
407 1
407 1
408
408
409 $ log 'merge()~0'
409 $ log 'merge()~0'
410 6
410 6
411 $ log 'merge()~1'
411 $ log 'merge()~1'
412 5
412 5
413 $ log 'merge()~2'
413 $ log 'merge()~2'
414 3
414 3
415 $ log 'merge()~2^1'
415 $ log 'merge()~2^1'
416 1
416 1
417 $ log 'merge()~3'
417 $ log 'merge()~3'
418 1
418 1
419
419
420 $ log '(-3:tip)^'
420 $ log '(-3:tip)^'
421 4
421 4
422 6
422 6
423 8
423 8
424
424
425 $ log 'tip^foo'
425 $ log 'tip^foo'
426 hg: parse error: ^ expects a number 0, 1, or 2
426 hg: parse error: ^ expects a number 0, 1, or 2
427 [255]
427 [255]
428
428
429 aliases:
429 aliases:
430
430
431 $ echo '[revsetalias]' >> .hg/hgrc
431 $ echo '[revsetalias]' >> .hg/hgrc
432 $ echo 'm = merge()' >> .hg/hgrc
432 $ echo 'm = merge()' >> .hg/hgrc
433 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
433 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
434 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
434 $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
435 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
435 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
436
436
437 $ try m
437 $ try m
438 ('symbol', 'm')
438 ('symbol', 'm')
439 ('func', ('symbol', 'merge'), None)
439 ('func', ('symbol', 'merge'), None)
440 6
440 6
441 $ try 'd(2:5)'
441 $ try 'd(2:5)'
442 ('func', ('symbol', 'd'), ('range', ('symbol', '2'), ('symbol', '5')))
442 ('func', ('symbol', 'd'), ('range', ('symbol', '2'), ('symbol', '5')))
443 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('range', ('symbol', '2'), ('symbol', '5')), ('symbol', 'date'))))
443 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('range', ('symbol', '2'), ('symbol', '5')), ('symbol', 'date'))))
444 4
444 4
445 5
445 5
446 3
446 3
447 2
447 2
448 $ try 'rs(2 or 3, date)'
448 $ try 'rs(2 or 3, date)'
449 ('func', ('symbol', 'rs'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date')))
449 ('func', ('symbol', 'rs'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date')))
450 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
450 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
451 3
451 3
452 2
452 2
453 $ try 'rs()'
453 $ try 'rs()'
454 ('func', ('symbol', 'rs'), None)
454 ('func', ('symbol', 'rs'), None)
455 hg: parse error: invalid number of arguments: 0
455 hg: parse error: invalid number of arguments: 0
456 [255]
456 [255]
457 $ try 'rs(2)'
457 $ try 'rs(2)'
458 ('func', ('symbol', 'rs'), ('symbol', '2'))
458 ('func', ('symbol', 'rs'), ('symbol', '2'))
459 hg: parse error: invalid number of arguments: 1
459 hg: parse error: invalid number of arguments: 1
460 [255]
460 [255]
461 $ try 'rs(2, data, 7)'
461 $ try 'rs(2, data, 7)'
462 ('func', ('symbol', 'rs'), ('list', ('list', ('symbol', '2'), ('symbol', 'data')), ('symbol', '7')))
462 ('func', ('symbol', 'rs'), ('list', ('list', ('symbol', '2'), ('symbol', 'data')), ('symbol', '7')))
463 hg: parse error: invalid number of arguments: 3
463 hg: parse error: invalid number of arguments: 3
464 [255]
464 [255]
465 $ try 'rs4(2 or 3, x, x, date)'
465 $ try 'rs4(2 or 3, x, x, date)'
466 ('func', ('symbol', 'rs4'), ('list', ('list', ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'x')), ('symbol', 'x')), ('symbol', 'date')))
466 ('func', ('symbol', 'rs4'), ('list', ('list', ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'x')), ('symbol', 'x')), ('symbol', 'date')))
467 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
467 ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or', ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))
468 3
468 3
469 2
469 2
470
470
471 issue2549 - correct optimizations
471 issue2549 - correct optimizations
472
472
473 $ log 'limit(1 or 2 or 3, 2) and not 2'
473 $ log 'limit(1 or 2 or 3, 2) and not 2'
474 1
474 1
475 $ log 'max(1 or 2) and not 2'
475 $ log 'max(1 or 2) and not 2'
476 $ log 'min(1 or 2) and not 1'
476 $ log 'min(1 or 2) and not 1'
477 $ log 'last(1 or 2, 1) and not 2'
477 $ log 'last(1 or 2, 1) and not 2'
478
478
479 tests for 'remote()' predicate:
480 #. (csets in remote) (id) (remote)
481 1. less than local current branch "default"
482 2. same with local specified "default"
483 3. more than local specified specified
484
485 $ hg clone --quiet -U . ../remote3
486 $ cd ../remote3
487 $ hg update -q 7
488 $ echo r > r
489 $ hg ci -Aqm 10
490 $ log 'remote()'
491 7
492 $ log 'remote("a-b-c-")'
493 2
494 $ cd ../repo
495 $ log 'remote(".a.b.c.", "../remote3")'
496
479 $ cd ..
497 $ cd ..
480
498
481 test author/desc/keyword in problematic encoding
499 test author/desc/keyword in problematic encoding
482 # unicode: cp932:
500 # unicode: cp932:
483 # u30A2 0x83 0x41(= 'A')
501 # u30A2 0x83 0x41(= 'A')
484 # u30C2 0x83 0x61(= 'a')
502 # u30C2 0x83 0x61(= 'a')
485
503
486 $ hg init problematicencoding
504 $ hg init problematicencoding
487 $ cd problematicencoding
505 $ cd problematicencoding
488
506
489 $ python > setup.sh <<EOF
507 $ python > setup.sh <<EOF
490 > print u'''
508 > print u'''
491 > echo a > text
509 > echo a > text
492 > hg add text
510 > hg add text
493 > hg --encoding utf-8 commit -u '\u30A2' -m none
511 > hg --encoding utf-8 commit -u '\u30A2' -m none
494 > echo b > text
512 > echo b > text
495 > hg --encoding utf-8 commit -u '\u30C2' -m none
513 > hg --encoding utf-8 commit -u '\u30C2' -m none
496 > echo c > text
514 > echo c > text
497 > hg --encoding utf-8 commit -u none -m '\u30A2'
515 > hg --encoding utf-8 commit -u none -m '\u30A2'
498 > echo d > text
516 > echo d > text
499 > hg --encoding utf-8 commit -u none -m '\u30C2'
517 > hg --encoding utf-8 commit -u none -m '\u30C2'
500 > '''.encode('utf-8')
518 > '''.encode('utf-8')
501 > EOF
519 > EOF
502 $ sh < setup.sh
520 $ sh < setup.sh
503
521
504 test in problematic encoding
522 test in problematic encoding
505 $ python > test.sh <<EOF
523 $ python > test.sh <<EOF
506 > print u'''
524 > print u'''
507 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
525 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
508 > echo ====
526 > echo ====
509 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
527 > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
510 > echo ====
528 > echo ====
511 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
529 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
512 > echo ====
530 > echo ====
513 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
531 > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
514 > echo ====
532 > echo ====
515 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
533 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
516 > echo ====
534 > echo ====
517 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
535 > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
518 > '''.encode('cp932')
536 > '''.encode('cp932')
519 > EOF
537 > EOF
520 $ sh < test.sh
538 $ sh < test.sh
521 0
539 0
522 ====
540 ====
523 1
541 1
524 ====
542 ====
525 2
543 2
526 ====
544 ====
527 3
545 3
528 ====
546 ====
529 0
547 0
530 2
548 2
531 ====
549 ====
532 1
550 1
533 3
551 3
534
552
535 $ cd ..
553 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now