comparison tests/test-revset.t @ 29943:80c86b9bb40b

revset: forward ordering requirement to argument of present() present() is special in that it returns the argument set with no modification, so the ordering requirement should be forwarded. We could make present() fix the order like orset(), but that would be silly because we know the extra filtering cost is unnecessary.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 01 Jun 2016 20:54:04 +0900
parents e34cd85dc5b1
children 5f56a3b9675e
comparison
equal deleted inserted replaced
29942:3664537386ab 29943:80c86b9bb40b
1483 <spanset- 0:2>, 1483 <spanset- 0:2>,
1484 <not 1484 <not
1485 <baseset [0, 1]>>> 1485 <baseset [0, 1]>>>
1486 2 1486 2
1487 1487
1488 'present()' should do nothing other than suppressing an error: 1488 because 'present()' does nothing other than suppressing an error, the
1489 ordering requirement should be forwarded to the nested expression
1490
1491 $ try -p optimized 'present(2 + 0 + 1)'
1492 * optimized:
1493 (func
1494 ('symbol', 'present')
1495 (func
1496 ('symbol', '_list')
1497 ('string', '2\x000\x001')
1498 define)
1499 define)
1500 * set:
1501 <baseset [2, 0, 1]>
1502 2
1503 0
1504 1
1489 1505
1490 $ try --optimize '2:0 & present(0 + 1 + 2)' 1506 $ try --optimize '2:0 & present(0 + 1 + 2)'
1491 (and 1507 (and
1492 (range 1508 (range
1493 ('symbol', '2') 1509 ('symbol', '2')
1508 (func 1524 (func
1509 ('symbol', 'present') 1525 ('symbol', 'present')
1510 (func 1526 (func
1511 ('symbol', '_list') 1527 ('symbol', '_list')
1512 ('string', '0\x001\x002') 1528 ('string', '0\x001\x002')
1513 define) 1529 follow)
1514 follow) 1530 follow)
1515 define) 1531 define)
1516 * set: 1532 * set:
1517 <baseset [0, 1, 2]> 1533 <filteredset
1518 0 1534 <spanset- 0:2>,
1519 1 1535 <baseset [0, 1, 2]>>
1520 2 1536 2
1521 BROKEN: should be '2 1 0' 1537 1
1538 0
1522 1539
1523 'reverse()' should take effect only if it is the outermost expression: 1540 'reverse()' should take effect only if it is the outermost expression:
1524 1541
1525 $ try --optimize '0:2 & reverse(all())' 1542 $ try --optimize '0:2 & reverse(all())'
1526 (and 1543 (and