Show More
@@ -397,15 +397,18 b' def andset(repo, subset, x, y):' | |||||
397 | def differenceset(repo, subset, x, y): |
|
397 | def differenceset(repo, subset, x, y): | |
398 | return getset(repo, subset, x) - getset(repo, subset, y) |
|
398 | return getset(repo, subset, x) - getset(repo, subset, y) | |
399 |
|
399 | |||
400 |
def orset(repo, subset, |
|
400 | def _orsetlist(repo, subset, xs): | |
401 | assert xs |
|
401 | assert xs | |
402 | if len(xs) == 1: |
|
402 | if len(xs) == 1: | |
403 | return getset(repo, subset, xs[0]) |
|
403 | return getset(repo, subset, xs[0]) | |
404 | p = len(xs) // 2 |
|
404 | p = len(xs) // 2 | |
405 |
a = orset(repo, subset, |
|
405 | a = _orsetlist(repo, subset, xs[:p]) | |
406 |
b = orset(repo, subset, |
|
406 | b = _orsetlist(repo, subset, xs[p:]) | |
407 | return a + b |
|
407 | return a + b | |
408 |
|
408 | |||
|
409 | def orset(repo, subset, x): | |||
|
410 | return _orsetlist(repo, subset, getlist(x)) | |||
|
411 | ||||
409 | def notset(repo, subset, x): |
|
412 | def notset(repo, subset, x): | |
410 | return subset - getset(repo, subset, x) |
|
413 | return subset - getset(repo, subset, x) | |
411 |
|
414 | |||
@@ -2339,6 +2342,10 b' def _fixops(x):' | |||||
2339 | return _fixops(('range', post, x[2][1])) |
|
2342 | return _fixops(('range', post, x[2][1])) | |
2340 | elif x[2][0] == 'rangeall': |
|
2343 | elif x[2][0] == 'rangeall': | |
2341 | return _fixops(('rangepost', post)) |
|
2344 | return _fixops(('rangepost', post)) | |
|
2345 | elif op == 'or': | |||
|
2346 | # make number of arguments deterministic: | |||
|
2347 | # x + y + z -> (or x y z) -> (or (list x y z)) | |||
|
2348 | return (op, _fixops(('list',) + x[1:])) | |||
2342 |
|
2349 | |||
2343 | return (op,) + tuple(_fixops(y) for y in x[1:]) |
|
2350 | return (op,) + tuple(_fixops(y) for y in x[1:]) | |
2344 |
|
2351 | |||
@@ -2374,7 +2381,7 b' def _analyze(x):' | |||||
2374 | tb = _analyze(x[2]) |
|
2381 | tb = _analyze(x[2]) | |
2375 | return (op, ta, tb) |
|
2382 | return (op, ta, tb) | |
2376 | elif op == 'or': |
|
2383 | elif op == 'or': | |
2377 |
return (op, |
|
2384 | return (op, _analyze(x[1])) | |
2378 | elif op == 'not': |
|
2385 | elif op == 'not': | |
2379 | return (op, _analyze(x[1])) |
|
2386 | return (op, _analyze(x[1])) | |
2380 | elif op == 'parentpost': |
|
2387 | elif op == 'parentpost': | |
@@ -2445,7 +2452,7 b' def _optimize(x, small):' | |||||
2445 | ws.append(w) |
|
2452 | ws.append(w) | |
2446 | ts.append(t) |
|
2453 | ts.append(t) | |
2447 | del ss[:] |
|
2454 | del ss[:] | |
2448 |
for y in x[1 |
|
2455 | for y in getlist(x[1]): | |
2449 | w, t = _optimize(y, False) |
|
2456 | w, t = _optimize(y, False) | |
2450 | if t is not None and (t[0] == 'string' or t[0] == 'symbol'): |
|
2457 | if t is not None and (t[0] == 'string' or t[0] == 'symbol'): | |
2451 | ss.append((w, t)) |
|
2458 | ss.append((w, t)) | |
@@ -2459,7 +2466,7 b' def _optimize(x, small):' | |||||
2459 | # we can't reorder trees by weight because it would change the order. |
|
2466 | # we can't reorder trees by weight because it would change the order. | |
2460 | # ("sort(a + b)" == "sort(b + a)", but "a + b" != "b + a") |
|
2467 | # ("sort(a + b)" == "sort(b + a)", but "a + b" != "b + a") | |
2461 | # ts = tuple(t for w, t in sorted(zip(ws, ts), key=lambda wt: wt[0])) |
|
2468 | # ts = tuple(t for w, t in sorted(zip(ws, ts), key=lambda wt: wt[0])) | |
2462 | return max(ws), (op,) + tuple(ts) |
|
2469 | return max(ws), (op, ('list',) + tuple(ts)) | |
2463 | elif op == 'not': |
|
2470 | elif op == 'not': | |
2464 | # Optimize not public() to _notpublic() because we have a fast version |
|
2471 | # Optimize not public() to _notpublic() because we have a fast version | |
2465 | if x[1] == ('func', ('symbol', 'public'), None): |
|
2472 | if x[1] == ('func', ('symbol', 'public'), None): | |
@@ -2613,7 +2620,7 b' def matchany(ui, specs, repo=None):' | |||||
2613 | if len(specs) == 1: |
|
2620 | if len(specs) == 1: | |
2614 | tree = parse(specs[0], lookup) |
|
2621 | tree = parse(specs[0], lookup) | |
2615 | else: |
|
2622 | else: | |
2616 | tree = ('or',) + tuple(parse(s, lookup) for s in specs) |
|
2623 | tree = ('or', ('list',) + tuple(parse(s, lookup) for s in specs)) | |
2617 |
|
2624 | |||
2618 | if ui: |
|
2625 | if ui: | |
2619 | tree = expandaliases(ui, tree) |
|
2626 | tree = expandaliases(ui, tree) |
@@ -1455,12 +1455,13 b' glog always reorders nodes which explain' | |||||
1455 | (group |
|
1455 | (group | |
1456 | (group |
|
1456 | (group | |
1457 | (or |
|
1457 | (or | |
|
1458 | (list | |||
1458 | (func |
|
1459 | (func | |
1459 | ('symbol', 'user') |
|
1460 | ('symbol', 'user') | |
1460 | ('string', 'test')) |
|
1461 | ('string', 'test')) | |
1461 | (func |
|
1462 | (func | |
1462 | ('symbol', 'user') |
|
1463 | ('symbol', 'user') | |
1463 | ('string', 'not-a-user'))))) |
|
1464 | ('string', 'not-a-user')))))) | |
1464 | $ testlog -b not-a-branch |
|
1465 | $ testlog -b not-a-branch | |
1465 | abort: unknown revision 'not-a-branch'! |
|
1466 | abort: unknown revision 'not-a-branch'! | |
1466 | abort: unknown revision 'not-a-branch'! |
|
1467 | abort: unknown revision 'not-a-branch'! | |
@@ -1470,6 +1471,7 b' glog always reorders nodes which explain' | |||||
1470 | (group |
|
1471 | (group | |
1471 | (group |
|
1472 | (group | |
1472 | (or |
|
1473 | (or | |
|
1474 | (list | |||
1473 | (func |
|
1475 | (func | |
1474 | ('symbol', 'branch') |
|
1476 | ('symbol', 'branch') | |
1475 | ('string', 'default')) |
|
1477 | ('string', 'default')) | |
@@ -1478,18 +1480,19 b' glog always reorders nodes which explain' | |||||
1478 | ('string', 'branch')) |
|
1480 | ('string', 'branch')) | |
1479 | (func |
|
1481 | (func | |
1480 | ('symbol', 'branch') |
|
1482 | ('symbol', 'branch') | |
1481 | ('string', 'branch'))))) |
|
1483 | ('string', 'branch')))))) | |
1482 | $ testlog -k expand -k merge |
|
1484 | $ testlog -k expand -k merge | |
1483 | [] |
|
1485 | [] | |
1484 | (group |
|
1486 | (group | |
1485 | (group |
|
1487 | (group | |
1486 | (or |
|
1488 | (or | |
|
1489 | (list | |||
1487 | (func |
|
1490 | (func | |
1488 | ('symbol', 'keyword') |
|
1491 | ('symbol', 'keyword') | |
1489 | ('string', 'expand')) |
|
1492 | ('string', 'expand')) | |
1490 | (func |
|
1493 | (func | |
1491 | ('symbol', 'keyword') |
|
1494 | ('symbol', 'keyword') | |
1492 | ('string', 'merge'))))) |
|
1495 | ('string', 'merge')))))) | |
1493 | $ testlog --only-merges |
|
1496 | $ testlog --only-merges | |
1494 | [] |
|
1497 | [] | |
1495 | (group |
|
1498 | (group | |
@@ -1520,17 +1523,19 b' glog always reorders nodes which explain' | |||||
1520 | (not |
|
1523 | (not | |
1521 | (group |
|
1524 | (group | |
1522 | (or |
|
1525 | (or | |
|
1526 | (list | |||
1523 | ('string', '31') |
|
1527 | ('string', '31') | |
1524 | (func |
|
1528 | (func | |
1525 | ('symbol', 'ancestors') |
|
1529 | ('symbol', 'ancestors') | |
1526 | ('string', '31'))))) |
|
1530 | ('string', '31')))))) | |
1527 | (not |
|
1531 | (not | |
1528 | (group |
|
1532 | (group | |
1529 | (or |
|
1533 | (or | |
|
1534 | (list | |||
1530 | ('string', '32') |
|
1535 | ('string', '32') | |
1531 | (func |
|
1536 | (func | |
1532 | ('symbol', 'ancestors') |
|
1537 | ('symbol', 'ancestors') | |
1533 | ('string', '32')))))))) |
|
1538 | ('string', '32'))))))))) | |
1534 |
|
1539 | |||
1535 | Dedicated repo for --follow and paths filtering. The g is crafted to |
|
1540 | Dedicated repo for --follow and paths filtering. The g is crafted to | |
1536 | have 2 filelog topological heads in a linear changeset graph. |
|
1541 | have 2 filelog topological heads in a linear changeset graph. | |
@@ -1587,12 +1592,13 b' have 2 filelog topological heads in a li' | |||||
1587 | (group |
|
1592 | (group | |
1588 | (group |
|
1593 | (group | |
1589 | (or |
|
1594 | (or | |
|
1595 | (list | |||
1590 | (func |
|
1596 | (func | |
1591 | ('symbol', 'filelog') |
|
1597 | ('symbol', 'filelog') | |
1592 | ('string', 'a')) |
|
1598 | ('string', 'a')) | |
1593 | (func |
|
1599 | (func | |
1594 | ('symbol', 'filelog') |
|
1600 | ('symbol', 'filelog') | |
1595 | ('string', 'b'))))) |
|
1601 | ('string', 'b')))))) | |
1596 |
|
1602 | |||
1597 | Test falling back to slow path for non-existing files |
|
1603 | Test falling back to slow path for non-existing files | |
1598 |
|
1604 | |||
@@ -1744,12 +1750,13 b' Test --follow and multiple files' | |||||
1744 | (group |
|
1750 | (group | |
1745 | (group |
|
1751 | (group | |
1746 | (or |
|
1752 | (or | |
|
1753 | (list | |||
1747 | (func |
|
1754 | (func | |
1748 | ('symbol', 'follow') |
|
1755 | ('symbol', 'follow') | |
1749 | ('string', 'g')) |
|
1756 | ('string', 'g')) | |
1750 | (func |
|
1757 | (func | |
1751 | ('symbol', 'follow') |
|
1758 | ('symbol', 'follow') | |
1752 | ('string', 'e'))))) |
|
1759 | ('string', 'e')))))) | |
1753 | $ cat log.nodes |
|
1760 | $ cat log.nodes | |
1754 | nodetag 4 |
|
1761 | nodetag 4 | |
1755 | nodetag 3 |
|
1762 | nodetag 3 |
@@ -187,9 +187,10 b' trivial' | |||||
187 | 6 |
|
187 | 6 | |
188 | $ try '0|1|2' |
|
188 | $ try '0|1|2' | |
189 | (or |
|
189 | (or | |
|
190 | (list | |||
190 | ('symbol', '0') |
|
191 | ('symbol', '0') | |
191 | ('symbol', '1') |
|
192 | ('symbol', '1') | |
192 | ('symbol', '2')) |
|
193 | ('symbol', '2'))) | |
193 | * set: |
|
194 | * set: | |
194 | <baseset [0, 1, 2]> |
|
195 | <baseset [0, 1, 2]> | |
195 | 0 |
|
196 | 0 | |
@@ -339,10 +340,11 b' quoting needed' | |||||
339 | $ log '1&2' |
|
340 | $ log '1&2' | |
340 | $ try '1&2|3' # precedence - and is higher |
|
341 | $ try '1&2|3' # precedence - and is higher | |
341 | (or |
|
342 | (or | |
|
343 | (list | |||
342 | (and |
|
344 | (and | |
343 | ('symbol', '1') |
|
345 | ('symbol', '1') | |
344 | ('symbol', '2')) |
|
346 | ('symbol', '2')) | |
345 | ('symbol', '3')) |
|
347 | ('symbol', '3'))) | |
346 | * set: |
|
348 | * set: | |
347 | <addset |
|
349 | <addset | |
348 | <baseset []>, |
|
350 | <baseset []>, | |
@@ -350,10 +352,11 b' quoting needed' | |||||
350 | 3 |
|
352 | 3 | |
351 | $ try '1|2&3' |
|
353 | $ try '1|2&3' | |
352 | (or |
|
354 | (or | |
|
355 | (list | |||
353 | ('symbol', '1') |
|
356 | ('symbol', '1') | |
354 | (and |
|
357 | (and | |
355 | ('symbol', '2') |
|
358 | ('symbol', '2') | |
356 | ('symbol', '3'))) |
|
359 | ('symbol', '3')))) | |
357 | * set: |
|
360 | * set: | |
358 | <addset |
|
361 | <addset | |
359 | <baseset [1]>, |
|
362 | <baseset [1]>, | |
@@ -369,11 +372,13 b' quoting needed' | |||||
369 | <baseset []> |
|
372 | <baseset []> | |
370 | $ try '1|(2|3)' |
|
373 | $ try '1|(2|3)' | |
371 | (or |
|
374 | (or | |
|
375 | (list | |||
372 | ('symbol', '1') |
|
376 | ('symbol', '1') | |
373 | (group |
|
377 | (group | |
374 | (or |
|
378 | (or | |
|
379 | (list | |||
375 | ('symbol', '2') |
|
380 | ('symbol', '2') | |
376 | ('symbol', '3')))) |
|
381 | ('symbol', '3')))))) | |
377 | * set: |
|
382 | * set: | |
378 | <addset |
|
383 | <addset | |
379 | <baseset [1]>, |
|
384 | <baseset [1]>, | |
@@ -465,8 +470,9 b' keyword arguments' | |||||
465 | (keyvalue |
|
470 | (keyvalue | |
466 | ('symbol', 'foo') |
|
471 | ('symbol', 'foo') | |
467 | (or |
|
472 | (or | |
|
473 | (list | |||
468 | ('symbol', 'bar') |
|
474 | ('symbol', 'bar') | |
469 | ('symbol', 'baz'))) |
|
475 | ('symbol', 'baz')))) | |
470 | hg: parse error: can't use a key-value pair in this context |
|
476 | hg: parse error: can't use a key-value pair in this context | |
471 | [255] |
|
477 | [255] | |
472 |
|
478 | |||
@@ -528,14 +534,16 b' parsed tree at stages:' | |||||
528 | (minus |
|
534 | (minus | |
529 | (group |
|
535 | (group | |
530 | (or |
|
536 | (or | |
|
537 | (list | |||
531 | ('symbol', '0') |
|
538 | ('symbol', '0') | |
532 | ('symbol', '1'))) |
|
539 | ('symbol', '1')))) | |
533 | ('symbol', '1')) |
|
540 | ('symbol', '1')) | |
534 | * analyzed: |
|
541 | * analyzed: | |
535 | (and |
|
542 | (and | |
536 | (or |
|
543 | (or | |
|
544 | (list | |||
537 | ('symbol', '0') |
|
545 | ('symbol', '0') | |
538 | ('symbol', '1')) |
|
546 | ('symbol', '1'))) | |
539 | (not |
|
547 | (not | |
540 | ('symbol', '1'))) |
|
548 | ('symbol', '1'))) | |
541 | * optimized: |
|
549 | * optimized: | |
@@ -1242,9 +1250,10 b' ordering defined by it.' | |||||
1242 | ('symbol', '0')) |
|
1250 | ('symbol', '0')) | |
1243 | (group |
|
1251 | (group | |
1244 | (or |
|
1252 | (or | |
|
1253 | (list | |||
1245 | ('symbol', '0') |
|
1254 | ('symbol', '0') | |
1246 | ('symbol', '1') |
|
1255 | ('symbol', '1') | |
1247 | ('symbol', '2')))) |
|
1256 | ('symbol', '2'))))) | |
1248 | * optimized: |
|
1257 | * optimized: | |
1249 | (and |
|
1258 | (and | |
1250 | (range |
|
1259 | (range | |
@@ -1269,20 +1278,22 b' ordering defined by it.' | |||||
1269 | ('symbol', '0')) |
|
1278 | ('symbol', '0')) | |
1270 | (group |
|
1279 | (group | |
1271 | (or |
|
1280 | (or | |
|
1281 | (list | |||
1272 | (range |
|
1282 | (range | |
1273 | ('symbol', '0') |
|
1283 | ('symbol', '0') | |
1274 | ('symbol', '1')) |
|
1284 | ('symbol', '1')) | |
1275 | ('symbol', '2')))) |
|
1285 | ('symbol', '2'))))) | |
1276 | * optimized: |
|
1286 | * optimized: | |
1277 | (and |
|
1287 | (and | |
1278 | (range |
|
1288 | (range | |
1279 | ('symbol', '2') |
|
1289 | ('symbol', '2') | |
1280 | ('symbol', '0')) |
|
1290 | ('symbol', '0')) | |
1281 | (or |
|
1291 | (or | |
|
1292 | (list | |||
1282 | (range |
|
1293 | (range | |
1283 | ('symbol', '0') |
|
1294 | ('symbol', '0') | |
1284 | ('symbol', '1')) |
|
1295 | ('symbol', '1')) | |
1285 | ('symbol', '2'))) |
|
1296 | ('symbol', '2')))) | |
1286 | * set: |
|
1297 | * set: | |
1287 | <addset |
|
1298 | <addset | |
1288 | <filteredset |
|
1299 | <filteredset | |
@@ -1402,9 +1413,10 b' ordering defined by it.' | |||||
1402 | (func |
|
1413 | (func | |
1403 | ('symbol', 'present') |
|
1414 | ('symbol', 'present') | |
1404 | (or |
|
1415 | (or | |
|
1416 | (list | |||
1405 | ('symbol', '0') |
|
1417 | ('symbol', '0') | |
1406 | ('symbol', '1') |
|
1418 | ('symbol', '1') | |
1407 | ('symbol', '2')))) |
|
1419 | ('symbol', '2'))))) | |
1408 | * optimized: |
|
1420 | * optimized: | |
1409 | (and |
|
1421 | (and | |
1410 | (range |
|
1422 | (range | |
@@ -1499,9 +1511,10 b' ordering defined by it.' | |||||
1499 | (func |
|
1511 | (func | |
1500 | ('symbol', 'first') |
|
1512 | ('symbol', 'first') | |
1501 | (or |
|
1513 | (or | |
|
1514 | (list | |||
1502 | ('symbol', '1') |
|
1515 | ('symbol', '1') | |
1503 | ('symbol', '0') |
|
1516 | ('symbol', '0') | |
1504 | ('symbol', '2')))) |
|
1517 | ('symbol', '2'))))) | |
1505 | * optimized: |
|
1518 | * optimized: | |
1506 | (and |
|
1519 | (and | |
1507 | (range |
|
1520 | (range | |
@@ -1528,9 +1541,10 b' ordering defined by it.' | |||||
1528 | (func |
|
1541 | (func | |
1529 | ('symbol', 'last') |
|
1542 | ('symbol', 'last') | |
1530 | (or |
|
1543 | (or | |
|
1544 | (list | |||
1531 | ('symbol', '0') |
|
1545 | ('symbol', '0') | |
1532 | ('symbol', '2') |
|
1546 | ('symbol', '2') | |
1533 | ('symbol', '1'))))) |
|
1547 | ('symbol', '1')))))) | |
1534 | * optimized: |
|
1548 | * optimized: | |
1535 | (difference |
|
1549 | (difference | |
1536 | (range |
|
1550 | (range | |
@@ -1562,14 +1576,16 b' ordering defined by it.' | |||||
1562 | (range |
|
1576 | (range | |
1563 | (group |
|
1577 | (group | |
1564 | (or |
|
1578 | (or | |
|
1579 | (list | |||
1565 | ('symbol', '1') |
|
1580 | ('symbol', '1') | |
1566 | ('symbol', '0') |
|
1581 | ('symbol', '0') | |
1567 | ('symbol', '2'))) |
|
1582 | ('symbol', '2')))) | |
1568 | (group |
|
1583 | (group | |
1569 | (or |
|
1584 | (or | |
|
1585 | (list | |||
1570 | ('symbol', '0') |
|
1586 | ('symbol', '0') | |
1571 | ('symbol', '2') |
|
1587 | ('symbol', '2') | |
1572 | ('symbol', '1'))))) |
|
1588 | ('symbol', '1')))))) | |
1573 | * optimized: |
|
1589 | * optimized: | |
1574 | (and |
|
1590 | (and | |
1575 | (range |
|
1591 | (range | |
@@ -1599,9 +1615,10 b' ordering defined by it.' | |||||
1599 | ('string', 'glob:*')) |
|
1615 | ('string', 'glob:*')) | |
1600 | (group |
|
1616 | (group | |
1601 | (or |
|
1617 | (or | |
|
1618 | (list | |||
1602 | ('symbol', '2') |
|
1619 | ('symbol', '2') | |
1603 | ('symbol', '0') |
|
1620 | ('symbol', '0') | |
1604 | ('symbol', '1')))) |
|
1621 | ('symbol', '1'))))) | |
1605 | * optimized: |
|
1622 | * optimized: | |
1606 | (and |
|
1623 | (and | |
1607 | (func |
|
1624 | (func | |
@@ -1628,9 +1645,10 b' ordering defined by it.' | |||||
1628 | ('string', 'glob:*'))) |
|
1645 | ('string', 'glob:*'))) | |
1629 | (group |
|
1646 | (group | |
1630 | (or |
|
1647 | (or | |
|
1648 | (list | |||
1631 | ('symbol', '0') |
|
1649 | ('symbol', '0') | |
1632 | ('symbol', '2') |
|
1650 | ('symbol', '2') | |
1633 | ('symbol', '1')))) |
|
1651 | ('symbol', '1'))))) | |
1634 | * optimized: |
|
1652 | * optimized: | |
1635 | (and |
|
1653 | (and | |
1636 | (func |
|
1654 | (func | |
@@ -1975,6 +1993,7 b' test that `or` operation skips duplicate' | |||||
1975 |
|
1993 | |||
1976 | $ try 'reverse(1::5) or ancestors(4)' |
|
1994 | $ try 'reverse(1::5) or ancestors(4)' | |
1977 | (or |
|
1995 | (or | |
|
1996 | (list | |||
1978 | (func |
|
1997 | (func | |
1979 | ('symbol', 'reverse') |
|
1998 | ('symbol', 'reverse') | |
1980 | (dagrange |
|
1999 | (dagrange | |
@@ -1982,7 +2001,7 b' test that `or` operation skips duplicate' | |||||
1982 | ('symbol', '5'))) |
|
2001 | ('symbol', '5'))) | |
1983 | (func |
|
2002 | (func | |
1984 | ('symbol', 'ancestors') |
|
2003 | ('symbol', 'ancestors') | |
1985 | ('symbol', '4'))) |
|
2004 | ('symbol', '4')))) | |
1986 | * set: |
|
2005 | * set: | |
1987 | <addset |
|
2006 | <addset | |
1988 | <baseset- [1, 3, 5]>, |
|
2007 | <baseset- [1, 3, 5]>, | |
@@ -1997,6 +2016,7 b' test that `or` operation skips duplicate' | |||||
1997 | (func |
|
2016 | (func | |
1998 | ('symbol', 'sort') |
|
2017 | ('symbol', 'sort') | |
1999 | (or |
|
2018 | (or | |
|
2019 | (list | |||
2000 | (func |
|
2020 | (func | |
2001 | ('symbol', 'ancestors') |
|
2021 | ('symbol', 'ancestors') | |
2002 | ('symbol', '4')) |
|
2022 | ('symbol', '4')) | |
@@ -2004,7 +2024,7 b' test that `or` operation skips duplicate' | |||||
2004 | ('symbol', 'reverse') |
|
2024 | ('symbol', 'reverse') | |
2005 | (dagrange |
|
2025 | (dagrange | |
2006 | ('symbol', '1') |
|
2026 | ('symbol', '1') | |
2007 | ('symbol', '5'))))) |
|
2027 | ('symbol', '5')))))) | |
2008 | * set: |
|
2028 | * set: | |
2009 | <addset+ |
|
2029 | <addset+ | |
2010 | <generatorset+>, |
|
2030 | <generatorset+>, | |
@@ -2020,6 +2040,7 b' test optimization of trivial `or` operat' | |||||
2020 |
|
2040 | |||
2021 | $ try --optimize '0|(1)|"2"|-2|tip|null' |
|
2041 | $ try --optimize '0|(1)|"2"|-2|tip|null' | |
2022 | (or |
|
2042 | (or | |
|
2043 | (list | |||
2023 | ('symbol', '0') |
|
2044 | ('symbol', '0') | |
2024 | (group |
|
2045 | (group | |
2025 | ('symbol', '1')) |
|
2046 | ('symbol', '1')) | |
@@ -2027,7 +2048,7 b' test optimization of trivial `or` operat' | |||||
2027 | (negate |
|
2048 | (negate | |
2028 | ('symbol', '2')) |
|
2049 | ('symbol', '2')) | |
2029 | ('symbol', 'tip') |
|
2050 | ('symbol', 'tip') | |
2030 | ('symbol', 'null')) |
|
2051 | ('symbol', 'null'))) | |
2031 | * optimized: |
|
2052 | * optimized: | |
2032 | (func |
|
2053 | (func | |
2033 | ('symbol', '_list') |
|
2054 | ('symbol', '_list') | |
@@ -2043,19 +2064,21 b' test optimization of trivial `or` operat' | |||||
2043 |
|
2064 | |||
2044 | $ try --optimize '0|1|2:3' |
|
2065 | $ try --optimize '0|1|2:3' | |
2045 | (or |
|
2066 | (or | |
|
2067 | (list | |||
2046 | ('symbol', '0') |
|
2068 | ('symbol', '0') | |
2047 | ('symbol', '1') |
|
2069 | ('symbol', '1') | |
2048 | (range |
|
2070 | (range | |
2049 | ('symbol', '2') |
|
2071 | ('symbol', '2') | |
2050 | ('symbol', '3'))) |
|
2072 | ('symbol', '3')))) | |
2051 | * optimized: |
|
2073 | * optimized: | |
2052 | (or |
|
2074 | (or | |
|
2075 | (list | |||
2053 | (func |
|
2076 | (func | |
2054 | ('symbol', '_list') |
|
2077 | ('symbol', '_list') | |
2055 | ('string', '0\x001')) |
|
2078 | ('string', '0\x001')) | |
2056 | (range |
|
2079 | (range | |
2057 | ('symbol', '2') |
|
2080 | ('symbol', '2') | |
2058 | ('symbol', '3'))) |
|
2081 | ('symbol', '3')))) | |
2059 | * set: |
|
2082 | * set: | |
2060 | <addset |
|
2083 | <addset | |
2061 | <baseset [0, 1]>, |
|
2084 | <baseset [0, 1]>, | |
@@ -2067,6 +2090,7 b' test optimization of trivial `or` operat' | |||||
2067 |
|
2090 | |||
2068 | $ try --optimize '0:1|2|3:4|5|6' |
|
2091 | $ try --optimize '0:1|2|3:4|5|6' | |
2069 | (or |
|
2092 | (or | |
|
2093 | (list | |||
2070 | (range |
|
2094 | (range | |
2071 | ('symbol', '0') |
|
2095 | ('symbol', '0') | |
2072 | ('symbol', '1')) |
|
2096 | ('symbol', '1')) | |
@@ -2075,9 +2099,10 b' test optimization of trivial `or` operat' | |||||
2075 | ('symbol', '3') |
|
2099 | ('symbol', '3') | |
2076 | ('symbol', '4')) |
|
2100 | ('symbol', '4')) | |
2077 | ('symbol', '5') |
|
2101 | ('symbol', '5') | |
2078 | ('symbol', '6')) |
|
2102 | ('symbol', '6'))) | |
2079 | * optimized: |
|
2103 | * optimized: | |
2080 | (or |
|
2104 | (or | |
|
2105 | (list | |||
2081 | (range |
|
2106 | (range | |
2082 | ('symbol', '0') |
|
2107 | ('symbol', '0') | |
2083 | ('symbol', '1')) |
|
2108 | ('symbol', '1')) | |
@@ -2087,7 +2112,7 b' test optimization of trivial `or` operat' | |||||
2087 | ('symbol', '4')) |
|
2112 | ('symbol', '4')) | |
2088 | (func |
|
2113 | (func | |
2089 | ('symbol', '_list') |
|
2114 | ('symbol', '_list') | |
2090 | ('string', '5\x006'))) |
|
2115 | ('string', '5\x006')))) | |
2091 | * set: |
|
2116 | * set: | |
2092 | <addset |
|
2117 | <addset | |
2093 | <addset |
|
2118 | <addset | |
@@ -2109,11 +2134,12 b' unoptimized `or` looks like this' | |||||
2109 | $ try --no-optimized -p analyzed '0|1|2|3|4' |
|
2134 | $ try --no-optimized -p analyzed '0|1|2|3|4' | |
2110 | * analyzed: |
|
2135 | * analyzed: | |
2111 | (or |
|
2136 | (or | |
|
2137 | (list | |||
2112 | ('symbol', '0') |
|
2138 | ('symbol', '0') | |
2113 | ('symbol', '1') |
|
2139 | ('symbol', '1') | |
2114 | ('symbol', '2') |
|
2140 | ('symbol', '2') | |
2115 | ('symbol', '3') |
|
2141 | ('symbol', '3') | |
2116 | ('symbol', '4')) |
|
2142 | ('symbol', '4'))) | |
2117 | * set: |
|
2143 | * set: | |
2118 | <addset |
|
2144 | <addset | |
2119 | <addset |
|
2145 | <addset | |
@@ -2188,6 +2214,7 b' test that chained `or` operations make b' | |||||
2188 |
|
2214 | |||
2189 | $ try '0:1|1:2|2:3|3:4|4:5' |
|
2215 | $ try '0:1|1:2|2:3|3:4|4:5' | |
2190 | (or |
|
2216 | (or | |
|
2217 | (list | |||
2191 | (range |
|
2218 | (range | |
2192 | ('symbol', '0') |
|
2219 | ('symbol', '0') | |
2193 | ('symbol', '1')) |
|
2220 | ('symbol', '1')) | |
@@ -2202,7 +2229,7 b' test that chained `or` operations make b' | |||||
2202 | ('symbol', '4')) |
|
2229 | ('symbol', '4')) | |
2203 | (range |
|
2230 | (range | |
2204 | ('symbol', '4') |
|
2231 | ('symbol', '4') | |
2205 | ('symbol', '5'))) |
|
2232 | ('symbol', '5')))) | |
2206 | * set: |
|
2233 | * set: | |
2207 | <addset |
|
2234 | <addset | |
2208 | <addset |
|
2235 | <addset | |
@@ -2224,13 +2251,15 b' no crash by empty group "()" while optim' | |||||
2224 |
|
2251 | |||
2225 | $ try --optimize '0|()' |
|
2252 | $ try --optimize '0|()' | |
2226 | (or |
|
2253 | (or | |
|
2254 | (list | |||
2227 | ('symbol', '0') |
|
2255 | ('symbol', '0') | |
2228 | (group |
|
2256 | (group | |
2229 | None)) |
|
2257 | None))) | |
2230 | * optimized: |
|
2258 | * optimized: | |
2231 | (or |
|
2259 | (or | |
|
2260 | (list | |||
2232 | ('symbol', '0') |
|
2261 | ('symbol', '0') | |
2233 | None) |
|
2262 | None)) | |
2234 | hg: parse error: missing argument |
|
2263 | hg: parse error: missing argument | |
2235 | [255] |
|
2264 | [255] | |
2236 |
|
2265 | |||
@@ -2715,10 +2744,12 b' test infinite recursion' | |||||
2715 | ('symbol', '3'))) |
|
2744 | ('symbol', '3'))) | |
2716 | * expanded: |
|
2745 | * expanded: | |
2717 | (or |
|
2746 | (or | |
|
2747 | (list | |||
2718 | ('symbol', '3') |
|
2748 | ('symbol', '3') | |
2719 | (or |
|
2749 | (or | |
|
2750 | (list | |||
2720 | ('symbol', '1') |
|
2751 | ('symbol', '1') | |
2721 | ('symbol', '2'))) |
|
2752 | ('symbol', '2'))))) | |
2722 | * set: |
|
2753 | * set: | |
2723 | <addset |
|
2754 | <addset | |
2724 | <baseset [3]>, |
|
2755 | <baseset [3]>, | |
@@ -2769,6 +2800,7 b' test chained `or` operations are flatten' | |||||
2769 | ('symbol', '3')))) |
|
2800 | ('symbol', '3')))) | |
2770 | * expanded: |
|
2801 | * expanded: | |
2771 | (or |
|
2802 | (or | |
|
2803 | (list | |||
2772 | (range |
|
2804 | (range | |
2773 | ('symbol', '0') |
|
2805 | ('symbol', '0') | |
2774 | ('symbol', '1')) |
|
2806 | ('symbol', '1')) | |
@@ -2777,7 +2809,7 b' test chained `or` operations are flatten' | |||||
2777 | ('symbol', '2')) |
|
2809 | ('symbol', '2')) | |
2778 | (range |
|
2810 | (range | |
2779 | ('symbol', '2') |
|
2811 | ('symbol', '2') | |
2780 | ('symbol', '3'))) |
|
2812 | ('symbol', '3')))) | |
2781 | * set: |
|
2813 | * set: | |
2782 | <addset |
|
2814 | <addset | |
2783 | <spanset+ 0:1>, |
|
2815 | <spanset+ 0:1>, | |
@@ -2868,10 +2900,11 b' test unknown reference:' | |||||
2868 | ('symbol', 'tip'))) |
|
2900 | ('symbol', 'tip'))) | |
2869 | * expanded: |
|
2901 | * expanded: | |
2870 | (or |
|
2902 | (or | |
|
2903 | (list | |||
2871 | ('symbol', 'tip') |
|
2904 | ('symbol', 'tip') | |
2872 | (func |
|
2905 | (func | |
2873 | ('symbol', 'desc') |
|
2906 | ('symbol', 'desc') | |
2874 | ('string', '$1'))) |
|
2907 | ('string', '$1')))) | |
2875 | * set: |
|
2908 | * set: | |
2876 | <addset |
|
2909 | <addset | |
2877 | <baseset [9]>, |
|
2910 | <baseset [9]>, | |
@@ -2907,8 +2940,9 b' test unknown reference:' | |||||
2907 | ('symbol', 'rs') |
|
2940 | ('symbol', 'rs') | |
2908 | (list |
|
2941 | (list | |
2909 | (or |
|
2942 | (or | |
|
2943 | (list | |||
2910 | ('symbol', '2') |
|
2944 | ('symbol', '2') | |
2911 | ('symbol', '3')) |
|
2945 | ('symbol', '3'))) | |
2912 | ('symbol', 'date'))) |
|
2946 | ('symbol', 'date'))) | |
2913 | * expanded: |
|
2947 | * expanded: | |
2914 | (func |
|
2948 | (func | |
@@ -2917,8 +2951,9 b' test unknown reference:' | |||||
2917 | ('symbol', 'sort') |
|
2951 | ('symbol', 'sort') | |
2918 | (list |
|
2952 | (list | |
2919 | (or |
|
2953 | (or | |
|
2954 | (list | |||
2920 | ('symbol', '2') |
|
2955 | ('symbol', '2') | |
2921 | ('symbol', '3')) |
|
2956 | ('symbol', '3'))) | |
2922 | ('symbol', 'date')))) |
|
2957 | ('symbol', 'date')))) | |
2923 | * set: |
|
2958 | * set: | |
2924 | <baseset [3, 2]> |
|
2959 | <baseset [3, 2]> | |
@@ -2950,8 +2985,9 b' test unknown reference:' | |||||
2950 | ('symbol', 'rs4') |
|
2985 | ('symbol', 'rs4') | |
2951 | (list |
|
2986 | (list | |
2952 | (or |
|
2987 | (or | |
|
2988 | (list | |||
2953 | ('symbol', '2') |
|
2989 | ('symbol', '2') | |
2954 | ('symbol', '3')) |
|
2990 | ('symbol', '3'))) | |
2955 | ('symbol', 'x') |
|
2991 | ('symbol', 'x') | |
2956 | ('symbol', 'x') |
|
2992 | ('symbol', 'x') | |
2957 | ('symbol', 'date'))) |
|
2993 | ('symbol', 'date'))) | |
@@ -2962,8 +2998,9 b' test unknown reference:' | |||||
2962 | ('symbol', 'sort') |
|
2998 | ('symbol', 'sort') | |
2963 | (list |
|
2999 | (list | |
2964 | (or |
|
3000 | (or | |
|
3001 | (list | |||
2965 | ('symbol', '2') |
|
3002 | ('symbol', '2') | |
2966 | ('symbol', '3')) |
|
3003 | ('symbol', '3'))) | |
2967 | ('symbol', 'date')))) |
|
3004 | ('symbol', 'date')))) | |
2968 | * set: |
|
3005 | * set: | |
2969 | <baseset [3, 2]> |
|
3006 | <baseset [3, 2]> | |
@@ -3034,9 +3071,10 b' issue2549 - correct optimizations' | |||||
3034 | ('symbol', 'limit') |
|
3071 | ('symbol', 'limit') | |
3035 | (list |
|
3072 | (list | |
3036 | (or |
|
3073 | (or | |
|
3074 | (list | |||
3037 | ('symbol', '1') |
|
3075 | ('symbol', '1') | |
3038 | ('symbol', '2') |
|
3076 | ('symbol', '2') | |
3039 | ('symbol', '3')) |
|
3077 | ('symbol', '3'))) | |
3040 | ('symbol', '2'))) |
|
3078 | ('symbol', '2'))) | |
3041 | (not |
|
3079 | (not | |
3042 | ('symbol', '2'))) |
|
3080 | ('symbol', '2'))) | |
@@ -3054,8 +3092,9 b' issue2549 - correct optimizations' | |||||
3054 | (func |
|
3092 | (func | |
3055 | ('symbol', 'max') |
|
3093 | ('symbol', 'max') | |
3056 | (or |
|
3094 | (or | |
|
3095 | (list | |||
3057 | ('symbol', '1') |
|
3096 | ('symbol', '1') | |
3058 | ('symbol', '2'))) |
|
3097 | ('symbol', '2')))) | |
3059 | (not |
|
3098 | (not | |
3060 | ('symbol', '2'))) |
|
3099 | ('symbol', '2'))) | |
3061 | * set: |
|
3100 | * set: | |
@@ -3071,8 +3110,9 b' issue2549 - correct optimizations' | |||||
3071 | (func |
|
3110 | (func | |
3072 | ('symbol', 'min') |
|
3111 | ('symbol', 'min') | |
3073 | (or |
|
3112 | (or | |
|
3113 | (list | |||
3074 | ('symbol', '1') |
|
3114 | ('symbol', '1') | |
3075 | ('symbol', '2'))) |
|
3115 | ('symbol', '2')))) | |
3076 | (not |
|
3116 | (not | |
3077 | ('symbol', '1'))) |
|
3117 | ('symbol', '1'))) | |
3078 | * set: |
|
3118 | * set: | |
@@ -3089,8 +3129,9 b' issue2549 - correct optimizations' | |||||
3089 | ('symbol', 'last') |
|
3129 | ('symbol', 'last') | |
3090 | (list |
|
3130 | (list | |
3091 | (or |
|
3131 | (or | |
|
3132 | (list | |||
3092 | ('symbol', '1') |
|
3133 | ('symbol', '1') | |
3093 | ('symbol', '2')) |
|
3134 | ('symbol', '2'))) | |
3094 | ('symbol', '1'))) |
|
3135 | ('symbol', '1'))) | |
3095 | (not |
|
3136 | (not | |
3096 | ('symbol', '2'))) |
|
3137 | ('symbol', '2'))) |
General Comments 0
You need to be logged in to leave comments.
Login now