Show More
@@ -1,2322 +1,2343 | |||||
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 | > testrevset=$TESTTMP/testrevset.py |
|
23 | > testrevset=$TESTTMP/testrevset.py | |
24 | > EOF |
|
24 | > EOF | |
25 |
|
25 | |||
26 | $ try() { |
|
26 | $ try() { | |
27 | > hg debugrevspec --debug "$@" |
|
27 | > hg debugrevspec --debug "$@" | |
28 | > } |
|
28 | > } | |
29 |
|
29 | |||
30 | $ log() { |
|
30 | $ log() { | |
31 | > hg log --template '{rev}\n' -r "$1" |
|
31 | > hg log --template '{rev}\n' -r "$1" | |
32 | > } |
|
32 | > } | |
33 |
|
33 | |||
34 | $ hg init repo |
|
34 | $ hg init repo | |
35 | $ cd repo |
|
35 | $ cd repo | |
36 |
|
36 | |||
37 | $ echo a > a |
|
37 | $ echo a > a | |
38 | $ hg branch a |
|
38 | $ hg branch a | |
39 | marked working directory as branch a |
|
39 | marked working directory as branch a | |
40 | (branches are permanent and global, did you want a bookmark?) |
|
40 | (branches are permanent and global, did you want a bookmark?) | |
41 | $ hg ci -Aqm0 |
|
41 | $ hg ci -Aqm0 | |
42 |
|
42 | |||
43 | $ echo b > b |
|
43 | $ echo b > b | |
44 | $ hg branch b |
|
44 | $ hg branch b | |
45 | marked working directory as branch b |
|
45 | marked working directory as branch b | |
46 | $ hg ci -Aqm1 |
|
46 | $ hg ci -Aqm1 | |
47 |
|
47 | |||
48 | $ rm a |
|
48 | $ rm a | |
49 | $ hg branch a-b-c- |
|
49 | $ hg branch a-b-c- | |
50 | marked working directory as branch a-b-c- |
|
50 | marked working directory as branch a-b-c- | |
51 | $ hg ci -Aqm2 -u Bob |
|
51 | $ hg ci -Aqm2 -u Bob | |
52 |
|
52 | |||
53 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' |
|
53 | $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' | |
54 | 2 |
|
54 | 2 | |
55 | $ hg log -r "extra('branch')" --template '{rev}\n' |
|
55 | $ hg log -r "extra('branch')" --template '{rev}\n' | |
56 | 0 |
|
56 | 0 | |
57 | 1 |
|
57 | 1 | |
58 | 2 |
|
58 | 2 | |
59 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' |
|
59 | $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' | |
60 | 0 a |
|
60 | 0 a | |
61 | 2 a-b-c- |
|
61 | 2 a-b-c- | |
62 |
|
62 | |||
63 | $ hg co 1 |
|
63 | $ hg co 1 | |
64 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
64 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
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 | $ hg ci -Aqm3 |
|
67 | $ hg ci -Aqm3 | |
68 |
|
68 | |||
69 | $ hg co 2 # interleave |
|
69 | $ hg co 2 # interleave | |
70 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
70 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
71 | $ echo bb > b |
|
71 | $ echo bb > b | |
72 | $ hg branch -- -a-b-c- |
|
72 | $ hg branch -- -a-b-c- | |
73 | marked working directory as branch -a-b-c- |
|
73 | marked working directory as branch -a-b-c- | |
74 | $ hg ci -Aqm4 -d "May 12 2005" |
|
74 | $ hg ci -Aqm4 -d "May 12 2005" | |
75 |
|
75 | |||
76 | $ hg co 3 |
|
76 | $ hg co 3 | |
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 | $ hg branch !a/b/c/ |
|
78 | $ hg branch !a/b/c/ | |
79 | marked working directory as branch !a/b/c/ |
|
79 | marked working directory as branch !a/b/c/ | |
80 | $ hg ci -Aqm"5 bug" |
|
80 | $ hg ci -Aqm"5 bug" | |
81 |
|
81 | |||
82 | $ hg merge 4 |
|
82 | $ hg merge 4 | |
83 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
83 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
84 | (branch merge, don't forget to commit) |
|
84 | (branch merge, don't forget to commit) | |
85 | $ hg branch _a_b_c_ |
|
85 | $ hg branch _a_b_c_ | |
86 | marked working directory as branch _a_b_c_ |
|
86 | marked working directory as branch _a_b_c_ | |
87 | $ hg ci -Aqm"6 issue619" |
|
87 | $ hg ci -Aqm"6 issue619" | |
88 |
|
88 | |||
89 | $ hg branch .a.b.c. |
|
89 | $ hg branch .a.b.c. | |
90 | marked working directory as branch .a.b.c. |
|
90 | marked working directory as branch .a.b.c. | |
91 | $ hg ci -Aqm7 |
|
91 | $ hg ci -Aqm7 | |
92 |
|
92 | |||
93 | $ hg branch all |
|
93 | $ hg branch all | |
94 | marked working directory as branch all |
|
94 | marked working directory as branch all | |
95 |
|
95 | |||
96 | $ hg co 4 |
|
96 | $ hg co 4 | |
97 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
98 | $ hg branch Γ© |
|
98 | $ hg branch Γ© | |
99 | marked working directory as branch \xc3\xa9 (esc) |
|
99 | marked working directory as branch \xc3\xa9 (esc) | |
100 | $ hg ci -Aqm9 |
|
100 | $ hg ci -Aqm9 | |
101 |
|
101 | |||
102 | $ hg tag -r6 1.0 |
|
102 | $ hg tag -r6 1.0 | |
103 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
103 | $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
104 |
|
104 | |||
105 | $ hg clone --quiet -U -r 7 . ../remote1 |
|
105 | $ hg clone --quiet -U -r 7 . ../remote1 | |
106 | $ hg clone --quiet -U -r 8 . ../remote2 |
|
106 | $ hg clone --quiet -U -r 8 . ../remote2 | |
107 | $ echo "[paths]" >> .hg/hgrc |
|
107 | $ echo "[paths]" >> .hg/hgrc | |
108 | $ echo "default = ../remote1" >> .hg/hgrc |
|
108 | $ echo "default = ../remote1" >> .hg/hgrc | |
109 |
|
109 | |||
110 | trivial |
|
110 | trivial | |
111 |
|
111 | |||
112 | $ try 0:1 |
|
112 | $ try 0:1 | |
113 | (range |
|
113 | (range | |
114 | ('symbol', '0') |
|
114 | ('symbol', '0') | |
115 | ('symbol', '1')) |
|
115 | ('symbol', '1')) | |
116 | * set: |
|
116 | * set: | |
117 | <spanset+ 0:1> |
|
117 | <spanset+ 0:1> | |
118 | 0 |
|
118 | 0 | |
119 | 1 |
|
119 | 1 | |
120 | $ try --optimize : |
|
120 | $ try --optimize : | |
121 | (rangeall |
|
121 | (rangeall | |
122 | None) |
|
122 | None) | |
123 | * optimized: |
|
123 | * optimized: | |
124 | (range |
|
124 | (range | |
125 | ('string', '0') |
|
125 | ('string', '0') | |
126 | ('string', 'tip')) |
|
126 | ('string', 'tip')) | |
127 | * set: |
|
127 | * set: | |
128 | <spanset+ 0:9> |
|
128 | <spanset+ 0:9> | |
129 | 0 |
|
129 | 0 | |
130 | 1 |
|
130 | 1 | |
131 | 2 |
|
131 | 2 | |
132 | 3 |
|
132 | 3 | |
133 | 4 |
|
133 | 4 | |
134 | 5 |
|
134 | 5 | |
135 | 6 |
|
135 | 6 | |
136 | 7 |
|
136 | 7 | |
137 | 8 |
|
137 | 8 | |
138 | 9 |
|
138 | 9 | |
139 | $ try 3::6 |
|
139 | $ try 3::6 | |
140 | (dagrange |
|
140 | (dagrange | |
141 | ('symbol', '3') |
|
141 | ('symbol', '3') | |
142 | ('symbol', '6')) |
|
142 | ('symbol', '6')) | |
143 | * set: |
|
143 | * set: | |
144 | <baseset+ [3, 5, 6]> |
|
144 | <baseset+ [3, 5, 6]> | |
145 | 3 |
|
145 | 3 | |
146 | 5 |
|
146 | 5 | |
147 | 6 |
|
147 | 6 | |
148 | $ try '0|1|2' |
|
148 | $ try '0|1|2' | |
149 | (or |
|
149 | (or | |
150 | ('symbol', '0') |
|
150 | ('symbol', '0') | |
151 | ('symbol', '1') |
|
151 | ('symbol', '1') | |
152 | ('symbol', '2')) |
|
152 | ('symbol', '2')) | |
153 | * set: |
|
153 | * set: | |
154 | <baseset [0, 1, 2]> |
|
154 | <baseset [0, 1, 2]> | |
155 | 0 |
|
155 | 0 | |
156 | 1 |
|
156 | 1 | |
157 | 2 |
|
157 | 2 | |
158 |
|
158 | |||
159 | names that should work without quoting |
|
159 | names that should work without quoting | |
160 |
|
160 | |||
161 | $ try a |
|
161 | $ try a | |
162 | ('symbol', 'a') |
|
162 | ('symbol', 'a') | |
163 | * set: |
|
163 | * set: | |
164 | <baseset [0]> |
|
164 | <baseset [0]> | |
165 | 0 |
|
165 | 0 | |
166 | $ try b-a |
|
166 | $ try b-a | |
167 | (minus |
|
167 | (minus | |
168 | ('symbol', 'b') |
|
168 | ('symbol', 'b') | |
169 | ('symbol', 'a')) |
|
169 | ('symbol', 'a')) | |
170 | * set: |
|
170 | * set: | |
171 | <filteredset |
|
171 | <filteredset | |
172 | <baseset [1]>, |
|
172 | <baseset [1]>, | |
173 | <not |
|
173 | <not | |
174 | <baseset [0]>>> |
|
174 | <baseset [0]>>> | |
175 | 1 |
|
175 | 1 | |
176 | $ try _a_b_c_ |
|
176 | $ try _a_b_c_ | |
177 | ('symbol', '_a_b_c_') |
|
177 | ('symbol', '_a_b_c_') | |
178 | * set: |
|
178 | * set: | |
179 | <baseset [6]> |
|
179 | <baseset [6]> | |
180 | 6 |
|
180 | 6 | |
181 | $ try _a_b_c_-a |
|
181 | $ try _a_b_c_-a | |
182 | (minus |
|
182 | (minus | |
183 | ('symbol', '_a_b_c_') |
|
183 | ('symbol', '_a_b_c_') | |
184 | ('symbol', 'a')) |
|
184 | ('symbol', 'a')) | |
185 | * set: |
|
185 | * set: | |
186 | <filteredset |
|
186 | <filteredset | |
187 | <baseset [6]>, |
|
187 | <baseset [6]>, | |
188 | <not |
|
188 | <not | |
189 | <baseset [0]>>> |
|
189 | <baseset [0]>>> | |
190 | 6 |
|
190 | 6 | |
191 | $ try .a.b.c. |
|
191 | $ try .a.b.c. | |
192 | ('symbol', '.a.b.c.') |
|
192 | ('symbol', '.a.b.c.') | |
193 | * set: |
|
193 | * set: | |
194 | <baseset [7]> |
|
194 | <baseset [7]> | |
195 | 7 |
|
195 | 7 | |
196 | $ try .a.b.c.-a |
|
196 | $ try .a.b.c.-a | |
197 | (minus |
|
197 | (minus | |
198 | ('symbol', '.a.b.c.') |
|
198 | ('symbol', '.a.b.c.') | |
199 | ('symbol', 'a')) |
|
199 | ('symbol', 'a')) | |
200 | * set: |
|
200 | * set: | |
201 | <filteredset |
|
201 | <filteredset | |
202 | <baseset [7]>, |
|
202 | <baseset [7]>, | |
203 | <not |
|
203 | <not | |
204 | <baseset [0]>>> |
|
204 | <baseset [0]>>> | |
205 | 7 |
|
205 | 7 | |
206 |
|
206 | |||
207 | names that should be caught by fallback mechanism |
|
207 | names that should be caught by fallback mechanism | |
208 |
|
208 | |||
209 | $ try -- '-a-b-c-' |
|
209 | $ try -- '-a-b-c-' | |
210 | ('symbol', '-a-b-c-') |
|
210 | ('symbol', '-a-b-c-') | |
211 | * set: |
|
211 | * set: | |
212 | <baseset [4]> |
|
212 | <baseset [4]> | |
213 | 4 |
|
213 | 4 | |
214 | $ log -a-b-c- |
|
214 | $ log -a-b-c- | |
215 | 4 |
|
215 | 4 | |
216 | $ try '+a+b+c+' |
|
216 | $ try '+a+b+c+' | |
217 | ('symbol', '+a+b+c+') |
|
217 | ('symbol', '+a+b+c+') | |
218 | * set: |
|
218 | * set: | |
219 | <baseset [3]> |
|
219 | <baseset [3]> | |
220 | 3 |
|
220 | 3 | |
221 | $ try '+a+b+c+:' |
|
221 | $ try '+a+b+c+:' | |
222 | (rangepost |
|
222 | (rangepost | |
223 | ('symbol', '+a+b+c+')) |
|
223 | ('symbol', '+a+b+c+')) | |
224 | * set: |
|
224 | * set: | |
225 | <spanset+ 3:9> |
|
225 | <spanset+ 3:9> | |
226 | 3 |
|
226 | 3 | |
227 | 4 |
|
227 | 4 | |
228 | 5 |
|
228 | 5 | |
229 | 6 |
|
229 | 6 | |
230 | 7 |
|
230 | 7 | |
231 | 8 |
|
231 | 8 | |
232 | 9 |
|
232 | 9 | |
233 | $ try ':+a+b+c+' |
|
233 | $ try ':+a+b+c+' | |
234 | (rangepre |
|
234 | (rangepre | |
235 | ('symbol', '+a+b+c+')) |
|
235 | ('symbol', '+a+b+c+')) | |
236 | * set: |
|
236 | * set: | |
237 | <spanset+ 0:3> |
|
237 | <spanset+ 0:3> | |
238 | 0 |
|
238 | 0 | |
239 | 1 |
|
239 | 1 | |
240 | 2 |
|
240 | 2 | |
241 | 3 |
|
241 | 3 | |
242 | $ try -- '-a-b-c-:+a+b+c+' |
|
242 | $ try -- '-a-b-c-:+a+b+c+' | |
243 | (range |
|
243 | (range | |
244 | ('symbol', '-a-b-c-') |
|
244 | ('symbol', '-a-b-c-') | |
245 | ('symbol', '+a+b+c+')) |
|
245 | ('symbol', '+a+b+c+')) | |
246 | * set: |
|
246 | * set: | |
247 | <spanset- 3:4> |
|
247 | <spanset- 3:4> | |
248 | 4 |
|
248 | 4 | |
249 | 3 |
|
249 | 3 | |
250 | $ log '-a-b-c-:+a+b+c+' |
|
250 | $ log '-a-b-c-:+a+b+c+' | |
251 | 4 |
|
251 | 4 | |
252 | 3 |
|
252 | 3 | |
253 |
|
253 | |||
254 | $ try -- -a-b-c--a # complains |
|
254 | $ try -- -a-b-c--a # complains | |
255 | (minus |
|
255 | (minus | |
256 | (minus |
|
256 | (minus | |
257 | (minus |
|
257 | (minus | |
258 | (negate |
|
258 | (negate | |
259 | ('symbol', 'a')) |
|
259 | ('symbol', 'a')) | |
260 | ('symbol', 'b')) |
|
260 | ('symbol', 'b')) | |
261 | ('symbol', 'c')) |
|
261 | ('symbol', 'c')) | |
262 | (negate |
|
262 | (negate | |
263 | ('symbol', 'a'))) |
|
263 | ('symbol', 'a'))) | |
264 | abort: unknown revision '-a'! |
|
264 | abort: unknown revision '-a'! | |
265 | [255] |
|
265 | [255] | |
266 | $ try Γ© |
|
266 | $ try Γ© | |
267 | ('symbol', '\xc3\xa9') |
|
267 | ('symbol', '\xc3\xa9') | |
268 | * set: |
|
268 | * set: | |
269 | <baseset [9]> |
|
269 | <baseset [9]> | |
270 | 9 |
|
270 | 9 | |
271 |
|
271 | |||
272 | no quoting needed |
|
272 | no quoting needed | |
273 |
|
273 | |||
274 | $ log ::a-b-c- |
|
274 | $ log ::a-b-c- | |
275 | 0 |
|
275 | 0 | |
276 | 1 |
|
276 | 1 | |
277 | 2 |
|
277 | 2 | |
278 |
|
278 | |||
279 | quoting needed |
|
279 | quoting needed | |
280 |
|
280 | |||
281 | $ try '"-a-b-c-"-a' |
|
281 | $ try '"-a-b-c-"-a' | |
282 | (minus |
|
282 | (minus | |
283 | ('string', '-a-b-c-') |
|
283 | ('string', '-a-b-c-') | |
284 | ('symbol', 'a')) |
|
284 | ('symbol', 'a')) | |
285 | * set: |
|
285 | * set: | |
286 | <filteredset |
|
286 | <filteredset | |
287 | <baseset [4]>, |
|
287 | <baseset [4]>, | |
288 | <not |
|
288 | <not | |
289 | <baseset [0]>>> |
|
289 | <baseset [0]>>> | |
290 | 4 |
|
290 | 4 | |
291 |
|
291 | |||
292 | $ log '1 or 2' |
|
292 | $ log '1 or 2' | |
293 | 1 |
|
293 | 1 | |
294 | 2 |
|
294 | 2 | |
295 | $ log '1|2' |
|
295 | $ log '1|2' | |
296 | 1 |
|
296 | 1 | |
297 | 2 |
|
297 | 2 | |
298 | $ log '1 and 2' |
|
298 | $ log '1 and 2' | |
299 | $ log '1&2' |
|
299 | $ log '1&2' | |
300 | $ try '1&2|3' # precedence - and is higher |
|
300 | $ try '1&2|3' # precedence - and is higher | |
301 | (or |
|
301 | (or | |
302 | (and |
|
302 | (and | |
303 | ('symbol', '1') |
|
303 | ('symbol', '1') | |
304 | ('symbol', '2')) |
|
304 | ('symbol', '2')) | |
305 | ('symbol', '3')) |
|
305 | ('symbol', '3')) | |
306 | * set: |
|
306 | * set: | |
307 | <addset |
|
307 | <addset | |
308 | <baseset []>, |
|
308 | <baseset []>, | |
309 | <baseset [3]>> |
|
309 | <baseset [3]>> | |
310 | 3 |
|
310 | 3 | |
311 | $ try '1|2&3' |
|
311 | $ try '1|2&3' | |
312 | (or |
|
312 | (or | |
313 | ('symbol', '1') |
|
313 | ('symbol', '1') | |
314 | (and |
|
314 | (and | |
315 | ('symbol', '2') |
|
315 | ('symbol', '2') | |
316 | ('symbol', '3'))) |
|
316 | ('symbol', '3'))) | |
317 | * set: |
|
317 | * set: | |
318 | <addset |
|
318 | <addset | |
319 | <baseset [1]>, |
|
319 | <baseset [1]>, | |
320 | <baseset []>> |
|
320 | <baseset []>> | |
321 | 1 |
|
321 | 1 | |
322 | $ try '1&2&3' # associativity |
|
322 | $ try '1&2&3' # associativity | |
323 | (and |
|
323 | (and | |
324 | (and |
|
324 | (and | |
325 | ('symbol', '1') |
|
325 | ('symbol', '1') | |
326 | ('symbol', '2')) |
|
326 | ('symbol', '2')) | |
327 | ('symbol', '3')) |
|
327 | ('symbol', '3')) | |
328 | * set: |
|
328 | * set: | |
329 | <baseset []> |
|
329 | <baseset []> | |
330 | $ try '1|(2|3)' |
|
330 | $ try '1|(2|3)' | |
331 | (or |
|
331 | (or | |
332 | ('symbol', '1') |
|
332 | ('symbol', '1') | |
333 | (group |
|
333 | (group | |
334 | (or |
|
334 | (or | |
335 | ('symbol', '2') |
|
335 | ('symbol', '2') | |
336 | ('symbol', '3')))) |
|
336 | ('symbol', '3')))) | |
337 | * set: |
|
337 | * set: | |
338 | <addset |
|
338 | <addset | |
339 | <baseset [1]>, |
|
339 | <baseset [1]>, | |
340 | <baseset [2, 3]>> |
|
340 | <baseset [2, 3]>> | |
341 | 1 |
|
341 | 1 | |
342 | 2 |
|
342 | 2 | |
343 | 3 |
|
343 | 3 | |
344 | $ log '1.0' # tag |
|
344 | $ log '1.0' # tag | |
345 | 6 |
|
345 | 6 | |
346 | $ log 'a' # branch |
|
346 | $ log 'a' # branch | |
347 | 0 |
|
347 | 0 | |
348 | $ log '2785f51ee' |
|
348 | $ log '2785f51ee' | |
349 | 0 |
|
349 | 0 | |
350 | $ log 'date(2005)' |
|
350 | $ log 'date(2005)' | |
351 | 4 |
|
351 | 4 | |
352 | $ log 'date(this is a test)' |
|
352 | $ log 'date(this is a test)' | |
353 | hg: parse error at 10: unexpected token: symbol |
|
353 | hg: parse error at 10: unexpected token: symbol | |
354 | [255] |
|
354 | [255] | |
355 | $ log 'date()' |
|
355 | $ log 'date()' | |
356 | hg: parse error: date requires a string |
|
356 | hg: parse error: date requires a string | |
357 | [255] |
|
357 | [255] | |
358 | $ log 'date' |
|
358 | $ log 'date' | |
359 | abort: unknown revision 'date'! |
|
359 | abort: unknown revision 'date'! | |
360 | [255] |
|
360 | [255] | |
361 | $ log 'date(' |
|
361 | $ log 'date(' | |
362 | hg: parse error at 5: not a prefix: end |
|
362 | hg: parse error at 5: not a prefix: end | |
363 | [255] |
|
363 | [255] | |
364 | $ log 'date("\xy")' |
|
364 | $ log 'date("\xy")' | |
365 | hg: parse error: invalid \x escape |
|
365 | hg: parse error: invalid \x escape | |
366 | [255] |
|
366 | [255] | |
367 | $ log 'date(tip)' |
|
367 | $ log 'date(tip)' | |
368 | abort: invalid date: 'tip' |
|
368 | abort: invalid date: 'tip' | |
369 | [255] |
|
369 | [255] | |
370 | $ log '0:date' |
|
370 | $ log '0:date' | |
371 | abort: unknown revision 'date'! |
|
371 | abort: unknown revision 'date'! | |
372 | [255] |
|
372 | [255] | |
373 | $ log '::"date"' |
|
373 | $ log '::"date"' | |
374 | abort: unknown revision 'date'! |
|
374 | abort: unknown revision 'date'! | |
375 | [255] |
|
375 | [255] | |
376 | $ hg book date -r 4 |
|
376 | $ hg book date -r 4 | |
377 | $ log '0:date' |
|
377 | $ log '0:date' | |
378 | 0 |
|
378 | 0 | |
379 | 1 |
|
379 | 1 | |
380 | 2 |
|
380 | 2 | |
381 | 3 |
|
381 | 3 | |
382 | 4 |
|
382 | 4 | |
383 | $ log '::date' |
|
383 | $ log '::date' | |
384 | 0 |
|
384 | 0 | |
385 | 1 |
|
385 | 1 | |
386 | 2 |
|
386 | 2 | |
387 | 4 |
|
387 | 4 | |
388 | $ log '::"date"' |
|
388 | $ log '::"date"' | |
389 | 0 |
|
389 | 0 | |
390 | 1 |
|
390 | 1 | |
391 | 2 |
|
391 | 2 | |
392 | 4 |
|
392 | 4 | |
393 | $ log 'date(2005) and 1::' |
|
393 | $ log 'date(2005) and 1::' | |
394 | 4 |
|
394 | 4 | |
395 | $ hg book -d date |
|
395 | $ hg book -d date | |
396 |
|
396 | |||
397 | keyword arguments |
|
397 | keyword arguments | |
398 |
|
398 | |||
399 | $ log 'extra(branch, value=a)' |
|
399 | $ log 'extra(branch, value=a)' | |
400 | 0 |
|
400 | 0 | |
401 |
|
401 | |||
402 | $ log 'extra(branch, a, b)' |
|
402 | $ log 'extra(branch, a, b)' | |
403 | hg: parse error: extra takes at most 2 arguments |
|
403 | hg: parse error: extra takes at most 2 arguments | |
404 | [255] |
|
404 | [255] | |
405 | $ log 'extra(a, label=b)' |
|
405 | $ log 'extra(a, label=b)' | |
406 | hg: parse error: extra got multiple values for keyword argument 'label' |
|
406 | hg: parse error: extra got multiple values for keyword argument 'label' | |
407 | [255] |
|
407 | [255] | |
408 | $ log 'extra(label=branch, default)' |
|
408 | $ log 'extra(label=branch, default)' | |
409 | hg: parse error: extra got an invalid argument |
|
409 | hg: parse error: extra got an invalid argument | |
410 | [255] |
|
410 | [255] | |
411 | $ log 'extra(branch, foo+bar=baz)' |
|
411 | $ log 'extra(branch, foo+bar=baz)' | |
412 | hg: parse error: extra got an invalid argument |
|
412 | hg: parse error: extra got an invalid argument | |
413 | [255] |
|
413 | [255] | |
414 | $ log 'extra(unknown=branch)' |
|
414 | $ log 'extra(unknown=branch)' | |
415 | hg: parse error: extra got an unexpected keyword argument 'unknown' |
|
415 | hg: parse error: extra got an unexpected keyword argument 'unknown' | |
416 | [255] |
|
416 | [255] | |
417 |
|
417 | |||
418 | $ try 'foo=bar|baz' |
|
418 | $ try 'foo=bar|baz' | |
419 | (keyvalue |
|
419 | (keyvalue | |
420 | ('symbol', 'foo') |
|
420 | ('symbol', 'foo') | |
421 | (or |
|
421 | (or | |
422 | ('symbol', 'bar') |
|
422 | ('symbol', 'bar') | |
423 | ('symbol', 'baz'))) |
|
423 | ('symbol', 'baz'))) | |
424 | hg: parse error: can't use a key-value pair in this context |
|
424 | hg: parse error: can't use a key-value pair in this context | |
425 | [255] |
|
425 | [255] | |
426 |
|
426 | |||
427 | Test that symbols only get parsed as functions if there's an opening |
|
427 | Test that symbols only get parsed as functions if there's an opening | |
428 | parenthesis. |
|
428 | parenthesis. | |
429 |
|
429 | |||
430 | $ hg book only -r 9 |
|
430 | $ hg book only -r 9 | |
431 | $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark |
|
431 | $ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark | |
432 | 8 |
|
432 | 8 | |
433 | 9 |
|
433 | 9 | |
434 |
|
434 | |||
435 | ancestor can accept 0 or more arguments |
|
435 | ancestor can accept 0 or more arguments | |
436 |
|
436 | |||
437 | $ log 'ancestor()' |
|
437 | $ log 'ancestor()' | |
438 | $ log 'ancestor(1)' |
|
438 | $ log 'ancestor(1)' | |
439 | 1 |
|
439 | 1 | |
440 | $ log 'ancestor(4,5)' |
|
440 | $ log 'ancestor(4,5)' | |
441 | 1 |
|
441 | 1 | |
442 | $ log 'ancestor(4,5) and 4' |
|
442 | $ log 'ancestor(4,5) and 4' | |
443 | $ log 'ancestor(0,0,1,3)' |
|
443 | $ log 'ancestor(0,0,1,3)' | |
444 | 0 |
|
444 | 0 | |
445 | $ log 'ancestor(3,1,5,3,5,1)' |
|
445 | $ log 'ancestor(3,1,5,3,5,1)' | |
446 | 1 |
|
446 | 1 | |
447 | $ log 'ancestor(0,1,3,5)' |
|
447 | $ log 'ancestor(0,1,3,5)' | |
448 | 0 |
|
448 | 0 | |
449 | $ log 'ancestor(1,2,3,4,5)' |
|
449 | $ log 'ancestor(1,2,3,4,5)' | |
450 | 1 |
|
450 | 1 | |
451 |
|
451 | |||
452 | test ancestors |
|
452 | test ancestors | |
453 |
|
453 | |||
454 | $ log 'ancestors(5)' |
|
454 | $ log 'ancestors(5)' | |
455 | 0 |
|
455 | 0 | |
456 | 1 |
|
456 | 1 | |
457 | 3 |
|
457 | 3 | |
458 | 5 |
|
458 | 5 | |
459 | $ log 'ancestor(ancestors(5))' |
|
459 | $ log 'ancestor(ancestors(5))' | |
460 | 0 |
|
460 | 0 | |
461 | $ log '::r3232()' |
|
461 | $ log '::r3232()' | |
462 | 0 |
|
462 | 0 | |
463 | 1 |
|
463 | 1 | |
464 | 2 |
|
464 | 2 | |
465 | 3 |
|
465 | 3 | |
466 |
|
466 | |||
467 | $ log 'author(bob)' |
|
467 | $ log 'author(bob)' | |
468 | 2 |
|
468 | 2 | |
469 | $ log 'author("re:bob|test")' |
|
469 | $ log 'author("re:bob|test")' | |
470 | 0 |
|
470 | 0 | |
471 | 1 |
|
471 | 1 | |
472 | 2 |
|
472 | 2 | |
473 | 3 |
|
473 | 3 | |
474 | 4 |
|
474 | 4 | |
475 | 5 |
|
475 | 5 | |
476 | 6 |
|
476 | 6 | |
477 | 7 |
|
477 | 7 | |
478 | 8 |
|
478 | 8 | |
479 | 9 |
|
479 | 9 | |
480 | $ log 'branch(Γ©)' |
|
480 | $ log 'branch(Γ©)' | |
481 | 8 |
|
481 | 8 | |
482 | 9 |
|
482 | 9 | |
483 | $ log 'branch(a)' |
|
483 | $ log 'branch(a)' | |
484 | 0 |
|
484 | 0 | |
485 | $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n' |
|
485 | $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n' | |
486 | 0 a |
|
486 | 0 a | |
487 | 2 a-b-c- |
|
487 | 2 a-b-c- | |
488 | 3 +a+b+c+ |
|
488 | 3 +a+b+c+ | |
489 | 4 -a-b-c- |
|
489 | 4 -a-b-c- | |
490 | 5 !a/b/c/ |
|
490 | 5 !a/b/c/ | |
491 | 6 _a_b_c_ |
|
491 | 6 _a_b_c_ | |
492 | 7 .a.b.c. |
|
492 | 7 .a.b.c. | |
493 | $ log 'children(ancestor(4,5))' |
|
493 | $ log 'children(ancestor(4,5))' | |
494 | 2 |
|
494 | 2 | |
495 | 3 |
|
495 | 3 | |
496 | $ log 'closed()' |
|
496 | $ log 'closed()' | |
497 | $ log 'contains(a)' |
|
497 | $ log 'contains(a)' | |
498 | 0 |
|
498 | 0 | |
499 | 1 |
|
499 | 1 | |
500 | 3 |
|
500 | 3 | |
501 | 5 |
|
501 | 5 | |
502 | $ log 'contains("../repo/a")' |
|
502 | $ log 'contains("../repo/a")' | |
503 | 0 |
|
503 | 0 | |
504 | 1 |
|
504 | 1 | |
505 | 3 |
|
505 | 3 | |
506 | 5 |
|
506 | 5 | |
507 | $ log 'desc(B)' |
|
507 | $ log 'desc(B)' | |
508 | 5 |
|
508 | 5 | |
509 | $ log 'descendants(2 or 3)' |
|
509 | $ log 'descendants(2 or 3)' | |
510 | 2 |
|
510 | 2 | |
511 | 3 |
|
511 | 3 | |
512 | 4 |
|
512 | 4 | |
513 | 5 |
|
513 | 5 | |
514 | 6 |
|
514 | 6 | |
515 | 7 |
|
515 | 7 | |
516 | 8 |
|
516 | 8 | |
517 | 9 |
|
517 | 9 | |
518 | $ log 'file("b*")' |
|
518 | $ log 'file("b*")' | |
519 | 1 |
|
519 | 1 | |
520 | 4 |
|
520 | 4 | |
521 | $ log 'filelog("b")' |
|
521 | $ log 'filelog("b")' | |
522 | 1 |
|
522 | 1 | |
523 | 4 |
|
523 | 4 | |
524 | $ log 'filelog("../repo/b")' |
|
524 | $ log 'filelog("../repo/b")' | |
525 | 1 |
|
525 | 1 | |
526 | 4 |
|
526 | 4 | |
527 | $ log 'follow()' |
|
527 | $ log 'follow()' | |
528 | 0 |
|
528 | 0 | |
529 | 1 |
|
529 | 1 | |
530 | 2 |
|
530 | 2 | |
531 | 4 |
|
531 | 4 | |
532 | 8 |
|
532 | 8 | |
533 | 9 |
|
533 | 9 | |
534 | $ log 'grep("issue\d+")' |
|
534 | $ log 'grep("issue\d+")' | |
535 | 6 |
|
535 | 6 | |
536 | $ try 'grep("(")' # invalid regular expression |
|
536 | $ try 'grep("(")' # invalid regular expression | |
537 | (func |
|
537 | (func | |
538 | ('symbol', 'grep') |
|
538 | ('symbol', 'grep') | |
539 | ('string', '(')) |
|
539 | ('string', '(')) | |
540 | hg: parse error: invalid match pattern: unbalanced parenthesis |
|
540 | hg: parse error: invalid match pattern: unbalanced parenthesis | |
541 | [255] |
|
541 | [255] | |
542 | $ try 'grep("\bissue\d+")' |
|
542 | $ try 'grep("\bissue\d+")' | |
543 | (func |
|
543 | (func | |
544 | ('symbol', 'grep') |
|
544 | ('symbol', 'grep') | |
545 | ('string', '\x08issue\\d+')) |
|
545 | ('string', '\x08issue\\d+')) | |
546 | * set: |
|
546 | * set: | |
547 | <filteredset |
|
547 | <filteredset | |
548 | <fullreposet+ 0:9>, |
|
548 | <fullreposet+ 0:9>, | |
549 | <grep '\x08issue\\d+'>> |
|
549 | <grep '\x08issue\\d+'>> | |
550 | $ try 'grep(r"\bissue\d+")' |
|
550 | $ try 'grep(r"\bissue\d+")' | |
551 | (func |
|
551 | (func | |
552 | ('symbol', 'grep') |
|
552 | ('symbol', 'grep') | |
553 | ('string', '\\bissue\\d+')) |
|
553 | ('string', '\\bissue\\d+')) | |
554 | * set: |
|
554 | * set: | |
555 | <filteredset |
|
555 | <filteredset | |
556 | <fullreposet+ 0:9>, |
|
556 | <fullreposet+ 0:9>, | |
557 | <grep '\\bissue\\d+'>> |
|
557 | <grep '\\bissue\\d+'>> | |
558 | 6 |
|
558 | 6 | |
559 | $ try 'grep(r"\")' |
|
559 | $ try 'grep(r"\")' | |
560 | hg: parse error at 7: unterminated string |
|
560 | hg: parse error at 7: unterminated string | |
561 | [255] |
|
561 | [255] | |
562 | $ log 'head()' |
|
562 | $ log 'head()' | |
563 | 0 |
|
563 | 0 | |
564 | 1 |
|
564 | 1 | |
565 | 2 |
|
565 | 2 | |
566 | 3 |
|
566 | 3 | |
567 | 4 |
|
567 | 4 | |
568 | 5 |
|
568 | 5 | |
569 | 6 |
|
569 | 6 | |
570 | 7 |
|
570 | 7 | |
571 | 9 |
|
571 | 9 | |
572 | $ log 'heads(6::)' |
|
572 | $ log 'heads(6::)' | |
573 | 7 |
|
573 | 7 | |
574 | $ log 'keyword(issue)' |
|
574 | $ log 'keyword(issue)' | |
575 | 6 |
|
575 | 6 | |
576 | $ log 'keyword("test a")' |
|
576 | $ log 'keyword("test a")' | |
577 | $ log 'limit(head(), 1)' |
|
577 | $ log 'limit(head(), 1)' | |
578 | 0 |
|
578 | 0 | |
579 | $ log 'limit(author("re:bob|test"), 3, 5)' |
|
579 | $ log 'limit(author("re:bob|test"), 3, 5)' | |
580 | 5 |
|
580 | 5 | |
581 | 6 |
|
581 | 6 | |
582 | 7 |
|
582 | 7 | |
583 | $ log 'limit(author("re:bob|test"), offset=6)' |
|
583 | $ log 'limit(author("re:bob|test"), offset=6)' | |
584 | 6 |
|
584 | 6 | |
585 | $ log 'limit(author("re:bob|test"), offset=10)' |
|
585 | $ log 'limit(author("re:bob|test"), offset=10)' | |
586 | $ log 'limit(all(), 1, -1)' |
|
586 | $ log 'limit(all(), 1, -1)' | |
587 | hg: parse error: negative offset |
|
587 | hg: parse error: negative offset | |
588 | [255] |
|
588 | [255] | |
589 | $ log 'matching(6)' |
|
589 | $ log 'matching(6)' | |
590 | 6 |
|
590 | 6 | |
591 | $ log 'matching(6:7, "phase parents user date branch summary files description substate")' |
|
591 | $ log 'matching(6:7, "phase parents user date branch summary files description substate")' | |
592 | 6 |
|
592 | 6 | |
593 | 7 |
|
593 | 7 | |
594 |
|
594 | |||
595 | Testing min and max |
|
595 | Testing min and max | |
596 |
|
596 | |||
597 | max: simple |
|
597 | max: simple | |
598 |
|
598 | |||
599 | $ log 'max(contains(a))' |
|
599 | $ log 'max(contains(a))' | |
600 | 5 |
|
600 | 5 | |
601 |
|
601 | |||
602 | max: simple on unordered set) |
|
602 | max: simple on unordered set) | |
603 |
|
603 | |||
604 | $ log 'max((4+0+2+5+7) and contains(a))' |
|
604 | $ log 'max((4+0+2+5+7) and contains(a))' | |
605 | 5 |
|
605 | 5 | |
606 |
|
606 | |||
607 | max: no result |
|
607 | max: no result | |
608 |
|
608 | |||
609 | $ log 'max(contains(stringthatdoesnotappearanywhere))' |
|
609 | $ log 'max(contains(stringthatdoesnotappearanywhere))' | |
610 |
|
610 | |||
611 | max: no result on unordered set |
|
611 | max: no result on unordered set | |
612 |
|
612 | |||
613 | $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
613 | $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' | |
614 |
|
614 | |||
615 | min: simple |
|
615 | min: simple | |
616 |
|
616 | |||
617 | $ log 'min(contains(a))' |
|
617 | $ log 'min(contains(a))' | |
618 | 0 |
|
618 | 0 | |
619 |
|
619 | |||
620 | min: simple on unordered set |
|
620 | min: simple on unordered set | |
621 |
|
621 | |||
622 | $ log 'min((4+0+2+5+7) and contains(a))' |
|
622 | $ log 'min((4+0+2+5+7) and contains(a))' | |
623 | 0 |
|
623 | 0 | |
624 |
|
624 | |||
625 | min: empty |
|
625 | min: empty | |
626 |
|
626 | |||
627 | $ log 'min(contains(stringthatdoesnotappearanywhere))' |
|
627 | $ log 'min(contains(stringthatdoesnotappearanywhere))' | |
628 |
|
628 | |||
629 | min: empty on unordered set |
|
629 | min: empty on unordered set | |
630 |
|
630 | |||
631 | $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' |
|
631 | $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))' | |
632 |
|
632 | |||
633 |
|
633 | |||
634 | $ log 'merge()' |
|
634 | $ log 'merge()' | |
635 | 6 |
|
635 | 6 | |
636 | $ log 'branchpoint()' |
|
636 | $ log 'branchpoint()' | |
637 | 1 |
|
637 | 1 | |
638 | 4 |
|
638 | 4 | |
639 | $ log 'modifies(b)' |
|
639 | $ log 'modifies(b)' | |
640 | 4 |
|
640 | 4 | |
641 | $ log 'modifies("path:b")' |
|
641 | $ log 'modifies("path:b")' | |
642 | 4 |
|
642 | 4 | |
643 | $ log 'modifies("*")' |
|
643 | $ log 'modifies("*")' | |
644 | 4 |
|
644 | 4 | |
645 | 6 |
|
645 | 6 | |
646 | $ log 'modifies("set:modified()")' |
|
646 | $ log 'modifies("set:modified()")' | |
647 | 4 |
|
647 | 4 | |
648 | $ log 'id(5)' |
|
648 | $ log 'id(5)' | |
649 | 2 |
|
649 | 2 | |
650 | $ log 'only(9)' |
|
650 | $ log 'only(9)' | |
651 | 8 |
|
651 | 8 | |
652 | 9 |
|
652 | 9 | |
653 | $ log 'only(8)' |
|
653 | $ log 'only(8)' | |
654 | 8 |
|
654 | 8 | |
655 | $ log 'only(9, 5)' |
|
655 | $ log 'only(9, 5)' | |
656 | 2 |
|
656 | 2 | |
657 | 4 |
|
657 | 4 | |
658 | 8 |
|
658 | 8 | |
659 | 9 |
|
659 | 9 | |
660 | $ log 'only(7 + 9, 5 + 2)' |
|
660 | $ log 'only(7 + 9, 5 + 2)' | |
661 | 4 |
|
661 | 4 | |
662 | 6 |
|
662 | 6 | |
663 | 7 |
|
663 | 7 | |
664 | 8 |
|
664 | 8 | |
665 | 9 |
|
665 | 9 | |
666 |
|
666 | |||
667 | Test empty set input |
|
667 | Test empty set input | |
668 | $ log 'only(p2())' |
|
668 | $ log 'only(p2())' | |
669 | $ log 'only(p1(), p2())' |
|
669 | $ log 'only(p1(), p2())' | |
670 | 0 |
|
670 | 0 | |
671 | 1 |
|
671 | 1 | |
672 | 2 |
|
672 | 2 | |
673 | 4 |
|
673 | 4 | |
674 | 8 |
|
674 | 8 | |
675 | 9 |
|
675 | 9 | |
676 |
|
676 | |||
677 | Test '%' operator |
|
677 | Test '%' operator | |
678 |
|
678 | |||
679 | $ log '9%' |
|
679 | $ log '9%' | |
680 | 8 |
|
680 | 8 | |
681 | 9 |
|
681 | 9 | |
682 | $ log '9%5' |
|
682 | $ log '9%5' | |
683 | 2 |
|
683 | 2 | |
684 | 4 |
|
684 | 4 | |
685 | 8 |
|
685 | 8 | |
686 | 9 |
|
686 | 9 | |
687 | $ log '(7 + 9)%(5 + 2)' |
|
687 | $ log '(7 + 9)%(5 + 2)' | |
688 | 4 |
|
688 | 4 | |
689 | 6 |
|
689 | 6 | |
690 | 7 |
|
690 | 7 | |
691 | 8 |
|
691 | 8 | |
692 | 9 |
|
692 | 9 | |
693 |
|
693 | |||
694 | Test opreand of '%' is optimized recursively (issue4670) |
|
694 | Test opreand of '%' is optimized recursively (issue4670) | |
695 |
|
695 | |||
696 | $ try --optimize '8:9-8%' |
|
696 | $ try --optimize '8:9-8%' | |
697 | (onlypost |
|
697 | (onlypost | |
698 | (minus |
|
698 | (minus | |
699 | (range |
|
699 | (range | |
700 | ('symbol', '8') |
|
700 | ('symbol', '8') | |
701 | ('symbol', '9')) |
|
701 | ('symbol', '9')) | |
702 | ('symbol', '8'))) |
|
702 | ('symbol', '8'))) | |
703 | * optimized: |
|
703 | * optimized: | |
704 | (func |
|
704 | (func | |
705 | ('symbol', 'only') |
|
705 | ('symbol', 'only') | |
706 | (difference |
|
706 | (difference | |
707 | (range |
|
707 | (range | |
708 | ('symbol', '8') |
|
708 | ('symbol', '8') | |
709 | ('symbol', '9')) |
|
709 | ('symbol', '9')) | |
710 | ('symbol', '8'))) |
|
710 | ('symbol', '8'))) | |
711 | * set: |
|
711 | * set: | |
712 | <baseset+ [8, 9]> |
|
712 | <baseset+ [8, 9]> | |
713 | 8 |
|
713 | 8 | |
714 | 9 |
|
714 | 9 | |
715 | $ try --optimize '(9)%(5)' |
|
715 | $ try --optimize '(9)%(5)' | |
716 | (only |
|
716 | (only | |
717 | (group |
|
717 | (group | |
718 | ('symbol', '9')) |
|
718 | ('symbol', '9')) | |
719 | (group |
|
719 | (group | |
720 | ('symbol', '5'))) |
|
720 | ('symbol', '5'))) | |
721 | * optimized: |
|
721 | * optimized: | |
722 | (func |
|
722 | (func | |
723 | ('symbol', 'only') |
|
723 | ('symbol', 'only') | |
724 | (list |
|
724 | (list | |
725 | ('symbol', '9') |
|
725 | ('symbol', '9') | |
726 | ('symbol', '5'))) |
|
726 | ('symbol', '5'))) | |
727 | * set: |
|
727 | * set: | |
728 | <baseset+ [8, 9, 2, 4]> |
|
728 | <baseset+ [8, 9, 2, 4]> | |
729 | 2 |
|
729 | 2 | |
730 | 4 |
|
730 | 4 | |
731 | 8 |
|
731 | 8 | |
732 | 9 |
|
732 | 9 | |
733 |
|
733 | |||
734 | Test the order of operations |
|
734 | Test the order of operations | |
735 |
|
735 | |||
736 | $ log '7 + 9%5 + 2' |
|
736 | $ log '7 + 9%5 + 2' | |
737 | 7 |
|
737 | 7 | |
738 | 2 |
|
738 | 2 | |
739 | 4 |
|
739 | 4 | |
740 | 8 |
|
740 | 8 | |
741 | 9 |
|
741 | 9 | |
742 |
|
742 | |||
743 | Test explicit numeric revision |
|
743 | Test explicit numeric revision | |
744 | $ log 'rev(-2)' |
|
744 | $ log 'rev(-2)' | |
745 | $ log 'rev(-1)' |
|
745 | $ log 'rev(-1)' | |
746 | -1 |
|
746 | -1 | |
747 | $ log 'rev(0)' |
|
747 | $ log 'rev(0)' | |
748 | 0 |
|
748 | 0 | |
749 | $ log 'rev(9)' |
|
749 | $ log 'rev(9)' | |
750 | 9 |
|
750 | 9 | |
751 | $ log 'rev(10)' |
|
751 | $ log 'rev(10)' | |
752 | $ log 'rev(tip)' |
|
752 | $ log 'rev(tip)' | |
753 | hg: parse error: rev expects a number |
|
753 | hg: parse error: rev expects a number | |
754 | [255] |
|
754 | [255] | |
755 |
|
755 | |||
756 | Test hexadecimal revision |
|
756 | Test hexadecimal revision | |
757 | $ log 'id(2)' |
|
757 | $ log 'id(2)' | |
758 | abort: 00changelog.i@2: ambiguous identifier! |
|
758 | abort: 00changelog.i@2: ambiguous identifier! | |
759 | [255] |
|
759 | [255] | |
760 | $ log 'id(23268)' |
|
760 | $ log 'id(23268)' | |
761 | 4 |
|
761 | 4 | |
762 | $ log 'id(2785f51eece)' |
|
762 | $ log 'id(2785f51eece)' | |
763 | 0 |
|
763 | 0 | |
764 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)' |
|
764 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)' | |
765 | 8 |
|
765 | 8 | |
766 | $ log 'id(d5d0dcbdc4a)' |
|
766 | $ log 'id(d5d0dcbdc4a)' | |
767 | $ log 'id(d5d0dcbdc4w)' |
|
767 | $ log 'id(d5d0dcbdc4w)' | |
768 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)' |
|
768 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)' | |
769 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)' |
|
769 | $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)' | |
770 | $ log 'id(1.0)' |
|
770 | $ log 'id(1.0)' | |
771 | $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)' |
|
771 | $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)' | |
772 |
|
772 | |||
773 | Test null revision |
|
773 | Test null revision | |
774 | $ log '(null)' |
|
774 | $ log '(null)' | |
775 | -1 |
|
775 | -1 | |
776 | $ log '(null:0)' |
|
776 | $ log '(null:0)' | |
777 | -1 |
|
777 | -1 | |
778 | 0 |
|
778 | 0 | |
779 | $ log '(0:null)' |
|
779 | $ log '(0:null)' | |
780 | 0 |
|
780 | 0 | |
781 | -1 |
|
781 | -1 | |
782 | $ log 'null::0' |
|
782 | $ log 'null::0' | |
783 | -1 |
|
783 | -1 | |
784 | 0 |
|
784 | 0 | |
785 | $ log 'null:tip - 0:' |
|
785 | $ log 'null:tip - 0:' | |
786 | -1 |
|
786 | -1 | |
787 | $ log 'null: and null::' | head -1 |
|
787 | $ log 'null: and null::' | head -1 | |
788 | -1 |
|
788 | -1 | |
789 | $ log 'null: or 0:' | head -2 |
|
789 | $ log 'null: or 0:' | head -2 | |
790 | -1 |
|
790 | -1 | |
791 | 0 |
|
791 | 0 | |
792 | $ log 'ancestors(null)' |
|
792 | $ log 'ancestors(null)' | |
793 | -1 |
|
793 | -1 | |
794 | $ log 'reverse(null:)' | tail -2 |
|
794 | $ log 'reverse(null:)' | tail -2 | |
795 | 0 |
|
795 | 0 | |
796 | -1 |
|
796 | -1 | |
797 | BROKEN: should be '-1' |
|
797 | BROKEN: should be '-1' | |
798 | $ log 'first(null:)' |
|
798 | $ log 'first(null:)' | |
799 | BROKEN: should be '-1' |
|
799 | BROKEN: should be '-1' | |
800 | $ log 'min(null:)' |
|
800 | $ log 'min(null:)' | |
801 | $ log 'tip:null and all()' | tail -2 |
|
801 | $ log 'tip:null and all()' | tail -2 | |
802 | 1 |
|
802 | 1 | |
803 | 0 |
|
803 | 0 | |
804 |
|
804 | |||
805 | Test working-directory revision |
|
805 | Test working-directory revision | |
806 | $ hg debugrevspec 'wdir()' |
|
806 | $ hg debugrevspec 'wdir()' | |
807 | 2147483647 |
|
807 | 2147483647 | |
808 | $ hg debugrevspec 'tip or wdir()' |
|
808 | $ hg debugrevspec 'tip or wdir()' | |
809 | 9 |
|
809 | 9 | |
810 | 2147483647 |
|
810 | 2147483647 | |
811 | $ hg debugrevspec '0:tip and wdir()' |
|
811 | $ hg debugrevspec '0:tip and wdir()' | |
812 | $ log '0:wdir()' | tail -3 |
|
812 | $ log '0:wdir()' | tail -3 | |
813 | 8 |
|
813 | 8 | |
814 | 9 |
|
814 | 9 | |
815 | 2147483647 |
|
815 | 2147483647 | |
816 | $ log 'wdir():0' | head -3 |
|
816 | $ log 'wdir():0' | head -3 | |
817 | 2147483647 |
|
817 | 2147483647 | |
818 | 9 |
|
818 | 9 | |
819 | 8 |
|
819 | 8 | |
820 | $ log 'wdir():wdir()' |
|
820 | $ log 'wdir():wdir()' | |
821 | 2147483647 |
|
821 | 2147483647 | |
822 | $ log '(all() + wdir()) & min(. + wdir())' |
|
822 | $ log '(all() + wdir()) & min(. + wdir())' | |
823 | 9 |
|
823 | 9 | |
824 | $ log '(all() + wdir()) & max(. + wdir())' |
|
824 | $ log '(all() + wdir()) & max(. + wdir())' | |
825 | 2147483647 |
|
825 | 2147483647 | |
826 | $ log '(all() + wdir()) & first(wdir() + .)' |
|
826 | $ log '(all() + wdir()) & first(wdir() + .)' | |
827 | 2147483647 |
|
827 | 2147483647 | |
828 | $ log '(all() + wdir()) & last(. + wdir())' |
|
828 | $ log '(all() + wdir()) & last(. + wdir())' | |
829 | 2147483647 |
|
829 | 2147483647 | |
830 |
|
830 | |||
831 | $ log 'outgoing()' |
|
831 | $ log 'outgoing()' | |
832 | 8 |
|
832 | 8 | |
833 | 9 |
|
833 | 9 | |
834 | $ log 'outgoing("../remote1")' |
|
834 | $ log 'outgoing("../remote1")' | |
835 | 8 |
|
835 | 8 | |
836 | 9 |
|
836 | 9 | |
837 | $ log 'outgoing("../remote2")' |
|
837 | $ log 'outgoing("../remote2")' | |
838 | 3 |
|
838 | 3 | |
839 | 5 |
|
839 | 5 | |
840 | 6 |
|
840 | 6 | |
841 | 7 |
|
841 | 7 | |
842 | 9 |
|
842 | 9 | |
843 | $ log 'p1(merge())' |
|
843 | $ log 'p1(merge())' | |
844 | 5 |
|
844 | 5 | |
845 | $ log 'p2(merge())' |
|
845 | $ log 'p2(merge())' | |
846 | 4 |
|
846 | 4 | |
847 | $ log 'parents(merge())' |
|
847 | $ log 'parents(merge())' | |
848 | 4 |
|
848 | 4 | |
849 | 5 |
|
849 | 5 | |
850 | $ log 'p1(branchpoint())' |
|
850 | $ log 'p1(branchpoint())' | |
851 | 0 |
|
851 | 0 | |
852 | 2 |
|
852 | 2 | |
853 | $ log 'p2(branchpoint())' |
|
853 | $ log 'p2(branchpoint())' | |
854 | $ log 'parents(branchpoint())' |
|
854 | $ log 'parents(branchpoint())' | |
855 | 0 |
|
855 | 0 | |
856 | 2 |
|
856 | 2 | |
857 | $ log 'removes(a)' |
|
857 | $ log 'removes(a)' | |
858 | 2 |
|
858 | 2 | |
859 | 6 |
|
859 | 6 | |
860 | $ log 'roots(all())' |
|
860 | $ log 'roots(all())' | |
861 | 0 |
|
861 | 0 | |
862 | $ log 'reverse(2 or 3 or 4 or 5)' |
|
862 | $ log 'reverse(2 or 3 or 4 or 5)' | |
863 | 5 |
|
863 | 5 | |
864 | 4 |
|
864 | 4 | |
865 | 3 |
|
865 | 3 | |
866 | 2 |
|
866 | 2 | |
867 | $ log 'reverse(all())' |
|
867 | $ log 'reverse(all())' | |
868 | 9 |
|
868 | 9 | |
869 | 8 |
|
869 | 8 | |
870 | 7 |
|
870 | 7 | |
871 | 6 |
|
871 | 6 | |
872 | 5 |
|
872 | 5 | |
873 | 4 |
|
873 | 4 | |
874 | 3 |
|
874 | 3 | |
875 | 2 |
|
875 | 2 | |
876 | 1 |
|
876 | 1 | |
877 | 0 |
|
877 | 0 | |
878 | $ log 'reverse(all()) & filelog(b)' |
|
878 | $ log 'reverse(all()) & filelog(b)' | |
879 | 4 |
|
879 | 4 | |
880 | 1 |
|
880 | 1 | |
881 | $ log 'rev(5)' |
|
881 | $ log 'rev(5)' | |
882 | 5 |
|
882 | 5 | |
883 | $ log 'sort(limit(reverse(all()), 3))' |
|
883 | $ log 'sort(limit(reverse(all()), 3))' | |
884 | 7 |
|
884 | 7 | |
885 | 8 |
|
885 | 8 | |
886 | 9 |
|
886 | 9 | |
887 | $ log 'sort(2 or 3 or 4 or 5, date)' |
|
887 | $ log 'sort(2 or 3 or 4 or 5, date)' | |
888 | 2 |
|
888 | 2 | |
889 | 3 |
|
889 | 3 | |
890 | 5 |
|
890 | 5 | |
891 | 4 |
|
891 | 4 | |
892 | $ log 'tagged()' |
|
892 | $ log 'tagged()' | |
893 | 6 |
|
893 | 6 | |
894 | $ log 'tag()' |
|
894 | $ log 'tag()' | |
895 | 6 |
|
895 | 6 | |
896 | $ log 'tag(1.0)' |
|
896 | $ log 'tag(1.0)' | |
897 | 6 |
|
897 | 6 | |
898 | $ log 'tag(tip)' |
|
898 | $ log 'tag(tip)' | |
899 | 9 |
|
899 | 9 | |
900 |
|
900 | |||
901 | test sort revset |
|
901 | test sort revset | |
902 | -------------------------------------------- |
|
902 | -------------------------------------------- | |
903 |
|
903 | |||
904 | test when adding two unordered revsets |
|
904 | test when adding two unordered revsets | |
905 |
|
905 | |||
906 | $ log 'sort(keyword(issue) or modifies(b))' |
|
906 | $ log 'sort(keyword(issue) or modifies(b))' | |
907 | 4 |
|
907 | 4 | |
908 | 6 |
|
908 | 6 | |
909 |
|
909 | |||
910 | test when sorting a reversed collection in the same way it is |
|
910 | test when sorting a reversed collection in the same way it is | |
911 |
|
911 | |||
912 | $ log 'sort(reverse(all()), -rev)' |
|
912 | $ log 'sort(reverse(all()), -rev)' | |
913 | 9 |
|
913 | 9 | |
914 | 8 |
|
914 | 8 | |
915 | 7 |
|
915 | 7 | |
916 | 6 |
|
916 | 6 | |
917 | 5 |
|
917 | 5 | |
918 | 4 |
|
918 | 4 | |
919 | 3 |
|
919 | 3 | |
920 | 2 |
|
920 | 2 | |
921 | 1 |
|
921 | 1 | |
922 | 0 |
|
922 | 0 | |
923 |
|
923 | |||
924 | test when sorting a reversed collection |
|
924 | test when sorting a reversed collection | |
925 |
|
925 | |||
926 | $ log 'sort(reverse(all()), rev)' |
|
926 | $ log 'sort(reverse(all()), rev)' | |
927 | 0 |
|
927 | 0 | |
928 | 1 |
|
928 | 1 | |
929 | 2 |
|
929 | 2 | |
930 | 3 |
|
930 | 3 | |
931 | 4 |
|
931 | 4 | |
932 | 5 |
|
932 | 5 | |
933 | 6 |
|
933 | 6 | |
934 | 7 |
|
934 | 7 | |
935 | 8 |
|
935 | 8 | |
936 | 9 |
|
936 | 9 | |
937 |
|
937 | |||
938 |
|
938 | |||
939 | test sorting two sorted collections in different orders |
|
939 | test sorting two sorted collections in different orders | |
940 |
|
940 | |||
941 | $ log 'sort(outgoing() or reverse(removes(a)), rev)' |
|
941 | $ log 'sort(outgoing() or reverse(removes(a)), rev)' | |
942 | 2 |
|
942 | 2 | |
943 | 6 |
|
943 | 6 | |
944 | 8 |
|
944 | 8 | |
945 | 9 |
|
945 | 9 | |
946 |
|
946 | |||
947 | test sorting two sorted collections in different orders backwards |
|
947 | test sorting two sorted collections in different orders backwards | |
948 |
|
948 | |||
949 | $ log 'sort(outgoing() or reverse(removes(a)), -rev)' |
|
949 | $ log 'sort(outgoing() or reverse(removes(a)), -rev)' | |
950 | 9 |
|
950 | 9 | |
951 | 8 |
|
951 | 8 | |
952 | 6 |
|
952 | 6 | |
953 | 2 |
|
953 | 2 | |
954 |
|
954 | |||
955 | test subtracting something from an addset |
|
955 | test subtracting something from an addset | |
956 |
|
956 | |||
957 | $ log '(outgoing() or removes(a)) - removes(a)' |
|
957 | $ log '(outgoing() or removes(a)) - removes(a)' | |
958 | 8 |
|
958 | 8 | |
959 | 9 |
|
959 | 9 | |
960 |
|
960 | |||
961 | test intersecting something with an addset |
|
961 | test intersecting something with an addset | |
962 |
|
962 | |||
963 | $ log 'parents(outgoing() or removes(a))' |
|
963 | $ log 'parents(outgoing() or removes(a))' | |
964 | 1 |
|
964 | 1 | |
965 | 4 |
|
965 | 4 | |
966 | 5 |
|
966 | 5 | |
967 | 8 |
|
967 | 8 | |
968 |
|
968 | |||
969 | test that `or` operation combines elements in the right order: |
|
969 | test that `or` operation combines elements in the right order: | |
970 |
|
970 | |||
971 | $ log '3:4 or 2:5' |
|
971 | $ log '3:4 or 2:5' | |
972 | 3 |
|
972 | 3 | |
973 | 4 |
|
973 | 4 | |
974 | 2 |
|
974 | 2 | |
975 | 5 |
|
975 | 5 | |
976 | $ log '3:4 or 5:2' |
|
976 | $ log '3:4 or 5:2' | |
977 | 3 |
|
977 | 3 | |
978 | 4 |
|
978 | 4 | |
979 | 5 |
|
979 | 5 | |
980 | 2 |
|
980 | 2 | |
981 | $ log 'sort(3:4 or 2:5)' |
|
981 | $ log 'sort(3:4 or 2:5)' | |
982 | 2 |
|
982 | 2 | |
983 | 3 |
|
983 | 3 | |
984 | 4 |
|
984 | 4 | |
985 | 5 |
|
985 | 5 | |
986 | $ log 'sort(3:4 or 5:2)' |
|
986 | $ log 'sort(3:4 or 5:2)' | |
987 | 2 |
|
987 | 2 | |
988 | 3 |
|
988 | 3 | |
989 | 4 |
|
989 | 4 | |
990 | 5 |
|
990 | 5 | |
991 |
|
991 | |||
992 | test that more than one `-r`s are combined in the right order and deduplicated: |
|
992 | test that more than one `-r`s are combined in the right order and deduplicated: | |
993 |
|
993 | |||
994 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' |
|
994 | $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' | |
995 | 3 |
|
995 | 3 | |
996 | 4 |
|
996 | 4 | |
997 | 5 |
|
997 | 5 | |
998 | 2 |
|
998 | 2 | |
999 | 0 |
|
999 | 0 | |
1000 | 1 |
|
1000 | 1 | |
1001 |
|
1001 | |||
1002 | test that `or` operation skips duplicated revisions from right-hand side |
|
1002 | test that `or` operation skips duplicated revisions from right-hand side | |
1003 |
|
1003 | |||
1004 | $ try 'reverse(1::5) or ancestors(4)' |
|
1004 | $ try 'reverse(1::5) or ancestors(4)' | |
1005 | (or |
|
1005 | (or | |
1006 | (func |
|
1006 | (func | |
1007 | ('symbol', 'reverse') |
|
1007 | ('symbol', 'reverse') | |
1008 | (dagrange |
|
1008 | (dagrange | |
1009 | ('symbol', '1') |
|
1009 | ('symbol', '1') | |
1010 | ('symbol', '5'))) |
|
1010 | ('symbol', '5'))) | |
1011 | (func |
|
1011 | (func | |
1012 | ('symbol', 'ancestors') |
|
1012 | ('symbol', 'ancestors') | |
1013 | ('symbol', '4'))) |
|
1013 | ('symbol', '4'))) | |
1014 | * set: |
|
1014 | * set: | |
1015 | <addset |
|
1015 | <addset | |
1016 | <baseset- [1, 3, 5]>, |
|
1016 | <baseset- [1, 3, 5]>, | |
1017 | <generatorset+>> |
|
1017 | <generatorset+>> | |
1018 | 5 |
|
1018 | 5 | |
1019 | 3 |
|
1019 | 3 | |
1020 | 1 |
|
1020 | 1 | |
1021 | 0 |
|
1021 | 0 | |
1022 | 2 |
|
1022 | 2 | |
1023 | 4 |
|
1023 | 4 | |
1024 | $ try 'sort(ancestors(4) or reverse(1::5))' |
|
1024 | $ try 'sort(ancestors(4) or reverse(1::5))' | |
1025 | (func |
|
1025 | (func | |
1026 | ('symbol', 'sort') |
|
1026 | ('symbol', 'sort') | |
1027 | (or |
|
1027 | (or | |
1028 | (func |
|
1028 | (func | |
1029 | ('symbol', 'ancestors') |
|
1029 | ('symbol', 'ancestors') | |
1030 | ('symbol', '4')) |
|
1030 | ('symbol', '4')) | |
1031 | (func |
|
1031 | (func | |
1032 | ('symbol', 'reverse') |
|
1032 | ('symbol', 'reverse') | |
1033 | (dagrange |
|
1033 | (dagrange | |
1034 | ('symbol', '1') |
|
1034 | ('symbol', '1') | |
1035 | ('symbol', '5'))))) |
|
1035 | ('symbol', '5'))))) | |
1036 | * set: |
|
1036 | * set: | |
1037 | <addset+ |
|
1037 | <addset+ | |
1038 | <generatorset+>, |
|
1038 | <generatorset+>, | |
1039 | <baseset- [1, 3, 5]>> |
|
1039 | <baseset- [1, 3, 5]>> | |
1040 | 0 |
|
1040 | 0 | |
1041 | 1 |
|
1041 | 1 | |
1042 | 2 |
|
1042 | 2 | |
1043 | 3 |
|
1043 | 3 | |
1044 | 4 |
|
1044 | 4 | |
1045 | 5 |
|
1045 | 5 | |
1046 |
|
1046 | |||
1047 | test optimization of trivial `or` operation |
|
1047 | test optimization of trivial `or` operation | |
1048 |
|
1048 | |||
1049 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
1049 | $ try --optimize '0|(1)|"2"|-2|tip|null' | |
1050 | (or |
|
1050 | (or | |
1051 | ('symbol', '0') |
|
1051 | ('symbol', '0') | |
1052 | (group |
|
1052 | (group | |
1053 | ('symbol', '1')) |
|
1053 | ('symbol', '1')) | |
1054 | ('string', '2') |
|
1054 | ('string', '2') | |
1055 | (negate |
|
1055 | (negate | |
1056 | ('symbol', '2')) |
|
1056 | ('symbol', '2')) | |
1057 | ('symbol', 'tip') |
|
1057 | ('symbol', 'tip') | |
1058 | ('symbol', 'null')) |
|
1058 | ('symbol', 'null')) | |
1059 | * optimized: |
|
1059 | * optimized: | |
1060 | (func |
|
1060 | (func | |
1061 | ('symbol', '_list') |
|
1061 | ('symbol', '_list') | |
1062 | ('string', '0\x001\x002\x00-2\x00tip\x00null')) |
|
1062 | ('string', '0\x001\x002\x00-2\x00tip\x00null')) | |
1063 | * set: |
|
1063 | * set: | |
1064 | <baseset [0, 1, 2, 8, 9, -1]> |
|
1064 | <baseset [0, 1, 2, 8, 9, -1]> | |
1065 | 0 |
|
1065 | 0 | |
1066 | 1 |
|
1066 | 1 | |
1067 | 2 |
|
1067 | 2 | |
1068 | 8 |
|
1068 | 8 | |
1069 | 9 |
|
1069 | 9 | |
1070 | -1 |
|
1070 | -1 | |
1071 |
|
1071 | |||
1072 | $ try --optimize '0|1|2:3' |
|
1072 | $ try --optimize '0|1|2:3' | |
1073 | (or |
|
1073 | (or | |
1074 | ('symbol', '0') |
|
1074 | ('symbol', '0') | |
1075 | ('symbol', '1') |
|
1075 | ('symbol', '1') | |
1076 | (range |
|
1076 | (range | |
1077 | ('symbol', '2') |
|
1077 | ('symbol', '2') | |
1078 | ('symbol', '3'))) |
|
1078 | ('symbol', '3'))) | |
1079 | * optimized: |
|
1079 | * optimized: | |
1080 | (or |
|
1080 | (or | |
1081 | (func |
|
1081 | (func | |
1082 | ('symbol', '_list') |
|
1082 | ('symbol', '_list') | |
1083 | ('string', '0\x001')) |
|
1083 | ('string', '0\x001')) | |
1084 | (range |
|
1084 | (range | |
1085 | ('symbol', '2') |
|
1085 | ('symbol', '2') | |
1086 | ('symbol', '3'))) |
|
1086 | ('symbol', '3'))) | |
1087 | * set: |
|
1087 | * set: | |
1088 | <addset |
|
1088 | <addset | |
1089 | <baseset [0, 1]>, |
|
1089 | <baseset [0, 1]>, | |
1090 | <spanset+ 2:3>> |
|
1090 | <spanset+ 2:3>> | |
1091 | 0 |
|
1091 | 0 | |
1092 | 1 |
|
1092 | 1 | |
1093 | 2 |
|
1093 | 2 | |
1094 | 3 |
|
1094 | 3 | |
1095 |
|
1095 | |||
1096 | $ try --optimize '0:1|2|3:4|5|6' |
|
1096 | $ try --optimize '0:1|2|3:4|5|6' | |
1097 | (or |
|
1097 | (or | |
1098 | (range |
|
1098 | (range | |
1099 | ('symbol', '0') |
|
1099 | ('symbol', '0') | |
1100 | ('symbol', '1')) |
|
1100 | ('symbol', '1')) | |
1101 | ('symbol', '2') |
|
1101 | ('symbol', '2') | |
1102 | (range |
|
1102 | (range | |
1103 | ('symbol', '3') |
|
1103 | ('symbol', '3') | |
1104 | ('symbol', '4')) |
|
1104 | ('symbol', '4')) | |
1105 | ('symbol', '5') |
|
1105 | ('symbol', '5') | |
1106 | ('symbol', '6')) |
|
1106 | ('symbol', '6')) | |
1107 | * optimized: |
|
1107 | * optimized: | |
1108 | (or |
|
1108 | (or | |
1109 | (range |
|
1109 | (range | |
1110 | ('symbol', '0') |
|
1110 | ('symbol', '0') | |
1111 | ('symbol', '1')) |
|
1111 | ('symbol', '1')) | |
1112 | ('symbol', '2') |
|
1112 | ('symbol', '2') | |
1113 | (range |
|
1113 | (range | |
1114 | ('symbol', '3') |
|
1114 | ('symbol', '3') | |
1115 | ('symbol', '4')) |
|
1115 | ('symbol', '4')) | |
1116 | (func |
|
1116 | (func | |
1117 | ('symbol', '_list') |
|
1117 | ('symbol', '_list') | |
1118 | ('string', '5\x006'))) |
|
1118 | ('string', '5\x006'))) | |
1119 | * set: |
|
1119 | * set: | |
1120 | <addset |
|
1120 | <addset | |
1121 | <addset |
|
1121 | <addset | |
1122 | <spanset+ 0:1>, |
|
1122 | <spanset+ 0:1>, | |
1123 | <baseset [2]>>, |
|
1123 | <baseset [2]>>, | |
1124 | <addset |
|
1124 | <addset | |
1125 | <spanset+ 3:4>, |
|
1125 | <spanset+ 3:4>, | |
1126 | <baseset [5, 6]>>> |
|
1126 | <baseset [5, 6]>>> | |
1127 | 0 |
|
1127 | 0 | |
1128 | 1 |
|
1128 | 1 | |
1129 | 2 |
|
1129 | 2 | |
1130 | 3 |
|
1130 | 3 | |
1131 | 4 |
|
1131 | 4 | |
1132 | 5 |
|
1132 | 5 | |
1133 | 6 |
|
1133 | 6 | |
1134 |
|
1134 | |||
1135 | test that `_list` should be narrowed by provided `subset` |
|
1135 | test that `_list` should be narrowed by provided `subset` | |
1136 |
|
1136 | |||
1137 | $ log '0:2 and (null|1|2|3)' |
|
1137 | $ log '0:2 and (null|1|2|3)' | |
1138 | 1 |
|
1138 | 1 | |
1139 | 2 |
|
1139 | 2 | |
1140 |
|
1140 | |||
1141 | test that `_list` should remove duplicates |
|
1141 | test that `_list` should remove duplicates | |
1142 |
|
1142 | |||
1143 | $ log '0|1|2|1|2|-1|tip' |
|
1143 | $ log '0|1|2|1|2|-1|tip' | |
1144 | 0 |
|
1144 | 0 | |
1145 | 1 |
|
1145 | 1 | |
1146 | 2 |
|
1146 | 2 | |
1147 | 9 |
|
1147 | 9 | |
1148 |
|
1148 | |||
1149 | test unknown revision in `_list` |
|
1149 | test unknown revision in `_list` | |
1150 |
|
1150 | |||
1151 | $ log '0|unknown' |
|
1151 | $ log '0|unknown' | |
1152 | abort: unknown revision 'unknown'! |
|
1152 | abort: unknown revision 'unknown'! | |
1153 | [255] |
|
1153 | [255] | |
1154 |
|
1154 | |||
1155 | test integer range in `_list` |
|
1155 | test integer range in `_list` | |
1156 |
|
1156 | |||
1157 | $ log '-1|-10' |
|
1157 | $ log '-1|-10' | |
1158 | 9 |
|
1158 | 9 | |
1159 | 0 |
|
1159 | 0 | |
1160 |
|
1160 | |||
1161 | $ log '-10|-11' |
|
1161 | $ log '-10|-11' | |
1162 | abort: unknown revision '-11'! |
|
1162 | abort: unknown revision '-11'! | |
1163 | [255] |
|
1163 | [255] | |
1164 |
|
1164 | |||
1165 | $ log '9|10' |
|
1165 | $ log '9|10' | |
1166 | abort: unknown revision '10'! |
|
1166 | abort: unknown revision '10'! | |
1167 | [255] |
|
1167 | [255] | |
1168 |
|
1168 | |||
1169 | test '0000' != '0' in `_list` |
|
1169 | test '0000' != '0' in `_list` | |
1170 |
|
1170 | |||
1171 | $ log '0|0000' |
|
1171 | $ log '0|0000' | |
1172 | 0 |
|
1172 | 0 | |
1173 | -1 |
|
1173 | -1 | |
1174 |
|
1174 | |||
1175 | test ',' in `_list` |
|
1175 | test ',' in `_list` | |
1176 | $ log '0,1' |
|
1176 | $ log '0,1' | |
1177 | hg: parse error: can't use a list in this context |
|
1177 | hg: parse error: can't use a list in this context | |
1178 | (see hg help "revsets.x or y") |
|
1178 | (see hg help "revsets.x or y") | |
1179 | [255] |
|
1179 | [255] | |
1180 | $ try '0,1,2' |
|
1180 | $ try '0,1,2' | |
1181 | (list |
|
1181 | (list | |
1182 | ('symbol', '0') |
|
1182 | ('symbol', '0') | |
1183 | ('symbol', '1') |
|
1183 | ('symbol', '1') | |
1184 | ('symbol', '2')) |
|
1184 | ('symbol', '2')) | |
1185 | hg: parse error: can't use a list in this context |
|
1185 | hg: parse error: can't use a list in this context | |
1186 | (see hg help "revsets.x or y") |
|
1186 | (see hg help "revsets.x or y") | |
1187 | [255] |
|
1187 | [255] | |
1188 |
|
1188 | |||
1189 | test that chained `or` operations make balanced addsets |
|
1189 | test that chained `or` operations make balanced addsets | |
1190 |
|
1190 | |||
1191 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
1191 | $ try '0:1|1:2|2:3|3:4|4:5' | |
1192 | (or |
|
1192 | (or | |
1193 | (range |
|
1193 | (range | |
1194 | ('symbol', '0') |
|
1194 | ('symbol', '0') | |
1195 | ('symbol', '1')) |
|
1195 | ('symbol', '1')) | |
1196 | (range |
|
1196 | (range | |
1197 | ('symbol', '1') |
|
1197 | ('symbol', '1') | |
1198 | ('symbol', '2')) |
|
1198 | ('symbol', '2')) | |
1199 | (range |
|
1199 | (range | |
1200 | ('symbol', '2') |
|
1200 | ('symbol', '2') | |
1201 | ('symbol', '3')) |
|
1201 | ('symbol', '3')) | |
1202 | (range |
|
1202 | (range | |
1203 | ('symbol', '3') |
|
1203 | ('symbol', '3') | |
1204 | ('symbol', '4')) |
|
1204 | ('symbol', '4')) | |
1205 | (range |
|
1205 | (range | |
1206 | ('symbol', '4') |
|
1206 | ('symbol', '4') | |
1207 | ('symbol', '5'))) |
|
1207 | ('symbol', '5'))) | |
1208 | * set: |
|
1208 | * set: | |
1209 | <addset |
|
1209 | <addset | |
1210 | <addset |
|
1210 | <addset | |
1211 | <spanset+ 0:1>, |
|
1211 | <spanset+ 0:1>, | |
1212 | <spanset+ 1:2>>, |
|
1212 | <spanset+ 1:2>>, | |
1213 | <addset |
|
1213 | <addset | |
1214 | <spanset+ 2:3>, |
|
1214 | <spanset+ 2:3>, | |
1215 | <addset |
|
1215 | <addset | |
1216 | <spanset+ 3:4>, |
|
1216 | <spanset+ 3:4>, | |
1217 | <spanset+ 4:5>>>> |
|
1217 | <spanset+ 4:5>>>> | |
1218 | 0 |
|
1218 | 0 | |
1219 | 1 |
|
1219 | 1 | |
1220 | 2 |
|
1220 | 2 | |
1221 | 3 |
|
1221 | 3 | |
1222 | 4 |
|
1222 | 4 | |
1223 | 5 |
|
1223 | 5 | |
1224 |
|
1224 | |||
1225 | no crash by empty group "()" while optimizing `or` operations |
|
1225 | no crash by empty group "()" while optimizing `or` operations | |
1226 |
|
1226 | |||
1227 | $ try --optimize '0|()' |
|
1227 | $ try --optimize '0|()' | |
1228 | (or |
|
1228 | (or | |
1229 | ('symbol', '0') |
|
1229 | ('symbol', '0') | |
1230 | (group |
|
1230 | (group | |
1231 | None)) |
|
1231 | None)) | |
1232 | * optimized: |
|
1232 | * optimized: | |
1233 | (or |
|
1233 | (or | |
1234 | ('symbol', '0') |
|
1234 | ('symbol', '0') | |
1235 | None) |
|
1235 | None) | |
1236 | hg: parse error: missing argument |
|
1236 | hg: parse error: missing argument | |
1237 | [255] |
|
1237 | [255] | |
1238 |
|
1238 | |||
1239 | test that chained `or` operations never eat up stack (issue4624) |
|
1239 | test that chained `or` operations never eat up stack (issue4624) | |
1240 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) |
|
1240 | (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) | |
1241 |
|
1241 | |||
1242 | $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"` |
|
1242 | $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"` | |
1243 | 0 |
|
1243 | 0 | |
1244 | 1 |
|
1244 | 1 | |
1245 |
|
1245 | |||
1246 | test that repeated `-r` options never eat up stack (issue4565) |
|
1246 | test that repeated `-r` options never eat up stack (issue4565) | |
1247 | (uses `-r 0::1` to avoid possible optimization at old-style parser) |
|
1247 | (uses `-r 0::1` to avoid possible optimization at old-style parser) | |
1248 |
|
1248 | |||
1249 | $ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"` |
|
1249 | $ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"` | |
1250 | 0 |
|
1250 | 0 | |
1251 | 1 |
|
1251 | 1 | |
1252 |
|
1252 | |||
1253 | check that conversion to only works |
|
1253 | check that conversion to only works | |
1254 | $ try --optimize '::3 - ::1' |
|
1254 | $ try --optimize '::3 - ::1' | |
1255 | (minus |
|
1255 | (minus | |
1256 | (dagrangepre |
|
1256 | (dagrangepre | |
1257 | ('symbol', '3')) |
|
1257 | ('symbol', '3')) | |
1258 | (dagrangepre |
|
1258 | (dagrangepre | |
1259 | ('symbol', '1'))) |
|
1259 | ('symbol', '1'))) | |
1260 | * optimized: |
|
1260 | * optimized: | |
1261 | (func |
|
1261 | (func | |
1262 | ('symbol', 'only') |
|
1262 | ('symbol', 'only') | |
1263 | (list |
|
1263 | (list | |
1264 | ('symbol', '3') |
|
1264 | ('symbol', '3') | |
1265 | ('symbol', '1'))) |
|
1265 | ('symbol', '1'))) | |
1266 | * set: |
|
1266 | * set: | |
1267 | <baseset+ [3]> |
|
1267 | <baseset+ [3]> | |
1268 | 3 |
|
1268 | 3 | |
1269 | $ try --optimize 'ancestors(1) - ancestors(3)' |
|
1269 | $ try --optimize 'ancestors(1) - ancestors(3)' | |
1270 | (minus |
|
1270 | (minus | |
1271 | (func |
|
1271 | (func | |
1272 | ('symbol', 'ancestors') |
|
1272 | ('symbol', 'ancestors') | |
1273 | ('symbol', '1')) |
|
1273 | ('symbol', '1')) | |
1274 | (func |
|
1274 | (func | |
1275 | ('symbol', 'ancestors') |
|
1275 | ('symbol', 'ancestors') | |
1276 | ('symbol', '3'))) |
|
1276 | ('symbol', '3'))) | |
1277 | * optimized: |
|
1277 | * optimized: | |
1278 | (func |
|
1278 | (func | |
1279 | ('symbol', 'only') |
|
1279 | ('symbol', 'only') | |
1280 | (list |
|
1280 | (list | |
1281 | ('symbol', '1') |
|
1281 | ('symbol', '1') | |
1282 | ('symbol', '3'))) |
|
1282 | ('symbol', '3'))) | |
1283 | * set: |
|
1283 | * set: | |
1284 | <baseset+ []> |
|
1284 | <baseset+ []> | |
1285 | $ try --optimize 'not ::2 and ::6' |
|
1285 | $ try --optimize 'not ::2 and ::6' | |
1286 | (and |
|
1286 | (and | |
1287 | (not |
|
1287 | (not | |
1288 | (dagrangepre |
|
1288 | (dagrangepre | |
1289 | ('symbol', '2'))) |
|
1289 | ('symbol', '2'))) | |
1290 | (dagrangepre |
|
1290 | (dagrangepre | |
1291 | ('symbol', '6'))) |
|
1291 | ('symbol', '6'))) | |
1292 | * optimized: |
|
1292 | * optimized: | |
1293 | (func |
|
1293 | (func | |
1294 | ('symbol', 'only') |
|
1294 | ('symbol', 'only') | |
1295 | (list |
|
1295 | (list | |
1296 | ('symbol', '6') |
|
1296 | ('symbol', '6') | |
1297 | ('symbol', '2'))) |
|
1297 | ('symbol', '2'))) | |
1298 | * set: |
|
1298 | * set: | |
1299 | <baseset+ [3, 4, 5, 6]> |
|
1299 | <baseset+ [3, 4, 5, 6]> | |
1300 | 3 |
|
1300 | 3 | |
1301 | 4 |
|
1301 | 4 | |
1302 | 5 |
|
1302 | 5 | |
1303 | 6 |
|
1303 | 6 | |
1304 | $ try --optimize 'ancestors(6) and not ancestors(4)' |
|
1304 | $ try --optimize 'ancestors(6) and not ancestors(4)' | |
1305 | (and |
|
1305 | (and | |
1306 | (func |
|
1306 | (func | |
1307 | ('symbol', 'ancestors') |
|
1307 | ('symbol', 'ancestors') | |
1308 | ('symbol', '6')) |
|
1308 | ('symbol', '6')) | |
1309 | (not |
|
1309 | (not | |
1310 | (func |
|
1310 | (func | |
1311 | ('symbol', 'ancestors') |
|
1311 | ('symbol', 'ancestors') | |
1312 | ('symbol', '4')))) |
|
1312 | ('symbol', '4')))) | |
1313 | * optimized: |
|
1313 | * optimized: | |
1314 | (func |
|
1314 | (func | |
1315 | ('symbol', 'only') |
|
1315 | ('symbol', 'only') | |
1316 | (list |
|
1316 | (list | |
1317 | ('symbol', '6') |
|
1317 | ('symbol', '6') | |
1318 | ('symbol', '4'))) |
|
1318 | ('symbol', '4'))) | |
1319 | * set: |
|
1319 | * set: | |
1320 | <baseset+ [3, 5, 6]> |
|
1320 | <baseset+ [3, 5, 6]> | |
1321 | 3 |
|
1321 | 3 | |
1322 | 5 |
|
1322 | 5 | |
1323 | 6 |
|
1323 | 6 | |
1324 |
|
1324 | |||
1325 | no crash by empty group "()" while optimizing to "only()" |
|
1325 | no crash by empty group "()" while optimizing to "only()" | |
1326 |
|
1326 | |||
1327 | $ try --optimize '::1 and ()' |
|
1327 | $ try --optimize '::1 and ()' | |
1328 | (and |
|
1328 | (and | |
1329 | (dagrangepre |
|
1329 | (dagrangepre | |
1330 | ('symbol', '1')) |
|
1330 | ('symbol', '1')) | |
1331 | (group |
|
1331 | (group | |
1332 | None)) |
|
1332 | None)) | |
1333 | * optimized: |
|
1333 | * optimized: | |
1334 | (and |
|
1334 | (and | |
1335 | None |
|
1335 | None | |
1336 | (func |
|
1336 | (func | |
1337 | ('symbol', 'ancestors') |
|
1337 | ('symbol', 'ancestors') | |
1338 | ('symbol', '1'))) |
|
1338 | ('symbol', '1'))) | |
1339 | hg: parse error: missing argument |
|
1339 | hg: parse error: missing argument | |
1340 | [255] |
|
1340 | [255] | |
1341 |
|
1341 | |||
1342 | we can use patterns when searching for tags |
|
1342 | we can use patterns when searching for tags | |
1343 |
|
1343 | |||
1344 | $ log 'tag("1..*")' |
|
1344 | $ log 'tag("1..*")' | |
1345 | abort: tag '1..*' does not exist! |
|
1345 | abort: tag '1..*' does not exist! | |
1346 | [255] |
|
1346 | [255] | |
1347 | $ log 'tag("re:1..*")' |
|
1347 | $ log 'tag("re:1..*")' | |
1348 | 6 |
|
1348 | 6 | |
1349 | $ log 'tag("re:[0-9].[0-9]")' |
|
1349 | $ log 'tag("re:[0-9].[0-9]")' | |
1350 | 6 |
|
1350 | 6 | |
1351 | $ log 'tag("literal:1.0")' |
|
1351 | $ log 'tag("literal:1.0")' | |
1352 | 6 |
|
1352 | 6 | |
1353 | $ log 'tag("re:0..*")' |
|
1353 | $ log 'tag("re:0..*")' | |
1354 |
|
1354 | |||
1355 | $ log 'tag(unknown)' |
|
1355 | $ log 'tag(unknown)' | |
1356 | abort: tag 'unknown' does not exist! |
|
1356 | abort: tag 'unknown' does not exist! | |
1357 | [255] |
|
1357 | [255] | |
1358 | $ log 'tag("re:unknown")' |
|
1358 | $ log 'tag("re:unknown")' | |
1359 | $ log 'present(tag("unknown"))' |
|
1359 | $ log 'present(tag("unknown"))' | |
1360 | $ log 'present(tag("re:unknown"))' |
|
1360 | $ log 'present(tag("re:unknown"))' | |
1361 | $ log 'branch(unknown)' |
|
1361 | $ log 'branch(unknown)' | |
1362 | abort: unknown revision 'unknown'! |
|
1362 | abort: unknown revision 'unknown'! | |
1363 | [255] |
|
1363 | [255] | |
1364 | $ log 'branch("literal:unknown")' |
|
1364 | $ log 'branch("literal:unknown")' | |
1365 | abort: branch 'unknown' does not exist! |
|
1365 | abort: branch 'unknown' does not exist! | |
1366 | [255] |
|
1366 | [255] | |
1367 | $ log 'branch("re:unknown")' |
|
1367 | $ log 'branch("re:unknown")' | |
1368 | $ log 'present(branch("unknown"))' |
|
1368 | $ log 'present(branch("unknown"))' | |
1369 | $ log 'present(branch("re:unknown"))' |
|
1369 | $ log 'present(branch("re:unknown"))' | |
1370 | $ log 'user(bob)' |
|
1370 | $ log 'user(bob)' | |
1371 | 2 |
|
1371 | 2 | |
1372 |
|
1372 | |||
1373 | $ log '4::8' |
|
1373 | $ log '4::8' | |
1374 | 4 |
|
1374 | 4 | |
1375 | 8 |
|
1375 | 8 | |
1376 | $ log '4:8' |
|
1376 | $ log '4:8' | |
1377 | 4 |
|
1377 | 4 | |
1378 | 5 |
|
1378 | 5 | |
1379 | 6 |
|
1379 | 6 | |
1380 | 7 |
|
1380 | 7 | |
1381 | 8 |
|
1381 | 8 | |
1382 |
|
1382 | |||
1383 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' |
|
1383 | $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' | |
1384 | 4 |
|
1384 | 4 | |
1385 | 2 |
|
1385 | 2 | |
1386 | 5 |
|
1386 | 5 | |
1387 |
|
1387 | |||
1388 | $ log 'not 0 and 0:2' |
|
1388 | $ log 'not 0 and 0:2' | |
1389 | 1 |
|
1389 | 1 | |
1390 | 2 |
|
1390 | 2 | |
1391 | $ log 'not 1 and 0:2' |
|
1391 | $ log 'not 1 and 0:2' | |
1392 | 0 |
|
1392 | 0 | |
1393 | 2 |
|
1393 | 2 | |
1394 | $ log 'not 2 and 0:2' |
|
1394 | $ log 'not 2 and 0:2' | |
1395 | 0 |
|
1395 | 0 | |
1396 | 1 |
|
1396 | 1 | |
1397 | $ log '(1 and 2)::' |
|
1397 | $ log '(1 and 2)::' | |
1398 | $ log '(1 and 2):' |
|
1398 | $ log '(1 and 2):' | |
1399 | $ log '(1 and 2):3' |
|
1399 | $ log '(1 and 2):3' | |
1400 | $ log 'sort(head(), -rev)' |
|
1400 | $ log 'sort(head(), -rev)' | |
1401 | 9 |
|
1401 | 9 | |
1402 | 7 |
|
1402 | 7 | |
1403 | 6 |
|
1403 | 6 | |
1404 | 5 |
|
1404 | 5 | |
1405 | 4 |
|
1405 | 4 | |
1406 | 3 |
|
1406 | 3 | |
1407 | 2 |
|
1407 | 2 | |
1408 | 1 |
|
1408 | 1 | |
1409 | 0 |
|
1409 | 0 | |
1410 | $ log '4::8 - 8' |
|
1410 | $ log '4::8 - 8' | |
1411 | 4 |
|
1411 | 4 | |
1412 | $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)' |
|
1412 | $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)' | |
1413 | 2 |
|
1413 | 2 | |
1414 | 3 |
|
1414 | 3 | |
1415 | 1 |
|
1415 | 1 | |
1416 |
|
1416 | |||
1417 | $ log 'named("unknown")' |
|
1417 | $ log 'named("unknown")' | |
1418 | abort: namespace 'unknown' does not exist! |
|
1418 | abort: namespace 'unknown' does not exist! | |
1419 | [255] |
|
1419 | [255] | |
1420 | $ log 'named("re:unknown")' |
|
1420 | $ log 'named("re:unknown")' | |
1421 | abort: no namespace exists that match 'unknown'! |
|
1421 | abort: no namespace exists that match 'unknown'! | |
1422 | [255] |
|
1422 | [255] | |
1423 | $ log 'present(named("unknown"))' |
|
1423 | $ log 'present(named("unknown"))' | |
1424 | $ log 'present(named("re:unknown"))' |
|
1424 | $ log 'present(named("re:unknown"))' | |
1425 |
|
1425 | |||
1426 | $ log 'tag()' |
|
1426 | $ log 'tag()' | |
1427 | 6 |
|
1427 | 6 | |
1428 | $ log 'named("tags")' |
|
1428 | $ log 'named("tags")' | |
1429 | 6 |
|
1429 | 6 | |
1430 |
|
1430 | |||
1431 | issue2437 |
|
1431 | issue2437 | |
1432 |
|
1432 | |||
1433 | $ log '3 and p1(5)' |
|
1433 | $ log '3 and p1(5)' | |
1434 | 3 |
|
1434 | 3 | |
1435 | $ log '4 and p2(6)' |
|
1435 | $ log '4 and p2(6)' | |
1436 | 4 |
|
1436 | 4 | |
1437 | $ log '1 and parents(:2)' |
|
1437 | $ log '1 and parents(:2)' | |
1438 | 1 |
|
1438 | 1 | |
1439 | $ log '2 and children(1:)' |
|
1439 | $ log '2 and children(1:)' | |
1440 | 2 |
|
1440 | 2 | |
1441 | $ log 'roots(all()) or roots(all())' |
|
1441 | $ log 'roots(all()) or roots(all())' | |
1442 | 0 |
|
1442 | 0 | |
1443 | $ hg debugrevspec 'roots(all()) or roots(all())' |
|
1443 | $ hg debugrevspec 'roots(all()) or roots(all())' | |
1444 | 0 |
|
1444 | 0 | |
1445 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' |
|
1445 | $ log 'heads(branch(Γ©)) or heads(branch(Γ©))' | |
1446 | 9 |
|
1446 | 9 | |
1447 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' |
|
1447 | $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(Γ©)))' | |
1448 | 4 |
|
1448 | 4 | |
1449 |
|
1449 | |||
1450 | issue2654: report a parse error if the revset was not completely parsed |
|
1450 | issue2654: report a parse error if the revset was not completely parsed | |
1451 |
|
1451 | |||
1452 | $ log '1 OR 2' |
|
1452 | $ log '1 OR 2' | |
1453 | hg: parse error at 2: invalid token |
|
1453 | hg: parse error at 2: invalid token | |
1454 | [255] |
|
1454 | [255] | |
1455 |
|
1455 | |||
1456 | or operator should preserve ordering: |
|
1456 | or operator should preserve ordering: | |
1457 | $ log 'reverse(2::4) or tip' |
|
1457 | $ log 'reverse(2::4) or tip' | |
1458 | 4 |
|
1458 | 4 | |
1459 | 2 |
|
1459 | 2 | |
1460 | 9 |
|
1460 | 9 | |
1461 |
|
1461 | |||
1462 | parentrevspec |
|
1462 | parentrevspec | |
1463 |
|
1463 | |||
1464 | $ log 'merge()^0' |
|
1464 | $ log 'merge()^0' | |
1465 | 6 |
|
1465 | 6 | |
1466 | $ log 'merge()^' |
|
1466 | $ log 'merge()^' | |
1467 | 5 |
|
1467 | 5 | |
1468 | $ log 'merge()^1' |
|
1468 | $ log 'merge()^1' | |
1469 | 5 |
|
1469 | 5 | |
1470 | $ log 'merge()^2' |
|
1470 | $ log 'merge()^2' | |
1471 | 4 |
|
1471 | 4 | |
1472 | $ log 'merge()^^' |
|
1472 | $ log 'merge()^^' | |
1473 | 3 |
|
1473 | 3 | |
1474 | $ log 'merge()^1^' |
|
1474 | $ log 'merge()^1^' | |
1475 | 3 |
|
1475 | 3 | |
1476 | $ log 'merge()^^^' |
|
1476 | $ log 'merge()^^^' | |
1477 | 1 |
|
1477 | 1 | |
1478 |
|
1478 | |||
1479 | $ log 'merge()~0' |
|
1479 | $ log 'merge()~0' | |
1480 | 6 |
|
1480 | 6 | |
1481 | $ log 'merge()~1' |
|
1481 | $ log 'merge()~1' | |
1482 | 5 |
|
1482 | 5 | |
1483 | $ log 'merge()~2' |
|
1483 | $ log 'merge()~2' | |
1484 | 3 |
|
1484 | 3 | |
1485 | $ log 'merge()~2^1' |
|
1485 | $ log 'merge()~2^1' | |
1486 | 1 |
|
1486 | 1 | |
1487 | $ log 'merge()~3' |
|
1487 | $ log 'merge()~3' | |
1488 | 1 |
|
1488 | 1 | |
1489 |
|
1489 | |||
1490 | $ log '(-3:tip)^' |
|
1490 | $ log '(-3:tip)^' | |
1491 | 4 |
|
1491 | 4 | |
1492 | 6 |
|
1492 | 6 | |
1493 | 8 |
|
1493 | 8 | |
1494 |
|
1494 | |||
1495 | $ log 'tip^foo' |
|
1495 | $ log 'tip^foo' | |
1496 | hg: parse error: ^ expects a number 0, 1, or 2 |
|
1496 | hg: parse error: ^ expects a number 0, 1, or 2 | |
1497 | [255] |
|
1497 | [255] | |
1498 |
|
1498 | |||
1499 | Bogus function gets suggestions |
|
1499 | Bogus function gets suggestions | |
1500 | $ log 'add()' |
|
1500 | $ log 'add()' | |
1501 | hg: parse error: unknown identifier: add |
|
1501 | hg: parse error: unknown identifier: add | |
1502 | (did you mean adds?) |
|
1502 | (did you mean adds?) | |
1503 | [255] |
|
1503 | [255] | |
1504 | $ log 'added()' |
|
1504 | $ log 'added()' | |
1505 | hg: parse error: unknown identifier: added |
|
1505 | hg: parse error: unknown identifier: added | |
1506 | (did you mean adds?) |
|
1506 | (did you mean adds?) | |
1507 | [255] |
|
1507 | [255] | |
1508 | $ log 'remo()' |
|
1508 | $ log 'remo()' | |
1509 | hg: parse error: unknown identifier: remo |
|
1509 | hg: parse error: unknown identifier: remo | |
1510 | (did you mean one of remote, removes?) |
|
1510 | (did you mean one of remote, removes?) | |
1511 | [255] |
|
1511 | [255] | |
1512 | $ log 'babar()' |
|
1512 | $ log 'babar()' | |
1513 | hg: parse error: unknown identifier: babar |
|
1513 | hg: parse error: unknown identifier: babar | |
1514 | [255] |
|
1514 | [255] | |
1515 |
|
1515 | |||
1516 | Bogus function with a similar internal name doesn't suggest the internal name |
|
1516 | Bogus function with a similar internal name doesn't suggest the internal name | |
1517 | $ log 'matches()' |
|
1517 | $ log 'matches()' | |
1518 | hg: parse error: unknown identifier: matches |
|
1518 | hg: parse error: unknown identifier: matches | |
1519 | (did you mean matching?) |
|
1519 | (did you mean matching?) | |
1520 | [255] |
|
1520 | [255] | |
1521 |
|
1521 | |||
1522 | Undocumented functions aren't suggested as similar either |
|
1522 | Undocumented functions aren't suggested as similar either | |
1523 | $ log 'wdir2()' |
|
1523 | $ log 'wdir2()' | |
1524 | hg: parse error: unknown identifier: wdir2 |
|
1524 | hg: parse error: unknown identifier: wdir2 | |
1525 | [255] |
|
1525 | [255] | |
1526 |
|
1526 | |||
1527 | multiple revspecs |
|
1527 | multiple revspecs | |
1528 |
|
1528 | |||
1529 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' |
|
1529 | $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' | |
1530 | 8 |
|
1530 | 8 | |
1531 | 9 |
|
1531 | 9 | |
1532 | 4 |
|
1532 | 4 | |
1533 | 5 |
|
1533 | 5 | |
1534 | 6 |
|
1534 | 6 | |
1535 | 7 |
|
1535 | 7 | |
1536 |
|
1536 | |||
1537 | test usage in revpair (with "+") |
|
1537 | test usage in revpair (with "+") | |
1538 |
|
1538 | |||
1539 | (real pair) |
|
1539 | (real pair) | |
1540 |
|
1540 | |||
1541 | $ hg diff -r 'tip^^' -r 'tip' |
|
1541 | $ hg diff -r 'tip^^' -r 'tip' | |
1542 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
1542 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
1543 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1543 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1544 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
1544 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
1545 | @@ -0,0 +1,1 @@ |
|
1545 | @@ -0,0 +1,1 @@ | |
1546 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
1546 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
1547 | $ hg diff -r 'tip^^::tip' |
|
1547 | $ hg diff -r 'tip^^::tip' | |
1548 | diff -r 2326846efdab -r 24286f4ae135 .hgtags |
|
1548 | diff -r 2326846efdab -r 24286f4ae135 .hgtags | |
1549 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1549 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1550 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
1550 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
1551 | @@ -0,0 +1,1 @@ |
|
1551 | @@ -0,0 +1,1 @@ | |
1552 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
1552 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
1553 |
|
1553 | |||
1554 | (single rev) |
|
1554 | (single rev) | |
1555 |
|
1555 | |||
1556 | $ hg diff -r 'tip^' -r 'tip^' |
|
1556 | $ hg diff -r 'tip^' -r 'tip^' | |
1557 | $ hg diff -r 'tip^:tip^' |
|
1557 | $ hg diff -r 'tip^:tip^' | |
1558 |
|
1558 | |||
1559 | (single rev that does not looks like a range) |
|
1559 | (single rev that does not looks like a range) | |
1560 |
|
1560 | |||
1561 | $ hg diff -r 'tip^::tip^ or tip^' |
|
1561 | $ hg diff -r 'tip^::tip^ or tip^' | |
1562 | diff -r d5d0dcbdc4d9 .hgtags |
|
1562 | diff -r d5d0dcbdc4d9 .hgtags | |
1563 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1563 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1564 | +++ b/.hgtags * (glob) |
|
1564 | +++ b/.hgtags * (glob) | |
1565 | @@ -0,0 +1,1 @@ |
|
1565 | @@ -0,0 +1,1 @@ | |
1566 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
1566 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
1567 | $ hg diff -r 'tip^ or tip^' |
|
1567 | $ hg diff -r 'tip^ or tip^' | |
1568 | diff -r d5d0dcbdc4d9 .hgtags |
|
1568 | diff -r d5d0dcbdc4d9 .hgtags | |
1569 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1569 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1570 | +++ b/.hgtags * (glob) |
|
1570 | +++ b/.hgtags * (glob) | |
1571 | @@ -0,0 +1,1 @@ |
|
1571 | @@ -0,0 +1,1 @@ | |
1572 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 |
|
1572 | +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 | |
1573 |
|
1573 | |||
1574 | (no rev) |
|
1574 | (no rev) | |
1575 |
|
1575 | |||
1576 | $ hg diff -r 'author("babar") or author("celeste")' |
|
1576 | $ hg diff -r 'author("babar") or author("celeste")' | |
1577 | abort: empty revision range |
|
1577 | abort: empty revision range | |
1578 | [255] |
|
1578 | [255] | |
1579 |
|
1579 | |||
1580 | aliases: |
|
1580 | aliases: | |
1581 |
|
1581 | |||
1582 | $ echo '[revsetalias]' >> .hg/hgrc |
|
1582 | $ echo '[revsetalias]' >> .hg/hgrc | |
1583 | $ echo 'm = merge()' >> .hg/hgrc |
|
1583 | $ echo 'm = merge()' >> .hg/hgrc | |
1584 | (revset aliases can override builtin revsets) |
|
1584 | (revset aliases can override builtin revsets) | |
1585 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc |
|
1585 | $ echo 'p2($1) = p1($1)' >> .hg/hgrc | |
1586 | $ echo 'sincem = descendants(m)' >> .hg/hgrc |
|
1586 | $ echo 'sincem = descendants(m)' >> .hg/hgrc | |
1587 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc |
|
1587 | $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc | |
1588 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
1588 | $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
1589 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc |
|
1589 | $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc | |
1590 |
|
1590 | |||
1591 | $ try m |
|
1591 | $ try m | |
1592 | ('symbol', 'm') |
|
1592 | ('symbol', 'm') | |
1593 | * expanded: |
|
1593 | * expanded: | |
1594 | (func |
|
1594 | (func | |
1595 | ('symbol', 'merge') |
|
1595 | ('symbol', 'merge') | |
1596 | None) |
|
1596 | None) | |
1597 | * set: |
|
1597 | * set: | |
1598 | <filteredset |
|
1598 | <filteredset | |
1599 | <fullreposet+ 0:9>, |
|
1599 | <fullreposet+ 0:9>, | |
1600 | <merge>> |
|
1600 | <merge>> | |
1601 | 6 |
|
1601 | 6 | |
1602 |
|
1602 | |||
1603 | $ HGPLAIN=1 |
|
1603 | $ HGPLAIN=1 | |
1604 | $ export HGPLAIN |
|
1604 | $ export HGPLAIN | |
1605 | $ try m |
|
1605 | $ try m | |
1606 | ('symbol', 'm') |
|
1606 | ('symbol', 'm') | |
1607 | abort: unknown revision 'm'! |
|
1607 | abort: unknown revision 'm'! | |
1608 | [255] |
|
1608 | [255] | |
1609 |
|
1609 | |||
1610 | $ HGPLAINEXCEPT=revsetalias |
|
1610 | $ HGPLAINEXCEPT=revsetalias | |
1611 | $ export HGPLAINEXCEPT |
|
1611 | $ export HGPLAINEXCEPT | |
1612 | $ try m |
|
1612 | $ try m | |
1613 | ('symbol', 'm') |
|
1613 | ('symbol', 'm') | |
1614 | * expanded: |
|
1614 | * expanded: | |
1615 | (func |
|
1615 | (func | |
1616 | ('symbol', 'merge') |
|
1616 | ('symbol', 'merge') | |
1617 | None) |
|
1617 | None) | |
1618 | * set: |
|
1618 | * set: | |
1619 | <filteredset |
|
1619 | <filteredset | |
1620 | <fullreposet+ 0:9>, |
|
1620 | <fullreposet+ 0:9>, | |
1621 | <merge>> |
|
1621 | <merge>> | |
1622 | 6 |
|
1622 | 6 | |
1623 |
|
1623 | |||
1624 | $ unset HGPLAIN |
|
1624 | $ unset HGPLAIN | |
1625 | $ unset HGPLAINEXCEPT |
|
1625 | $ unset HGPLAINEXCEPT | |
1626 |
|
1626 | |||
1627 | $ try 'p2(.)' |
|
1627 | $ try 'p2(.)' | |
1628 | (func |
|
1628 | (func | |
1629 | ('symbol', 'p2') |
|
1629 | ('symbol', 'p2') | |
1630 | ('symbol', '.')) |
|
1630 | ('symbol', '.')) | |
1631 | * expanded: |
|
1631 | * expanded: | |
1632 | (func |
|
1632 | (func | |
1633 | ('symbol', 'p1') |
|
1633 | ('symbol', 'p1') | |
1634 | ('symbol', '.')) |
|
1634 | ('symbol', '.')) | |
1635 | * set: |
|
1635 | * set: | |
1636 | <baseset+ [8]> |
|
1636 | <baseset+ [8]> | |
1637 | 8 |
|
1637 | 8 | |
1638 |
|
1638 | |||
1639 | $ HGPLAIN=1 |
|
1639 | $ HGPLAIN=1 | |
1640 | $ export HGPLAIN |
|
1640 | $ export HGPLAIN | |
1641 | $ try 'p2(.)' |
|
1641 | $ try 'p2(.)' | |
1642 | (func |
|
1642 | (func | |
1643 | ('symbol', 'p2') |
|
1643 | ('symbol', 'p2') | |
1644 | ('symbol', '.')) |
|
1644 | ('symbol', '.')) | |
1645 | * set: |
|
1645 | * set: | |
1646 | <baseset+ []> |
|
1646 | <baseset+ []> | |
1647 |
|
1647 | |||
1648 | $ HGPLAINEXCEPT=revsetalias |
|
1648 | $ HGPLAINEXCEPT=revsetalias | |
1649 | $ export HGPLAINEXCEPT |
|
1649 | $ export HGPLAINEXCEPT | |
1650 | $ try 'p2(.)' |
|
1650 | $ try 'p2(.)' | |
1651 | (func |
|
1651 | (func | |
1652 | ('symbol', 'p2') |
|
1652 | ('symbol', 'p2') | |
1653 | ('symbol', '.')) |
|
1653 | ('symbol', '.')) | |
1654 | * expanded: |
|
1654 | * expanded: | |
1655 | (func |
|
1655 | (func | |
1656 | ('symbol', 'p1') |
|
1656 | ('symbol', 'p1') | |
1657 | ('symbol', '.')) |
|
1657 | ('symbol', '.')) | |
1658 | * set: |
|
1658 | * set: | |
1659 | <baseset+ [8]> |
|
1659 | <baseset+ [8]> | |
1660 | 8 |
|
1660 | 8 | |
1661 |
|
1661 | |||
1662 | $ unset HGPLAIN |
|
1662 | $ unset HGPLAIN | |
1663 | $ unset HGPLAINEXCEPT |
|
1663 | $ unset HGPLAINEXCEPT | |
1664 |
|
1664 | |||
1665 | test alias recursion |
|
1665 | test alias recursion | |
1666 |
|
1666 | |||
1667 | $ try sincem |
|
1667 | $ try sincem | |
1668 | ('symbol', 'sincem') |
|
1668 | ('symbol', 'sincem') | |
1669 | * expanded: |
|
1669 | * expanded: | |
1670 | (func |
|
1670 | (func | |
1671 | ('symbol', 'descendants') |
|
1671 | ('symbol', 'descendants') | |
1672 | (func |
|
1672 | (func | |
1673 | ('symbol', 'merge') |
|
1673 | ('symbol', 'merge') | |
1674 | None)) |
|
1674 | None)) | |
1675 | * set: |
|
1675 | * set: | |
1676 | <addset+ |
|
1676 | <addset+ | |
1677 | <filteredset |
|
1677 | <filteredset | |
1678 | <fullreposet+ 0:9>, |
|
1678 | <fullreposet+ 0:9>, | |
1679 | <merge>>, |
|
1679 | <merge>>, | |
1680 | <generatorset+>> |
|
1680 | <generatorset+>> | |
1681 | 6 |
|
1681 | 6 | |
1682 | 7 |
|
1682 | 7 | |
1683 |
|
1683 | |||
1684 | test infinite recursion |
|
1684 | test infinite recursion | |
1685 |
|
1685 | |||
1686 | $ echo 'recurse1 = recurse2' >> .hg/hgrc |
|
1686 | $ echo 'recurse1 = recurse2' >> .hg/hgrc | |
1687 | $ echo 'recurse2 = recurse1' >> .hg/hgrc |
|
1687 | $ echo 'recurse2 = recurse1' >> .hg/hgrc | |
1688 | $ try recurse1 |
|
1688 | $ try recurse1 | |
1689 | ('symbol', 'recurse1') |
|
1689 | ('symbol', 'recurse1') | |
1690 | hg: parse error: infinite expansion of revset alias "recurse1" detected |
|
1690 | hg: parse error: infinite expansion of revset alias "recurse1" detected | |
1691 | [255] |
|
1691 | [255] | |
1692 |
|
1692 | |||
1693 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc |
|
1693 | $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc | |
1694 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc |
|
1694 | $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc | |
1695 | $ try "level2(level1(1, 2), 3)" |
|
1695 | $ try "level2(level1(1, 2), 3)" | |
1696 | (func |
|
1696 | (func | |
1697 | ('symbol', 'level2') |
|
1697 | ('symbol', 'level2') | |
1698 | (list |
|
1698 | (list | |
1699 | (func |
|
1699 | (func | |
1700 | ('symbol', 'level1') |
|
1700 | ('symbol', 'level1') | |
1701 | (list |
|
1701 | (list | |
1702 | ('symbol', '1') |
|
1702 | ('symbol', '1') | |
1703 | ('symbol', '2'))) |
|
1703 | ('symbol', '2'))) | |
1704 | ('symbol', '3'))) |
|
1704 | ('symbol', '3'))) | |
1705 | * expanded: |
|
1705 | * expanded: | |
1706 | (or |
|
1706 | (or | |
1707 | ('symbol', '3') |
|
1707 | ('symbol', '3') | |
1708 | (or |
|
1708 | (or | |
1709 | ('symbol', '1') |
|
1709 | ('symbol', '1') | |
1710 | ('symbol', '2'))) |
|
1710 | ('symbol', '2'))) | |
1711 | * set: |
|
1711 | * set: | |
1712 | <addset |
|
1712 | <addset | |
1713 | <baseset [3]>, |
|
1713 | <baseset [3]>, | |
1714 | <baseset [1, 2]>> |
|
1714 | <baseset [1, 2]>> | |
1715 | 3 |
|
1715 | 3 | |
1716 | 1 |
|
1716 | 1 | |
1717 | 2 |
|
1717 | 2 | |
1718 |
|
1718 | |||
1719 | test nesting and variable passing |
|
1719 | test nesting and variable passing | |
1720 |
|
1720 | |||
1721 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc |
|
1721 | $ echo 'nested($1) = nested2($1)' >> .hg/hgrc | |
1722 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc |
|
1722 | $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc | |
1723 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc |
|
1723 | $ echo 'nested3($1) = max($1)' >> .hg/hgrc | |
1724 | $ try 'nested(2:5)' |
|
1724 | $ try 'nested(2:5)' | |
1725 | (func |
|
1725 | (func | |
1726 | ('symbol', 'nested') |
|
1726 | ('symbol', 'nested') | |
1727 | (range |
|
1727 | (range | |
1728 | ('symbol', '2') |
|
1728 | ('symbol', '2') | |
1729 | ('symbol', '5'))) |
|
1729 | ('symbol', '5'))) | |
1730 | * expanded: |
|
1730 | * expanded: | |
1731 | (func |
|
1731 | (func | |
1732 | ('symbol', 'max') |
|
1732 | ('symbol', 'max') | |
1733 | (range |
|
1733 | (range | |
1734 | ('symbol', '2') |
|
1734 | ('symbol', '2') | |
1735 | ('symbol', '5'))) |
|
1735 | ('symbol', '5'))) | |
1736 | * set: |
|
1736 | * set: | |
1737 | <baseset |
|
1737 | <baseset | |
1738 | <max |
|
1738 | <max | |
1739 | <fullreposet+ 0:9>, |
|
1739 | <fullreposet+ 0:9>, | |
1740 | <spanset+ 2:5>>> |
|
1740 | <spanset+ 2:5>>> | |
1741 | 5 |
|
1741 | 5 | |
1742 |
|
1742 | |||
1743 | test chained `or` operations are flattened at parsing phase |
|
1743 | test chained `or` operations are flattened at parsing phase | |
1744 |
|
1744 | |||
1745 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc |
|
1745 | $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc | |
1746 | $ try 'chainedorops(0:1, 1:2, 2:3)' |
|
1746 | $ try 'chainedorops(0:1, 1:2, 2:3)' | |
1747 | (func |
|
1747 | (func | |
1748 | ('symbol', 'chainedorops') |
|
1748 | ('symbol', 'chainedorops') | |
1749 | (list |
|
1749 | (list | |
1750 | (range |
|
1750 | (range | |
1751 | ('symbol', '0') |
|
1751 | ('symbol', '0') | |
1752 | ('symbol', '1')) |
|
1752 | ('symbol', '1')) | |
1753 | (range |
|
1753 | (range | |
1754 | ('symbol', '1') |
|
1754 | ('symbol', '1') | |
1755 | ('symbol', '2')) |
|
1755 | ('symbol', '2')) | |
1756 | (range |
|
1756 | (range | |
1757 | ('symbol', '2') |
|
1757 | ('symbol', '2') | |
1758 | ('symbol', '3')))) |
|
1758 | ('symbol', '3')))) | |
1759 | * expanded: |
|
1759 | * expanded: | |
1760 | (or |
|
1760 | (or | |
1761 | (range |
|
1761 | (range | |
1762 | ('symbol', '0') |
|
1762 | ('symbol', '0') | |
1763 | ('symbol', '1')) |
|
1763 | ('symbol', '1')) | |
1764 | (range |
|
1764 | (range | |
1765 | ('symbol', '1') |
|
1765 | ('symbol', '1') | |
1766 | ('symbol', '2')) |
|
1766 | ('symbol', '2')) | |
1767 | (range |
|
1767 | (range | |
1768 | ('symbol', '2') |
|
1768 | ('symbol', '2') | |
1769 | ('symbol', '3'))) |
|
1769 | ('symbol', '3'))) | |
1770 | * set: |
|
1770 | * set: | |
1771 | <addset |
|
1771 | <addset | |
1772 | <spanset+ 0:1>, |
|
1772 | <spanset+ 0:1>, | |
1773 | <addset |
|
1773 | <addset | |
1774 | <spanset+ 1:2>, |
|
1774 | <spanset+ 1:2>, | |
1775 | <spanset+ 2:3>>> |
|
1775 | <spanset+ 2:3>>> | |
1776 | 0 |
|
1776 | 0 | |
1777 | 1 |
|
1777 | 1 | |
1778 | 2 |
|
1778 | 2 | |
1779 | 3 |
|
1779 | 3 | |
1780 |
|
1780 | |||
1781 | test variable isolation, variable placeholders are rewritten as string |
|
1781 | test variable isolation, variable placeholders are rewritten as string | |
1782 | then parsed and matched again as string. Check they do not leak too |
|
1782 | then parsed and matched again as string. Check they do not leak too | |
1783 | far away. |
|
1783 | far away. | |
1784 |
|
1784 | |||
1785 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc |
|
1785 | $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc | |
1786 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc |
|
1786 | $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc | |
1787 | $ try 'callinjection(2:5)' |
|
1787 | $ try 'callinjection(2:5)' | |
1788 | (func |
|
1788 | (func | |
1789 | ('symbol', 'callinjection') |
|
1789 | ('symbol', 'callinjection') | |
1790 | (range |
|
1790 | (range | |
1791 | ('symbol', '2') |
|
1791 | ('symbol', '2') | |
1792 | ('symbol', '5'))) |
|
1792 | ('symbol', '5'))) | |
1793 | * expanded: |
|
1793 | * expanded: | |
1794 | (func |
|
1794 | (func | |
1795 | ('symbol', 'descendants') |
|
1795 | ('symbol', 'descendants') | |
1796 | (func |
|
1796 | (func | |
1797 | ('symbol', 'max') |
|
1797 | ('symbol', 'max') | |
1798 | ('string', '$1'))) |
|
1798 | ('string', '$1'))) | |
1799 | abort: unknown revision '$1'! |
|
1799 | abort: unknown revision '$1'! | |
1800 | [255] |
|
1800 | [255] | |
1801 |
|
1801 | |||
|
1802 | test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', | |||
|
1803 | but 'all()' should never be substituded to '0()'. | |||
|
1804 | ||||
|
1805 | $ echo 'universe = all()' >> .hg/hgrc | |||
|
1806 | $ echo 'shadowall(all) = all and universe' >> .hg/hgrc | |||
|
1807 | $ try 'shadowall(0)' | |||
|
1808 | (func | |||
|
1809 | ('symbol', 'shadowall') | |||
|
1810 | ('symbol', '0')) | |||
|
1811 | * expanded: | |||
|
1812 | (and | |||
|
1813 | ('symbol', '0') | |||
|
1814 | (func | |||
|
1815 | ('symbol', 'all') | |||
|
1816 | None)) | |||
|
1817 | * set: | |||
|
1818 | <filteredset | |||
|
1819 | <baseset [0]>, | |||
|
1820 | <spanset+ 0:9>> | |||
|
1821 | 0 | |||
|
1822 | ||||
1802 | $ echo 'injectparamasstring2 = max(_aliasarg("$1"))' >> .hg/hgrc |
|
1823 | $ echo 'injectparamasstring2 = max(_aliasarg("$1"))' >> .hg/hgrc | |
1803 | $ echo 'callinjection2($1) = descendants(injectparamasstring2)' >> .hg/hgrc |
|
1824 | $ echo 'callinjection2($1) = descendants(injectparamasstring2)' >> .hg/hgrc | |
1804 | $ try 'callinjection2(2:5)' |
|
1825 | $ try 'callinjection2(2:5)' | |
1805 | (func |
|
1826 | (func | |
1806 | ('symbol', 'callinjection2') |
|
1827 | ('symbol', 'callinjection2') | |
1807 | (range |
|
1828 | (range | |
1808 | ('symbol', '2') |
|
1829 | ('symbol', '2') | |
1809 | ('symbol', '5'))) |
|
1830 | ('symbol', '5'))) | |
1810 | abort: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg |
|
1831 | abort: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg | |
1811 | [255] |
|
1832 | [255] | |
1812 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" |
|
1833 | $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" | |
1813 | ('symbol', 'tip') |
|
1834 | ('symbol', 'tip') | |
1814 | warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end |
|
1835 | warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end | |
1815 | warning: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg |
|
1836 | warning: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg | |
1816 | * set: |
|
1837 | * set: | |
1817 | <baseset [9]> |
|
1838 | <baseset [9]> | |
1818 | 9 |
|
1839 | 9 | |
1819 | >>> data = file('.hg/hgrc', 'rb').read() |
|
1840 | >>> data = file('.hg/hgrc', 'rb').read() | |
1820 | >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', '')) |
|
1841 | >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', '')) | |
1821 |
|
1842 | |||
1822 | $ try 'tip' |
|
1843 | $ try 'tip' | |
1823 | ('symbol', 'tip') |
|
1844 | ('symbol', 'tip') | |
1824 | * set: |
|
1845 | * set: | |
1825 | <baseset [9]> |
|
1846 | <baseset [9]> | |
1826 | 9 |
|
1847 | 9 | |
1827 |
|
1848 | |||
1828 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" |
|
1849 | $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" | |
1829 | ('symbol', 'tip') |
|
1850 | ('symbol', 'tip') | |
1830 | warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token |
|
1851 | warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token | |
1831 | * set: |
|
1852 | * set: | |
1832 | <baseset [9]> |
|
1853 | <baseset [9]> | |
1833 | 9 |
|
1854 | 9 | |
1834 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc |
|
1855 | $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc | |
1835 | $ try 'strictreplacing("foo", tip)' |
|
1856 | $ try 'strictreplacing("foo", tip)' | |
1836 | (func |
|
1857 | (func | |
1837 | ('symbol', 'strictreplacing') |
|
1858 | ('symbol', 'strictreplacing') | |
1838 | (list |
|
1859 | (list | |
1839 | ('string', 'foo') |
|
1860 | ('string', 'foo') | |
1840 | ('symbol', 'tip'))) |
|
1861 | ('symbol', 'tip'))) | |
1841 | * expanded: |
|
1862 | * expanded: | |
1842 | (or |
|
1863 | (or | |
1843 | ('symbol', 'tip') |
|
1864 | ('symbol', 'tip') | |
1844 | (func |
|
1865 | (func | |
1845 | ('symbol', 'desc') |
|
1866 | ('symbol', 'desc') | |
1846 | ('string', '$1'))) |
|
1867 | ('string', '$1'))) | |
1847 | * set: |
|
1868 | * set: | |
1848 | <addset |
|
1869 | <addset | |
1849 | <baseset [9]>, |
|
1870 | <baseset [9]>, | |
1850 | <filteredset |
|
1871 | <filteredset | |
1851 | <fullreposet+ 0:9>, |
|
1872 | <fullreposet+ 0:9>, | |
1852 | <desc '$1'>>> |
|
1873 | <desc '$1'>>> | |
1853 | 9 |
|
1874 | 9 | |
1854 |
|
1875 | |||
1855 | $ try 'd(2:5)' |
|
1876 | $ try 'd(2:5)' | |
1856 | (func |
|
1877 | (func | |
1857 | ('symbol', 'd') |
|
1878 | ('symbol', 'd') | |
1858 | (range |
|
1879 | (range | |
1859 | ('symbol', '2') |
|
1880 | ('symbol', '2') | |
1860 | ('symbol', '5'))) |
|
1881 | ('symbol', '5'))) | |
1861 | * expanded: |
|
1882 | * expanded: | |
1862 | (func |
|
1883 | (func | |
1863 | ('symbol', 'reverse') |
|
1884 | ('symbol', 'reverse') | |
1864 | (func |
|
1885 | (func | |
1865 | ('symbol', 'sort') |
|
1886 | ('symbol', 'sort') | |
1866 | (list |
|
1887 | (list | |
1867 | (range |
|
1888 | (range | |
1868 | ('symbol', '2') |
|
1889 | ('symbol', '2') | |
1869 | ('symbol', '5')) |
|
1890 | ('symbol', '5')) | |
1870 | ('symbol', 'date')))) |
|
1891 | ('symbol', 'date')))) | |
1871 | * set: |
|
1892 | * set: | |
1872 | <baseset [4, 5, 3, 2]> |
|
1893 | <baseset [4, 5, 3, 2]> | |
1873 | 4 |
|
1894 | 4 | |
1874 | 5 |
|
1895 | 5 | |
1875 | 3 |
|
1896 | 3 | |
1876 | 2 |
|
1897 | 2 | |
1877 | $ try 'rs(2 or 3, date)' |
|
1898 | $ try 'rs(2 or 3, date)' | |
1878 | (func |
|
1899 | (func | |
1879 | ('symbol', 'rs') |
|
1900 | ('symbol', 'rs') | |
1880 | (list |
|
1901 | (list | |
1881 | (or |
|
1902 | (or | |
1882 | ('symbol', '2') |
|
1903 | ('symbol', '2') | |
1883 | ('symbol', '3')) |
|
1904 | ('symbol', '3')) | |
1884 | ('symbol', 'date'))) |
|
1905 | ('symbol', 'date'))) | |
1885 | * expanded: |
|
1906 | * expanded: | |
1886 | (func |
|
1907 | (func | |
1887 | ('symbol', 'reverse') |
|
1908 | ('symbol', 'reverse') | |
1888 | (func |
|
1909 | (func | |
1889 | ('symbol', 'sort') |
|
1910 | ('symbol', 'sort') | |
1890 | (list |
|
1911 | (list | |
1891 | (or |
|
1912 | (or | |
1892 | ('symbol', '2') |
|
1913 | ('symbol', '2') | |
1893 | ('symbol', '3')) |
|
1914 | ('symbol', '3')) | |
1894 | ('symbol', 'date')))) |
|
1915 | ('symbol', 'date')))) | |
1895 | * set: |
|
1916 | * set: | |
1896 | <baseset [3, 2]> |
|
1917 | <baseset [3, 2]> | |
1897 | 3 |
|
1918 | 3 | |
1898 | 2 |
|
1919 | 2 | |
1899 | $ try 'rs()' |
|
1920 | $ try 'rs()' | |
1900 | (func |
|
1921 | (func | |
1901 | ('symbol', 'rs') |
|
1922 | ('symbol', 'rs') | |
1902 | None) |
|
1923 | None) | |
1903 | hg: parse error: invalid number of arguments: 0 |
|
1924 | hg: parse error: invalid number of arguments: 0 | |
1904 | [255] |
|
1925 | [255] | |
1905 | $ try 'rs(2)' |
|
1926 | $ try 'rs(2)' | |
1906 | (func |
|
1927 | (func | |
1907 | ('symbol', 'rs') |
|
1928 | ('symbol', 'rs') | |
1908 | ('symbol', '2')) |
|
1929 | ('symbol', '2')) | |
1909 | hg: parse error: invalid number of arguments: 1 |
|
1930 | hg: parse error: invalid number of arguments: 1 | |
1910 | [255] |
|
1931 | [255] | |
1911 | $ try 'rs(2, data, 7)' |
|
1932 | $ try 'rs(2, data, 7)' | |
1912 | (func |
|
1933 | (func | |
1913 | ('symbol', 'rs') |
|
1934 | ('symbol', 'rs') | |
1914 | (list |
|
1935 | (list | |
1915 | ('symbol', '2') |
|
1936 | ('symbol', '2') | |
1916 | ('symbol', 'data') |
|
1937 | ('symbol', 'data') | |
1917 | ('symbol', '7'))) |
|
1938 | ('symbol', '7'))) | |
1918 | hg: parse error: invalid number of arguments: 3 |
|
1939 | hg: parse error: invalid number of arguments: 3 | |
1919 | [255] |
|
1940 | [255] | |
1920 | $ try 'rs4(2 or 3, x, x, date)' |
|
1941 | $ try 'rs4(2 or 3, x, x, date)' | |
1921 | (func |
|
1942 | (func | |
1922 | ('symbol', 'rs4') |
|
1943 | ('symbol', 'rs4') | |
1923 | (list |
|
1944 | (list | |
1924 | (or |
|
1945 | (or | |
1925 | ('symbol', '2') |
|
1946 | ('symbol', '2') | |
1926 | ('symbol', '3')) |
|
1947 | ('symbol', '3')) | |
1927 | ('symbol', 'x') |
|
1948 | ('symbol', 'x') | |
1928 | ('symbol', 'x') |
|
1949 | ('symbol', 'x') | |
1929 | ('symbol', 'date'))) |
|
1950 | ('symbol', 'date'))) | |
1930 | * expanded: |
|
1951 | * expanded: | |
1931 | (func |
|
1952 | (func | |
1932 | ('symbol', 'reverse') |
|
1953 | ('symbol', 'reverse') | |
1933 | (func |
|
1954 | (func | |
1934 | ('symbol', 'sort') |
|
1955 | ('symbol', 'sort') | |
1935 | (list |
|
1956 | (list | |
1936 | (or |
|
1957 | (or | |
1937 | ('symbol', '2') |
|
1958 | ('symbol', '2') | |
1938 | ('symbol', '3')) |
|
1959 | ('symbol', '3')) | |
1939 | ('symbol', 'date')))) |
|
1960 | ('symbol', 'date')))) | |
1940 | * set: |
|
1961 | * set: | |
1941 | <baseset [3, 2]> |
|
1962 | <baseset [3, 2]> | |
1942 | 3 |
|
1963 | 3 | |
1943 | 2 |
|
1964 | 2 | |
1944 |
|
1965 | |||
1945 | issue4553: check that revset aliases override existing hash prefix |
|
1966 | issue4553: check that revset aliases override existing hash prefix | |
1946 |
|
1967 | |||
1947 | $ hg log -qr e |
|
1968 | $ hg log -qr e | |
1948 | 6:e0cc66ef77e8 |
|
1969 | 6:e0cc66ef77e8 | |
1949 |
|
1970 | |||
1950 | $ hg log -qr e --config revsetalias.e="all()" |
|
1971 | $ hg log -qr e --config revsetalias.e="all()" | |
1951 | 0:2785f51eece5 |
|
1972 | 0:2785f51eece5 | |
1952 | 1:d75937da8da0 |
|
1973 | 1:d75937da8da0 | |
1953 | 2:5ed5505e9f1c |
|
1974 | 2:5ed5505e9f1c | |
1954 | 3:8528aa5637f2 |
|
1975 | 3:8528aa5637f2 | |
1955 | 4:2326846efdab |
|
1976 | 4:2326846efdab | |
1956 | 5:904fa392b941 |
|
1977 | 5:904fa392b941 | |
1957 | 6:e0cc66ef77e8 |
|
1978 | 6:e0cc66ef77e8 | |
1958 | 7:013af1973af4 |
|
1979 | 7:013af1973af4 | |
1959 | 8:d5d0dcbdc4d9 |
|
1980 | 8:d5d0dcbdc4d9 | |
1960 | 9:24286f4ae135 |
|
1981 | 9:24286f4ae135 | |
1961 |
|
1982 | |||
1962 | $ hg log -qr e: --config revsetalias.e="0" |
|
1983 | $ hg log -qr e: --config revsetalias.e="0" | |
1963 | 0:2785f51eece5 |
|
1984 | 0:2785f51eece5 | |
1964 | 1:d75937da8da0 |
|
1985 | 1:d75937da8da0 | |
1965 | 2:5ed5505e9f1c |
|
1986 | 2:5ed5505e9f1c | |
1966 | 3:8528aa5637f2 |
|
1987 | 3:8528aa5637f2 | |
1967 | 4:2326846efdab |
|
1988 | 4:2326846efdab | |
1968 | 5:904fa392b941 |
|
1989 | 5:904fa392b941 | |
1969 | 6:e0cc66ef77e8 |
|
1990 | 6:e0cc66ef77e8 | |
1970 | 7:013af1973af4 |
|
1991 | 7:013af1973af4 | |
1971 | 8:d5d0dcbdc4d9 |
|
1992 | 8:d5d0dcbdc4d9 | |
1972 | 9:24286f4ae135 |
|
1993 | 9:24286f4ae135 | |
1973 |
|
1994 | |||
1974 | $ hg log -qr :e --config revsetalias.e="9" |
|
1995 | $ hg log -qr :e --config revsetalias.e="9" | |
1975 | 0:2785f51eece5 |
|
1996 | 0:2785f51eece5 | |
1976 | 1:d75937da8da0 |
|
1997 | 1:d75937da8da0 | |
1977 | 2:5ed5505e9f1c |
|
1998 | 2:5ed5505e9f1c | |
1978 | 3:8528aa5637f2 |
|
1999 | 3:8528aa5637f2 | |
1979 | 4:2326846efdab |
|
2000 | 4:2326846efdab | |
1980 | 5:904fa392b941 |
|
2001 | 5:904fa392b941 | |
1981 | 6:e0cc66ef77e8 |
|
2002 | 6:e0cc66ef77e8 | |
1982 | 7:013af1973af4 |
|
2003 | 7:013af1973af4 | |
1983 | 8:d5d0dcbdc4d9 |
|
2004 | 8:d5d0dcbdc4d9 | |
1984 | 9:24286f4ae135 |
|
2005 | 9:24286f4ae135 | |
1985 |
|
2006 | |||
1986 | $ hg log -qr e: |
|
2007 | $ hg log -qr e: | |
1987 | 6:e0cc66ef77e8 |
|
2008 | 6:e0cc66ef77e8 | |
1988 | 7:013af1973af4 |
|
2009 | 7:013af1973af4 | |
1989 | 8:d5d0dcbdc4d9 |
|
2010 | 8:d5d0dcbdc4d9 | |
1990 | 9:24286f4ae135 |
|
2011 | 9:24286f4ae135 | |
1991 |
|
2012 | |||
1992 | $ hg log -qr :e |
|
2013 | $ hg log -qr :e | |
1993 | 0:2785f51eece5 |
|
2014 | 0:2785f51eece5 | |
1994 | 1:d75937da8da0 |
|
2015 | 1:d75937da8da0 | |
1995 | 2:5ed5505e9f1c |
|
2016 | 2:5ed5505e9f1c | |
1996 | 3:8528aa5637f2 |
|
2017 | 3:8528aa5637f2 | |
1997 | 4:2326846efdab |
|
2018 | 4:2326846efdab | |
1998 | 5:904fa392b941 |
|
2019 | 5:904fa392b941 | |
1999 | 6:e0cc66ef77e8 |
|
2020 | 6:e0cc66ef77e8 | |
2000 |
|
2021 | |||
2001 | issue2549 - correct optimizations |
|
2022 | issue2549 - correct optimizations | |
2002 |
|
2023 | |||
2003 | $ try 'limit(1 or 2 or 3, 2) and not 2' |
|
2024 | $ try 'limit(1 or 2 or 3, 2) and not 2' | |
2004 | (and |
|
2025 | (and | |
2005 | (func |
|
2026 | (func | |
2006 | ('symbol', 'limit') |
|
2027 | ('symbol', 'limit') | |
2007 | (list |
|
2028 | (list | |
2008 | (or |
|
2029 | (or | |
2009 | ('symbol', '1') |
|
2030 | ('symbol', '1') | |
2010 | ('symbol', '2') |
|
2031 | ('symbol', '2') | |
2011 | ('symbol', '3')) |
|
2032 | ('symbol', '3')) | |
2012 | ('symbol', '2'))) |
|
2033 | ('symbol', '2'))) | |
2013 | (not |
|
2034 | (not | |
2014 | ('symbol', '2'))) |
|
2035 | ('symbol', '2'))) | |
2015 | * set: |
|
2036 | * set: | |
2016 | <filteredset |
|
2037 | <filteredset | |
2017 | <baseset |
|
2038 | <baseset | |
2018 | <limit n=2, offset=0, |
|
2039 | <limit n=2, offset=0, | |
2019 | <fullreposet+ 0:9>, |
|
2040 | <fullreposet+ 0:9>, | |
2020 | <baseset [1, 2, 3]>>>, |
|
2041 | <baseset [1, 2, 3]>>>, | |
2021 | <not |
|
2042 | <not | |
2022 | <baseset [2]>>> |
|
2043 | <baseset [2]>>> | |
2023 | 1 |
|
2044 | 1 | |
2024 | $ try 'max(1 or 2) and not 2' |
|
2045 | $ try 'max(1 or 2) and not 2' | |
2025 | (and |
|
2046 | (and | |
2026 | (func |
|
2047 | (func | |
2027 | ('symbol', 'max') |
|
2048 | ('symbol', 'max') | |
2028 | (or |
|
2049 | (or | |
2029 | ('symbol', '1') |
|
2050 | ('symbol', '1') | |
2030 | ('symbol', '2'))) |
|
2051 | ('symbol', '2'))) | |
2031 | (not |
|
2052 | (not | |
2032 | ('symbol', '2'))) |
|
2053 | ('symbol', '2'))) | |
2033 | * set: |
|
2054 | * set: | |
2034 | <filteredset |
|
2055 | <filteredset | |
2035 | <baseset |
|
2056 | <baseset | |
2036 | <max |
|
2057 | <max | |
2037 | <fullreposet+ 0:9>, |
|
2058 | <fullreposet+ 0:9>, | |
2038 | <baseset [1, 2]>>>, |
|
2059 | <baseset [1, 2]>>>, | |
2039 | <not |
|
2060 | <not | |
2040 | <baseset [2]>>> |
|
2061 | <baseset [2]>>> | |
2041 | $ try 'min(1 or 2) and not 1' |
|
2062 | $ try 'min(1 or 2) and not 1' | |
2042 | (and |
|
2063 | (and | |
2043 | (func |
|
2064 | (func | |
2044 | ('symbol', 'min') |
|
2065 | ('symbol', 'min') | |
2045 | (or |
|
2066 | (or | |
2046 | ('symbol', '1') |
|
2067 | ('symbol', '1') | |
2047 | ('symbol', '2'))) |
|
2068 | ('symbol', '2'))) | |
2048 | (not |
|
2069 | (not | |
2049 | ('symbol', '1'))) |
|
2070 | ('symbol', '1'))) | |
2050 | * set: |
|
2071 | * set: | |
2051 | <filteredset |
|
2072 | <filteredset | |
2052 | <baseset |
|
2073 | <baseset | |
2053 | <min |
|
2074 | <min | |
2054 | <fullreposet+ 0:9>, |
|
2075 | <fullreposet+ 0:9>, | |
2055 | <baseset [1, 2]>>>, |
|
2076 | <baseset [1, 2]>>>, | |
2056 | <not |
|
2077 | <not | |
2057 | <baseset [1]>>> |
|
2078 | <baseset [1]>>> | |
2058 | $ try 'last(1 or 2, 1) and not 2' |
|
2079 | $ try 'last(1 or 2, 1) and not 2' | |
2059 | (and |
|
2080 | (and | |
2060 | (func |
|
2081 | (func | |
2061 | ('symbol', 'last') |
|
2082 | ('symbol', 'last') | |
2062 | (list |
|
2083 | (list | |
2063 | (or |
|
2084 | (or | |
2064 | ('symbol', '1') |
|
2085 | ('symbol', '1') | |
2065 | ('symbol', '2')) |
|
2086 | ('symbol', '2')) | |
2066 | ('symbol', '1'))) |
|
2087 | ('symbol', '1'))) | |
2067 | (not |
|
2088 | (not | |
2068 | ('symbol', '2'))) |
|
2089 | ('symbol', '2'))) | |
2069 | * set: |
|
2090 | * set: | |
2070 | <filteredset |
|
2091 | <filteredset | |
2071 | <baseset |
|
2092 | <baseset | |
2072 | <last n=1, |
|
2093 | <last n=1, | |
2073 | <fullreposet+ 0:9>, |
|
2094 | <fullreposet+ 0:9>, | |
2074 | <baseset [2, 1]>>>, |
|
2095 | <baseset [2, 1]>>>, | |
2075 | <not |
|
2096 | <not | |
2076 | <baseset [2]>>> |
|
2097 | <baseset [2]>>> | |
2077 |
|
2098 | |||
2078 | issue4289 - ordering of built-ins |
|
2099 | issue4289 - ordering of built-ins | |
2079 | $ hg log -M -q -r 3:2 |
|
2100 | $ hg log -M -q -r 3:2 | |
2080 | 3:8528aa5637f2 |
|
2101 | 3:8528aa5637f2 | |
2081 | 2:5ed5505e9f1c |
|
2102 | 2:5ed5505e9f1c | |
2082 |
|
2103 | |||
2083 | test revsets started with 40-chars hash (issue3669) |
|
2104 | test revsets started with 40-chars hash (issue3669) | |
2084 |
|
2105 | |||
2085 | $ ISSUE3669_TIP=`hg tip --template '{node}'` |
|
2106 | $ ISSUE3669_TIP=`hg tip --template '{node}'` | |
2086 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' |
|
2107 | $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' | |
2087 | 9 |
|
2108 | 9 | |
2088 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' |
|
2109 | $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' | |
2089 | 8 |
|
2110 | 8 | |
2090 |
|
2111 | |||
2091 | test or-ed indirect predicates (issue3775) |
|
2112 | test or-ed indirect predicates (issue3775) | |
2092 |
|
2113 | |||
2093 | $ log '6 or 6^1' | sort |
|
2114 | $ log '6 or 6^1' | sort | |
2094 | 5 |
|
2115 | 5 | |
2095 | 6 |
|
2116 | 6 | |
2096 | $ log '6^1 or 6' | sort |
|
2117 | $ log '6^1 or 6' | sort | |
2097 | 5 |
|
2118 | 5 | |
2098 | 6 |
|
2119 | 6 | |
2099 | $ log '4 or 4~1' | sort |
|
2120 | $ log '4 or 4~1' | sort | |
2100 | 2 |
|
2121 | 2 | |
2101 | 4 |
|
2122 | 4 | |
2102 | $ log '4~1 or 4' | sort |
|
2123 | $ log '4~1 or 4' | sort | |
2103 | 2 |
|
2124 | 2 | |
2104 | 4 |
|
2125 | 4 | |
2105 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort |
|
2126 | $ log '(0 or 2):(4 or 6) or 0 or 6' | sort | |
2106 | 0 |
|
2127 | 0 | |
2107 | 1 |
|
2128 | 1 | |
2108 | 2 |
|
2129 | 2 | |
2109 | 3 |
|
2130 | 3 | |
2110 | 4 |
|
2131 | 4 | |
2111 | 5 |
|
2132 | 5 | |
2112 | 6 |
|
2133 | 6 | |
2113 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort |
|
2134 | $ log '0 or 6 or (0 or 2):(4 or 6)' | sort | |
2114 | 0 |
|
2135 | 0 | |
2115 | 1 |
|
2136 | 1 | |
2116 | 2 |
|
2137 | 2 | |
2117 | 3 |
|
2138 | 3 | |
2118 | 4 |
|
2139 | 4 | |
2119 | 5 |
|
2140 | 5 | |
2120 | 6 |
|
2141 | 6 | |
2121 |
|
2142 | |||
2122 | tests for 'remote()' predicate: |
|
2143 | tests for 'remote()' predicate: | |
2123 | #. (csets in remote) (id) (remote) |
|
2144 | #. (csets in remote) (id) (remote) | |
2124 | 1. less than local current branch "default" |
|
2145 | 1. less than local current branch "default" | |
2125 | 2. same with local specified "default" |
|
2146 | 2. same with local specified "default" | |
2126 | 3. more than local specified specified |
|
2147 | 3. more than local specified specified | |
2127 |
|
2148 | |||
2128 | $ hg clone --quiet -U . ../remote3 |
|
2149 | $ hg clone --quiet -U . ../remote3 | |
2129 | $ cd ../remote3 |
|
2150 | $ cd ../remote3 | |
2130 | $ hg update -q 7 |
|
2151 | $ hg update -q 7 | |
2131 | $ echo r > r |
|
2152 | $ echo r > r | |
2132 | $ hg ci -Aqm 10 |
|
2153 | $ hg ci -Aqm 10 | |
2133 | $ log 'remote()' |
|
2154 | $ log 'remote()' | |
2134 | 7 |
|
2155 | 7 | |
2135 | $ log 'remote("a-b-c-")' |
|
2156 | $ log 'remote("a-b-c-")' | |
2136 | 2 |
|
2157 | 2 | |
2137 | $ cd ../repo |
|
2158 | $ cd ../repo | |
2138 | $ log 'remote(".a.b.c.", "../remote3")' |
|
2159 | $ log 'remote(".a.b.c.", "../remote3")' | |
2139 |
|
2160 | |||
2140 | tests for concatenation of strings/symbols by "##" |
|
2161 | tests for concatenation of strings/symbols by "##" | |
2141 |
|
2162 | |||
2142 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" |
|
2163 | $ try "278 ## '5f5' ## 1ee ## 'ce5'" | |
2143 | (_concat |
|
2164 | (_concat | |
2144 | (_concat |
|
2165 | (_concat | |
2145 | (_concat |
|
2166 | (_concat | |
2146 | ('symbol', '278') |
|
2167 | ('symbol', '278') | |
2147 | ('string', '5f5')) |
|
2168 | ('string', '5f5')) | |
2148 | ('symbol', '1ee')) |
|
2169 | ('symbol', '1ee')) | |
2149 | ('string', 'ce5')) |
|
2170 | ('string', 'ce5')) | |
2150 | * concatenated: |
|
2171 | * concatenated: | |
2151 | ('string', '2785f51eece5') |
|
2172 | ('string', '2785f51eece5') | |
2152 | * set: |
|
2173 | * set: | |
2153 | <baseset [0]> |
|
2174 | <baseset [0]> | |
2154 | 0 |
|
2175 | 0 | |
2155 |
|
2176 | |||
2156 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc |
|
2177 | $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc | |
2157 | $ try "cat4(278, '5f5', 1ee, 'ce5')" |
|
2178 | $ try "cat4(278, '5f5', 1ee, 'ce5')" | |
2158 | (func |
|
2179 | (func | |
2159 | ('symbol', 'cat4') |
|
2180 | ('symbol', 'cat4') | |
2160 | (list |
|
2181 | (list | |
2161 | ('symbol', '278') |
|
2182 | ('symbol', '278') | |
2162 | ('string', '5f5') |
|
2183 | ('string', '5f5') | |
2163 | ('symbol', '1ee') |
|
2184 | ('symbol', '1ee') | |
2164 | ('string', 'ce5'))) |
|
2185 | ('string', 'ce5'))) | |
2165 | * expanded: |
|
2186 | * expanded: | |
2166 | (_concat |
|
2187 | (_concat | |
2167 | (_concat |
|
2188 | (_concat | |
2168 | (_concat |
|
2189 | (_concat | |
2169 | ('symbol', '278') |
|
2190 | ('symbol', '278') | |
2170 | ('string', '5f5')) |
|
2191 | ('string', '5f5')) | |
2171 | ('symbol', '1ee')) |
|
2192 | ('symbol', '1ee')) | |
2172 | ('string', 'ce5')) |
|
2193 | ('string', 'ce5')) | |
2173 | * concatenated: |
|
2194 | * concatenated: | |
2174 | ('string', '2785f51eece5') |
|
2195 | ('string', '2785f51eece5') | |
2175 | * set: |
|
2196 | * set: | |
2176 | <baseset [0]> |
|
2197 | <baseset [0]> | |
2177 | 0 |
|
2198 | 0 | |
2178 |
|
2199 | |||
2179 | (check concatenation in alias nesting) |
|
2200 | (check concatenation in alias nesting) | |
2180 |
|
2201 | |||
2181 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc |
|
2202 | $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc | |
2182 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc |
|
2203 | $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc | |
2183 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" |
|
2204 | $ log "cat2x2(278, '5f5', 1ee, 'ce5')" | |
2184 | 0 |
|
2205 | 0 | |
2185 |
|
2206 | |||
2186 | (check operator priority) |
|
2207 | (check operator priority) | |
2187 |
|
2208 | |||
2188 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc |
|
2209 | $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc | |
2189 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" |
|
2210 | $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" | |
2190 | 0 |
|
2211 | 0 | |
2191 | 4 |
|
2212 | 4 | |
2192 |
|
2213 | |||
2193 | $ cd .. |
|
2214 | $ cd .. | |
2194 |
|
2215 | |||
2195 | prepare repository that has "default" branches of multiple roots |
|
2216 | prepare repository that has "default" branches of multiple roots | |
2196 |
|
2217 | |||
2197 | $ hg init namedbranch |
|
2218 | $ hg init namedbranch | |
2198 | $ cd namedbranch |
|
2219 | $ cd namedbranch | |
2199 |
|
2220 | |||
2200 | $ echo default0 >> a |
|
2221 | $ echo default0 >> a | |
2201 | $ hg ci -Aqm0 |
|
2222 | $ hg ci -Aqm0 | |
2202 | $ echo default1 >> a |
|
2223 | $ echo default1 >> a | |
2203 | $ hg ci -m1 |
|
2224 | $ hg ci -m1 | |
2204 |
|
2225 | |||
2205 | $ hg branch -q stable |
|
2226 | $ hg branch -q stable | |
2206 | $ echo stable2 >> a |
|
2227 | $ echo stable2 >> a | |
2207 | $ hg ci -m2 |
|
2228 | $ hg ci -m2 | |
2208 | $ echo stable3 >> a |
|
2229 | $ echo stable3 >> a | |
2209 | $ hg ci -m3 |
|
2230 | $ hg ci -m3 | |
2210 |
|
2231 | |||
2211 | $ hg update -q null |
|
2232 | $ hg update -q null | |
2212 | $ echo default4 >> a |
|
2233 | $ echo default4 >> a | |
2213 | $ hg ci -Aqm4 |
|
2234 | $ hg ci -Aqm4 | |
2214 | $ echo default5 >> a |
|
2235 | $ echo default5 >> a | |
2215 | $ hg ci -m5 |
|
2236 | $ hg ci -m5 | |
2216 |
|
2237 | |||
2217 | "null" revision belongs to "default" branch (issue4683) |
|
2238 | "null" revision belongs to "default" branch (issue4683) | |
2218 |
|
2239 | |||
2219 | $ log 'branch(null)' |
|
2240 | $ log 'branch(null)' | |
2220 | 0 |
|
2241 | 0 | |
2221 | 1 |
|
2242 | 1 | |
2222 | 4 |
|
2243 | 4 | |
2223 | 5 |
|
2244 | 5 | |
2224 |
|
2245 | |||
2225 | "null" revision belongs to "default" branch, but it shouldn't appear in set |
|
2246 | "null" revision belongs to "default" branch, but it shouldn't appear in set | |
2226 | unless explicitly specified (issue4682) |
|
2247 | unless explicitly specified (issue4682) | |
2227 |
|
2248 | |||
2228 | $ log 'children(branch(default))' |
|
2249 | $ log 'children(branch(default))' | |
2229 | 1 |
|
2250 | 1 | |
2230 | 2 |
|
2251 | 2 | |
2231 | 5 |
|
2252 | 5 | |
2232 |
|
2253 | |||
2233 | $ cd .. |
|
2254 | $ cd .. | |
2234 |
|
2255 | |||
2235 | test author/desc/keyword in problematic encoding |
|
2256 | test author/desc/keyword in problematic encoding | |
2236 | # unicode: cp932: |
|
2257 | # unicode: cp932: | |
2237 | # u30A2 0x83 0x41(= 'A') |
|
2258 | # u30A2 0x83 0x41(= 'A') | |
2238 | # u30C2 0x83 0x61(= 'a') |
|
2259 | # u30C2 0x83 0x61(= 'a') | |
2239 |
|
2260 | |||
2240 | $ hg init problematicencoding |
|
2261 | $ hg init problematicencoding | |
2241 | $ cd problematicencoding |
|
2262 | $ cd problematicencoding | |
2242 |
|
2263 | |||
2243 | $ python > setup.sh <<EOF |
|
2264 | $ python > setup.sh <<EOF | |
2244 | > print u''' |
|
2265 | > print u''' | |
2245 | > echo a > text |
|
2266 | > echo a > text | |
2246 | > hg add text |
|
2267 | > hg add text | |
2247 | > hg --encoding utf-8 commit -u '\u30A2' -m none |
|
2268 | > hg --encoding utf-8 commit -u '\u30A2' -m none | |
2248 | > echo b > text |
|
2269 | > echo b > text | |
2249 | > hg --encoding utf-8 commit -u '\u30C2' -m none |
|
2270 | > hg --encoding utf-8 commit -u '\u30C2' -m none | |
2250 | > echo c > text |
|
2271 | > echo c > text | |
2251 | > hg --encoding utf-8 commit -u none -m '\u30A2' |
|
2272 | > hg --encoding utf-8 commit -u none -m '\u30A2' | |
2252 | > echo d > text |
|
2273 | > echo d > text | |
2253 | > hg --encoding utf-8 commit -u none -m '\u30C2' |
|
2274 | > hg --encoding utf-8 commit -u none -m '\u30C2' | |
2254 | > '''.encode('utf-8') |
|
2275 | > '''.encode('utf-8') | |
2255 | > EOF |
|
2276 | > EOF | |
2256 | $ sh < setup.sh |
|
2277 | $ sh < setup.sh | |
2257 |
|
2278 | |||
2258 | test in problematic encoding |
|
2279 | test in problematic encoding | |
2259 | $ python > test.sh <<EOF |
|
2280 | $ python > test.sh <<EOF | |
2260 | > print u''' |
|
2281 | > print u''' | |
2261 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' |
|
2282 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' | |
2262 | > echo ==== |
|
2283 | > echo ==== | |
2263 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' |
|
2284 | > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' | |
2264 | > echo ==== |
|
2285 | > echo ==== | |
2265 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' |
|
2286 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' | |
2266 | > echo ==== |
|
2287 | > echo ==== | |
2267 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' |
|
2288 | > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' | |
2268 | > echo ==== |
|
2289 | > echo ==== | |
2269 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' |
|
2290 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' | |
2270 | > echo ==== |
|
2291 | > echo ==== | |
2271 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' |
|
2292 | > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' | |
2272 | > '''.encode('cp932') |
|
2293 | > '''.encode('cp932') | |
2273 | > EOF |
|
2294 | > EOF | |
2274 | $ sh < test.sh |
|
2295 | $ sh < test.sh | |
2275 | 0 |
|
2296 | 0 | |
2276 | ==== |
|
2297 | ==== | |
2277 | 1 |
|
2298 | 1 | |
2278 | ==== |
|
2299 | ==== | |
2279 | 2 |
|
2300 | 2 | |
2280 | ==== |
|
2301 | ==== | |
2281 | 3 |
|
2302 | 3 | |
2282 | ==== |
|
2303 | ==== | |
2283 | 0 |
|
2304 | 0 | |
2284 | 2 |
|
2305 | 2 | |
2285 | ==== |
|
2306 | ==== | |
2286 | 1 |
|
2307 | 1 | |
2287 | 3 |
|
2308 | 3 | |
2288 |
|
2309 | |||
2289 | test error message of bad revset |
|
2310 | test error message of bad revset | |
2290 | $ hg log -r 'foo\\' |
|
2311 | $ hg log -r 'foo\\' | |
2291 | hg: parse error at 3: syntax error in revset 'foo\\' |
|
2312 | hg: parse error at 3: syntax error in revset 'foo\\' | |
2292 | [255] |
|
2313 | [255] | |
2293 |
|
2314 | |||
2294 | $ cd .. |
|
2315 | $ cd .. | |
2295 |
|
2316 | |||
2296 | Test that revset predicate of extension isn't loaded at failure of |
|
2317 | Test that revset predicate of extension isn't loaded at failure of | |
2297 | loading it |
|
2318 | loading it | |
2298 |
|
2319 | |||
2299 | $ cd repo |
|
2320 | $ cd repo | |
2300 |
|
2321 | |||
2301 | $ cat <<EOF > $TESTTMP/custompredicate.py |
|
2322 | $ cat <<EOF > $TESTTMP/custompredicate.py | |
2302 | > from mercurial import error, registrar, revset |
|
2323 | > from mercurial import error, registrar, revset | |
2303 | > |
|
2324 | > | |
2304 | > revsetpredicate = registrar.revsetpredicate() |
|
2325 | > revsetpredicate = registrar.revsetpredicate() | |
2305 | > |
|
2326 | > | |
2306 | > @revsetpredicate('custom1()') |
|
2327 | > @revsetpredicate('custom1()') | |
2307 | > def custom1(repo, subset, x): |
|
2328 | > def custom1(repo, subset, x): | |
2308 | > return revset.baseset([1]) |
|
2329 | > return revset.baseset([1]) | |
2309 | > |
|
2330 | > | |
2310 | > raise error.Abort('intentional failure of loading extension') |
|
2331 | > raise error.Abort('intentional failure of loading extension') | |
2311 | > EOF |
|
2332 | > EOF | |
2312 | $ cat <<EOF > .hg/hgrc |
|
2333 | $ cat <<EOF > .hg/hgrc | |
2313 | > [extensions] |
|
2334 | > [extensions] | |
2314 | > custompredicate = $TESTTMP/custompredicate.py |
|
2335 | > custompredicate = $TESTTMP/custompredicate.py | |
2315 | > EOF |
|
2336 | > EOF | |
2316 |
|
2337 | |||
2317 | $ hg debugrevspec "custom1()" |
|
2338 | $ hg debugrevspec "custom1()" | |
2318 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension |
|
2339 | *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension | |
2319 | hg: parse error: unknown identifier: custom1 |
|
2340 | hg: parse error: unknown identifier: custom1 | |
2320 | [255] |
|
2341 | [255] | |
2321 |
|
2342 | |||
2322 | $ cd .. |
|
2343 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now