##// END OF EJS Templates
test-glog: drop uninteresting nodes from AST output...
Yuya Nishihara -
r35568:99a25bde default
parent child Browse files
Show More
@@ -102,6 +102,7 b' o (0) root'
102 > expr = logrevset(repo, pats, opts)
102 > expr = logrevset(repo, pats, opts)
103 > if expr:
103 > if expr:
104 > tree = revsetlang.parse(expr)
104 > tree = revsetlang.parse(expr)
105 > tree = revsetlang.analyze(tree)
105 > else:
106 > else:
106 > tree = []
107 > tree = []
107 > ui.write('%r\n' % (opts.get('rev', []),))
108 > ui.write('%r\n' % (opts.get('rev', []),))
@@ -1465,8 +1466,6 b' glog always reorders nodes which explain'
1465 +nodetag 21
1466 +nodetag 21
1466 $ testlog -u test -u not-a-user
1467 $ testlog -u test -u not-a-user
1467 []
1468 []
1468 (group
1469 (group
1470 (or
1469 (or
1471 (list
1470 (list
1472 (func
1471 (func
@@ -1474,15 +1473,13 b' glog always reorders nodes which explain'
1474 (string 'test'))
1473 (string 'test'))
1475 (func
1474 (func
1476 (symbol 'user')
1475 (symbol 'user')
1477 (string 'not-a-user'))))))
1476 (string 'not-a-user'))))
1478 $ testlog -b not-a-branch
1477 $ testlog -b not-a-branch
1479 abort: unknown revision 'not-a-branch'!
1478 abort: unknown revision 'not-a-branch'!
1480 abort: unknown revision 'not-a-branch'!
1479 abort: unknown revision 'not-a-branch'!
1481 abort: unknown revision 'not-a-branch'!
1480 abort: unknown revision 'not-a-branch'!
1482 $ testlog -b 35 -b 36 --only-branch branch
1481 $ testlog -b 35 -b 36 --only-branch branch
1483 []
1482 []
1484 (group
1485 (group
1486 (or
1483 (or
1487 (list
1484 (list
1488 (func
1485 (func
@@ -1493,11 +1490,9 b' glog always reorders nodes which explain'
1493 (string 'branch'))
1490 (string 'branch'))
1494 (func
1491 (func
1495 (symbol 'branch')
1492 (symbol 'branch')
1496 (string 'branch'))))))
1493 (string 'branch'))))
1497 $ testlog -k expand -k merge
1494 $ testlog -k expand -k merge
1498 []
1495 []
1499 (group
1500 (group
1501 (or
1496 (or
1502 (list
1497 (list
1503 (func
1498 (func
@@ -1505,50 +1500,43 b' glog always reorders nodes which explain'
1505 (string 'expand'))
1500 (string 'expand'))
1506 (func
1501 (func
1507 (symbol 'keyword')
1502 (symbol 'keyword')
1508 (string 'merge'))))))
1503 (string 'merge'))))
1509 $ testlog --only-merges
1504 $ testlog --only-merges
1510 []
1505 []
1511 (group
1506 (func
1507 (symbol 'merge')
1508 None)
1509 $ testlog --no-merges
1510 []
1511 (not
1512 (func
1512 (func
1513 (symbol 'merge')
1513 (symbol 'merge')
1514 None))
1514 None))
1515 $ testlog --no-merges
1516 []
1517 (group
1518 (not
1519 (func
1520 (symbol 'merge')
1521 None)))
1522 $ testlog --date '2 0 to 4 0'
1515 $ testlog --date '2 0 to 4 0'
1523 []
1516 []
1524 (group
1525 (func
1517 (func
1526 (symbol 'date')
1518 (symbol 'date')
1527 (string '2 0 to 4 0')))
1519 (string '2 0 to 4 0'))
1528 $ hg log -G -d 'brace ) in a date'
1520 $ hg log -G -d 'brace ) in a date'
1529 hg: parse error: invalid date: 'brace ) in a date'
1521 hg: parse error: invalid date: 'brace ) in a date'
1530 [255]
1522 [255]
1531 $ testlog --prune 31 --prune 32
1523 $ testlog --prune 31 --prune 32
1532 []
1524 []
1533 (group
1534 (group
1535 (and
1525 (and
1536 (not
1526 (not
1537 (group
1538 (or
1527 (or
1539 (list
1528 (list
1540 (string '31')
1529 (string '31')
1541 (func
1530 (func
1542 (symbol 'ancestors')
1531 (symbol 'ancestors')
1543 (string '31'))))))
1532 (string '31')))))
1544 (not
1533 (not
1545 (group
1546 (or
1534 (or
1547 (list
1535 (list
1548 (string '32')
1536 (string '32')
1549 (func
1537 (func
1550 (symbol 'ancestors')
1538 (symbol 'ancestors')
1551 (string '32')))))))))
1539 (string '32'))))))
1552
1540
1553 Dedicated repo for --follow and paths filtering. The g is crafted to
1541 Dedicated repo for --follow and paths filtering. The g is crafted to
1554 have 2 filelog topological heads in a linear changeset graph.
1542 have 2 filelog topological heads in a linear changeset graph.
@@ -1595,15 +1583,11 b' have 2 filelog topological heads in a li'
1595
1583
1596 $ testlog a
1584 $ testlog a
1597 []
1585 []
1598 (group
1599 (group
1600 (func
1586 (func
1601 (symbol 'filelog')
1587 (symbol 'filelog')
1602 (string 'a'))))
1588 (string 'a'))
1603 $ testlog a b
1589 $ testlog a b
1604 []
1590 []
1605 (group
1606 (group
1607 (or
1591 (or
1608 (list
1592 (list
1609 (func
1593 (func
@@ -1611,26 +1595,24 b' have 2 filelog topological heads in a li'
1611 (string 'a'))
1595 (string 'a'))
1612 (func
1596 (func
1613 (symbol 'filelog')
1597 (symbol 'filelog')
1614 (string 'b'))))))
1598 (string 'b'))))
1615
1599
1616 Test falling back to slow path for non-existing files
1600 Test falling back to slow path for non-existing files
1617
1601
1618 $ testlog a c
1602 $ testlog a c
1619 []
1603 []
1620 (group
1621 (func
1604 (func
1622 (symbol '_matchfiles')
1605 (symbol '_matchfiles')
1623 (list
1606 (list
1624 (string 'r:')
1607 (string 'r:')
1625 (string 'd:relpath')
1608 (string 'd:relpath')
1626 (string 'p:a')
1609 (string 'p:a')
1627 (string 'p:c'))))
1610 (string 'p:c')))
1628
1611
1629 Test multiple --include/--exclude/paths
1612 Test multiple --include/--exclude/paths
1630
1613
1631 $ testlog --include a --include e --exclude b --exclude e a e
1614 $ testlog --include a --include e --exclude b --exclude e a e
1632 []
1615 []
1633 (group
1634 (func
1616 (func
1635 (symbol '_matchfiles')
1617 (symbol '_matchfiles')
1636 (list
1618 (list
@@ -1641,7 +1623,7 b' Test multiple --include/--exclude/paths'
1641 (string 'i:a')
1623 (string 'i:a')
1642 (string 'i:e')
1624 (string 'i:e')
1643 (string 'x:b')
1625 (string 'x:b')
1644 (string 'x:e'))))
1626 (string 'x:e')))
1645
1627
1646 Test glob expansion of pats
1628 Test glob expansion of pats
1647
1629
@@ -1653,11 +1635,9 b' Test glob expansion of pats'
1653 > testlog a*;
1635 > testlog a*;
1654 > fi;
1636 > fi;
1655 []
1637 []
1656 (group
1657 (group
1658 (func
1638 (func
1659 (symbol 'filelog')
1639 (symbol 'filelog')
1660 (string 'aa'))))
1640 (string 'aa'))
1661
1641
1662 Test --follow on a non-existent directory
1642 Test --follow on a non-existent directory
1663
1643
@@ -1671,7 +1651,6 b' Test --follow on a directory'
1671 $ hg up -q '.^'
1651 $ hg up -q '.^'
1672 $ testlog -f dir
1652 $ testlog -f dir
1673 []
1653 []
1674 (group
1675 (and
1654 (and
1676 (func
1655 (func
1677 (symbol 'ancestors')
1656 (symbol 'ancestors')
@@ -1681,7 +1660,7 b' Test --follow on a directory'
1681 (list
1660 (list
1682 (string 'r:')
1661 (string 'r:')
1683 (string 'd:relpath')
1662 (string 'd:relpath')
1684 (string 'p:dir')))))
1663 (string 'p:dir'))))
1685 $ hg up -q tip
1664 $ hg up -q tip
1686
1665
1687 Test --follow on file not in parent revision
1666 Test --follow on file not in parent revision
@@ -1695,7 +1674,6 b' Test --follow and patterns'
1695
1674
1696 $ testlog -f 'glob:*'
1675 $ testlog -f 'glob:*'
1697 []
1676 []
1698 (group
1699 (and
1677 (and
1700 (func
1678 (func
1701 (symbol 'ancestors')
1679 (symbol 'ancestors')
@@ -1705,40 +1683,34 b' Test --follow and patterns'
1705 (list
1683 (list
1706 (string 'r:')
1684 (string 'r:')
1707 (string 'd:relpath')
1685 (string 'd:relpath')
1708 (string 'p:glob:*')))))
1686 (string 'p:glob:*'))))
1709
1687
1710 Test --follow on a single rename
1688 Test --follow on a single rename
1711
1689
1712 $ hg up -q 2
1690 $ hg up -q 2
1713 $ testlog -f a
1691 $ testlog -f a
1714 []
1692 []
1715 (group
1716 (group
1717 (func
1693 (func
1718 (symbol 'follow')
1694 (symbol 'follow')
1719 (string 'a'))))
1695 (string 'a'))
1720
1696
1721 Test --follow and multiple renames
1697 Test --follow and multiple renames
1722
1698
1723 $ hg up -q tip
1699 $ hg up -q tip
1724 $ testlog -f e
1700 $ testlog -f e
1725 []
1701 []
1726 (group
1727 (group
1728 (func
1702 (func
1729 (symbol 'follow')
1703 (symbol 'follow')
1730 (string 'e'))))
1704 (string 'e'))
1731
1705
1732 Test --follow and multiple filelog heads
1706 Test --follow and multiple filelog heads
1733
1707
1734 $ hg up -q 2
1708 $ hg up -q 2
1735 $ testlog -f g
1709 $ testlog -f g
1736 []
1710 []
1737 (group
1738 (group
1739 (func
1711 (func
1740 (symbol 'follow')
1712 (symbol 'follow')
1741 (string 'g'))))
1713 (string 'g'))
1742 $ cat log.nodes
1714 $ cat log.nodes
1743 nodetag 2
1715 nodetag 2
1744 nodetag 1
1716 nodetag 1
@@ -1746,11 +1718,9 b' Test --follow and multiple filelog heads'
1746 $ hg up -q tip
1718 $ hg up -q tip
1747 $ testlog -f g
1719 $ testlog -f g
1748 []
1720 []
1749 (group
1750 (group
1751 (func
1721 (func
1752 (symbol 'follow')
1722 (symbol 'follow')
1753 (string 'g'))))
1723 (string 'g'))
1754 $ cat log.nodes
1724 $ cat log.nodes
1755 nodetag 3
1725 nodetag 3
1756 nodetag 2
1726 nodetag 2
@@ -1760,8 +1730,6 b' Test --follow and multiple files'
1760
1730
1761 $ testlog -f g e
1731 $ testlog -f g e
1762 []
1732 []
1763 (group
1764 (group
1765 (or
1733 (or
1766 (list
1734 (list
1767 (func
1735 (func
@@ -1769,7 +1737,7 b' Test --follow and multiple files'
1769 (string 'g'))
1737 (string 'g'))
1770 (func
1738 (func
1771 (symbol 'follow')
1739 (symbol 'follow')
1772 (string 'e'))))))
1740 (string 'e'))))
1773 $ cat log.nodes
1741 $ cat log.nodes
1774 nodetag 4
1742 nodetag 4
1775 nodetag 3
1743 nodetag 3
@@ -1797,22 +1765,19 b' Test --follow-first'
1797 $ hg ci -m "merge 5 and 4"
1765 $ hg ci -m "merge 5 and 4"
1798 $ testlog --follow-first
1766 $ testlog --follow-first
1799 []
1767 []
1800 (group
1801 (func
1768 (func
1802 (symbol '_firstancestors')
1769 (symbol '_firstancestors')
1803 (func
1770 (func
1804 (symbol 'rev')
1771 (symbol 'rev')
1805 (symbol '6'))))
1772 (symbol '6')))
1806
1773
1807 Cannot compare with log --follow-first FILE as it never worked
1774 Cannot compare with log --follow-first FILE as it never worked
1808
1775
1809 $ hg log -G --print-revset --follow-first e
1776 $ hg log -G --print-revset --follow-first e
1810 []
1777 []
1811 (group
1812 (group
1813 (func
1778 (func
1814 (symbol '_followfirst')
1779 (symbol '_followfirst')
1815 (string 'e'))))
1780 (string 'e'))
1816 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1781 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1817 @ 6 merge 5 and 4
1782 @ 6 merge 5 and 4
1818 |\
1783 |\
@@ -1844,22 +1809,20 b' Test "set:..." and parent revision'
1844 $ hg up -q 4
1809 $ hg up -q 4
1845 $ testlog "set:copied()"
1810 $ testlog "set:copied()"
1846 []
1811 []
1847 (group
1848 (func
1812 (func
1849 (symbol '_matchfiles')
1813 (symbol '_matchfiles')
1850 (list
1814 (list
1851 (string 'r:')
1815 (string 'r:')
1852 (string 'd:relpath')
1816 (string 'd:relpath')
1853 (string 'p:set:copied()'))))
1817 (string 'p:set:copied()')))
1854 $ testlog --include "set:copied()"
1818 $ testlog --include "set:copied()"
1855 []
1819 []
1856 (group
1857 (func
1820 (func
1858 (symbol '_matchfiles')
1821 (symbol '_matchfiles')
1859 (list
1822 (list
1860 (string 'r:')
1823 (string 'r:')
1861 (string 'd:relpath')
1824 (string 'd:relpath')
1862 (string 'i:set:copied()'))))
1825 (string 'i:set:copied()')))
1863 $ testlog -r "sort(file('set:copied()'), -rev)"
1826 $ testlog -r "sort(file('set:copied()'), -rev)"
1864 ["sort(file('set:copied()'), -rev)"]
1827 ["sort(file('set:copied()'), -rev)"]
1865 []
1828 []
@@ -1871,16 +1834,14 b' Test --removed'
1871 []
1834 []
1872 $ testlog --removed a
1835 $ testlog --removed a
1873 []
1836 []
1874 (group
1875 (func
1837 (func
1876 (symbol '_matchfiles')
1838 (symbol '_matchfiles')
1877 (list
1839 (list
1878 (string 'r:')
1840 (string 'r:')
1879 (string 'd:relpath')
1841 (string 'd:relpath')
1880 (string 'p:a'))))
1842 (string 'p:a')))
1881 $ testlog --removed --follow a
1843 $ testlog --removed --follow a
1882 []
1844 []
1883 (group
1884 (and
1845 (and
1885 (func
1846 (func
1886 (symbol 'ancestors')
1847 (symbol 'ancestors')
@@ -1890,7 +1851,7 b' Test --removed'
1890 (list
1851 (list
1891 (string 'r:')
1852 (string 'r:')
1892 (string 'd:relpath')
1853 (string 'd:relpath')
1893 (string 'p:a')))))
1854 (string 'p:a'))))
1894
1855
1895 Test --patch and --stat with --follow and --follow-first
1856 Test --patch and --stat with --follow and --follow-first
1896
1857
@@ -2214,23 +2175,21 b' changessincelatesttag with no prior tag'
2214 +g
2175 +g
2215 $ testlog --follow -r6 -r8 -r5 -r7 -r4
2176 $ testlog --follow -r6 -r8 -r5 -r7 -r4
2216 ['6', '8', '5', '7', '4']
2177 ['6', '8', '5', '7', '4']
2217 (group
2218 (func
2178 (func
2219 (symbol 'descendants')
2179 (symbol 'descendants')
2220 (func
2180 (func
2221 (symbol 'rev')
2181 (symbol 'rev')
2222 (symbol '6'))))
2182 (symbol '6')))
2223
2183
2224 Test --follow-first and forward --rev
2184 Test --follow-first and forward --rev
2225
2185
2226 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4
2186 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4
2227 ['6', '8', '5', '7', '4']
2187 ['6', '8', '5', '7', '4']
2228 (group
2229 (func
2188 (func
2230 (symbol '_firstdescendants')
2189 (symbol '_firstdescendants')
2231 (func
2190 (func
2232 (symbol 'rev')
2191 (symbol 'rev')
2233 (symbol '6'))))
2192 (symbol '6')))
2234 --- log.nodes * (glob)
2193 --- log.nodes * (glob)
2235 +++ glog.nodes * (glob)
2194 +++ glog.nodes * (glob)
2236 @@ -1,3 +1,3 @@
2195 @@ -1,3 +1,3 @@
@@ -2243,23 +2202,21 b' Test --follow and backward --rev'
2243
2202
2244 $ testlog --follow -r6 -r5 -r7 -r8 -r4
2203 $ testlog --follow -r6 -r5 -r7 -r8 -r4
2245 ['6', '5', '7', '8', '4']
2204 ['6', '5', '7', '8', '4']
2246 (group
2247 (func
2205 (func
2248 (symbol 'ancestors')
2206 (symbol 'ancestors')
2249 (func
2207 (func
2250 (symbol 'rev')
2208 (symbol 'rev')
2251 (symbol '6'))))
2209 (symbol '6')))
2252
2210
2253 Test --follow-first and backward --rev
2211 Test --follow-first and backward --rev
2254
2212
2255 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4
2213 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4
2256 ['6', '5', '7', '8', '4']
2214 ['6', '5', '7', '8', '4']
2257 (group
2258 (func
2215 (func
2259 (symbol '_firstancestors')
2216 (symbol '_firstancestors')
2260 (func
2217 (func
2261 (symbol 'rev')
2218 (symbol 'rev')
2262 (symbol '6'))))
2219 (symbol '6')))
2263
2220
2264 Test --follow with --rev of graphlog extension
2221 Test --follow with --rev of graphlog extension
2265
2222
@@ -2275,27 +2232,22 b' Test subdir'
2275 $ cd dir
2232 $ cd dir
2276 $ testlog .
2233 $ testlog .
2277 []
2234 []
2278 (group
2279 (func
2235 (func
2280 (symbol '_matchfiles')
2236 (symbol '_matchfiles')
2281 (list
2237 (list
2282 (string 'r:')
2238 (string 'r:')
2283 (string 'd:relpath')
2239 (string 'd:relpath')
2284 (string 'p:.'))))
2240 (string 'p:.')))
2285 $ testlog ../b
2241 $ testlog ../b
2286 []
2242 []
2287 (group
2288 (group
2289 (func
2243 (func
2290 (symbol 'filelog')
2244 (symbol 'filelog')
2291 (string '../b'))))
2245 (string '../b'))
2292 $ testlog -f ../b
2246 $ testlog -f ../b
2293 []
2247 []
2294 (group
2295 (group
2296 (func
2248 (func
2297 (symbol 'follow')
2249 (symbol 'follow')
2298 (string 'b'))))
2250 (string 'b'))
2299 $ cd ..
2251 $ cd ..
2300
2252
2301 Test --hidden
2253 Test --hidden
General Comments 0
You need to be logged in to leave comments. Login now