##// END OF EJS Templates
test-glog: dump computed set...
Yuya Nishihara -
r35569:d984d9b3 default
parent child Browse files
Show More
@@ -88,6 +88,7 b' o (0) root'
88 > commands,
88 > commands,
89 > extensions,
89 > extensions,
90 > revsetlang,
90 > revsetlang,
91 > smartset,
91 > )
92 > )
92 >
93 >
93 > def logrevset(repo, pats, opts):
94 > def logrevset(repo, pats, opts):
@@ -99,6 +100,7 b' o (0) root'
99 > def uisetup(ui):
100 > def uisetup(ui):
100 > def printrevset(orig, ui, repo, *pats, **opts):
101 > def printrevset(orig, ui, repo, *pats, **opts):
101 > if opts.get('print_revset'):
102 > if opts.get('print_revset'):
103 > revs = cmdutil.getlogrevs(repo, pats, opts)[0]
102 > expr = logrevset(repo, pats, opts)
104 > expr = logrevset(repo, pats, opts)
103 > if expr:
105 > if expr:
104 > tree = revsetlang.parse(expr)
106 > tree = revsetlang.parse(expr)
@@ -107,6 +109,7 b' o (0) root'
107 > tree = []
109 > tree = []
108 > ui.write('%r\n' % (opts.get('rev', []),))
110 > ui.write('%r\n' % (opts.get('rev', []),))
109 > ui.write(revsetlang.prettyformat(tree) + '\n')
111 > ui.write(revsetlang.prettyformat(tree) + '\n')
112 > ui.write(smartset.prettyformat(revs) + '\n')
110 > return 0
113 > return 0
111 > return orig(ui, repo, *pats, **opts)
114 > return orig(ui, repo, *pats, **opts)
112 > entry = extensions.wrapcommand(commands.table, 'log', printrevset)
115 > entry = extensions.wrapcommand(commands.table, 'log', printrevset)
@@ -1452,6 +1455,7 b' glog always reorders nodes which explain'
1452 $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31
1455 $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31
1453 ['27', '25', '21', '34', '32', '31']
1456 ['27', '25', '21', '34', '32', '31']
1454 []
1457 []
1458 <baseset- [21, 25, 27, 31, 32, 34]>
1455 --- log.nodes * (glob)
1459 --- log.nodes * (glob)
1456 +++ glog.nodes * (glob)
1460 +++ glog.nodes * (glob)
1457 @@ -1,6 +1,6 @@
1461 @@ -1,6 +1,6 @@
@@ -1474,6 +1478,15 b' glog always reorders nodes which explain'
1474 (func
1478 (func
1475 (symbol 'user')
1479 (symbol 'user')
1476 (string 'not-a-user'))))
1480 (string 'not-a-user'))))
1481 <filteredset
1482 <spanset- 0:37>,
1483 <addset
1484 <filteredset
1485 <fullreposet+ 0:37>,
1486 <user 'test'>>,
1487 <filteredset
1488 <fullreposet+ 0:37>,
1489 <user 'not-a-user'>>>>
1477 $ testlog -b not-a-branch
1490 $ testlog -b not-a-branch
1478 abort: unknown revision 'not-a-branch'!
1491 abort: unknown revision 'not-a-branch'!
1479 abort: unknown revision 'not-a-branch'!
1492 abort: unknown revision 'not-a-branch'!
@@ -1491,6 +1504,19 b' glog always reorders nodes which explain'
1491 (func
1504 (func
1492 (symbol 'branch')
1505 (symbol 'branch')
1493 (string 'branch'))))
1506 (string 'branch'))))
1507 <filteredset
1508 <spanset- 0:37>,
1509 <addset
1510 <filteredset
1511 <fullreposet+ 0:37>,
1512 <branch 'default'>>,
1513 <addset
1514 <filteredset
1515 <fullreposet+ 0:37>,
1516 <branch 'branch'>>,
1517 <filteredset
1518 <fullreposet+ 0:37>,
1519 <branch 'branch'>>>>>
1494 $ testlog -k expand -k merge
1520 $ testlog -k expand -k merge
1495 []
1521 []
1496 (or
1522 (or
@@ -1501,22 +1527,43 b' glog always reorders nodes which explain'
1501 (func
1527 (func
1502 (symbol 'keyword')
1528 (symbol 'keyword')
1503 (string 'merge'))))
1529 (string 'merge'))))
1530 <filteredset
1531 <spanset- 0:37>,
1532 <addset
1533 <filteredset
1534 <fullreposet+ 0:37>,
1535 <keyword 'expand'>>,
1536 <filteredset
1537 <fullreposet+ 0:37>,
1538 <keyword 'merge'>>>>
1504 $ testlog --only-merges
1539 $ testlog --only-merges
1505 []
1540 []
1506 (func
1541 (func
1507 (symbol 'merge')
1542 (symbol 'merge')
1508 None)
1543 None)
1544 <filteredset
1545 <spanset- 0:37>,
1546 <merge>>
1509 $ testlog --no-merges
1547 $ testlog --no-merges
1510 []
1548 []
1511 (not
1549 (not
1512 (func
1550 (func
1513 (symbol 'merge')
1551 (symbol 'merge')
1514 None))
1552 None))
1553 <filteredset
1554 <spanset- 0:37>,
1555 <not
1556 <filteredset
1557 <spanset- 0:37>,
1558 <merge>>>>
1515 $ testlog --date '2 0 to 4 0'
1559 $ testlog --date '2 0 to 4 0'
1516 []
1560 []
1517 (func
1561 (func
1518 (symbol 'date')
1562 (symbol 'date')
1519 (string '2 0 to 4 0'))
1563 (string '2 0 to 4 0'))
1564 <filteredset
1565 <spanset- 0:37>,
1566 <date '2 0 to 4 0'>>
1520 $ hg log -G -d 'brace ) in a date'
1567 $ hg log -G -d 'brace ) in a date'
1521 hg: parse error: invalid date: 'brace ) in a date'
1568 hg: parse error: invalid date: 'brace ) in a date'
1522 [255]
1569 [255]
@@ -1537,6 +1584,21 b' glog always reorders nodes which explain'
1537 (func
1584 (func
1538 (symbol 'ancestors')
1585 (symbol 'ancestors')
1539 (string '32'))))))
1586 (string '32'))))))
1587 <filteredset
1588 <filteredset
1589 <spanset- 0:37>,
1590 <not
1591 <addset
1592 <baseset [31]>,
1593 <filteredset
1594 <spanset- 0:37>,
1595 <generatorsetdesc+>>>>>,
1596 <not
1597 <addset
1598 <baseset [32]>,
1599 <filteredset
1600 <spanset- 0:37>,
1601 <generatorsetdesc+>>>>>
1540
1602
1541 Dedicated repo for --follow and paths filtering. The g is crafted to
1603 Dedicated repo for --follow and paths filtering. The g is crafted to
1542 have 2 filelog topological heads in a linear changeset graph.
1604 have 2 filelog topological heads in a linear changeset graph.
@@ -1547,9 +1609,11 b' have 2 filelog topological heads in a li'
1547 $ testlog --follow
1609 $ testlog --follow
1548 []
1610 []
1549 []
1611 []
1612 <baseset []>
1550 $ testlog -rnull
1613 $ testlog -rnull
1551 ['null']
1614 ['null']
1552 []
1615 []
1616 <baseset [-1]>
1553 $ echo a > a
1617 $ echo a > a
1554 $ echo aa > aa
1618 $ echo aa > aa
1555 $ echo f > f
1619 $ echo f > f
@@ -1586,6 +1650,8 b' have 2 filelog topological heads in a li'
1586 (func
1650 (func
1587 (symbol 'filelog')
1651 (symbol 'filelog')
1588 (string 'a'))
1652 (string 'a'))
1653 <filteredset
1654 <spanset- 0:5>, set([0])>
1589 $ testlog a b
1655 $ testlog a b
1590 []
1656 []
1591 (or
1657 (or
@@ -1596,6 +1662,11 b' have 2 filelog topological heads in a li'
1596 (func
1662 (func
1597 (symbol 'filelog')
1663 (symbol 'filelog')
1598 (string 'b'))))
1664 (string 'b'))))
1665 <filteredset
1666 <spanset- 0:5>,
1667 <addset
1668 <baseset+ [0]>,
1669 <baseset+ [1]>>>
1599
1670
1600 Test falling back to slow path for non-existing files
1671 Test falling back to slow path for non-existing files
1601
1672
@@ -1608,6 +1679,9 b' Test falling back to slow path for non-e'
1608 (string 'd:relpath')
1679 (string 'd:relpath')
1609 (string 'p:a')
1680 (string 'p:a')
1610 (string 'p:c')))
1681 (string 'p:c')))
1682 <filteredset
1683 <spanset- 0:5>,
1684 <matchfiles patterns=['a', 'c'], include=[] exclude=[], default='relpath', rev=None>>
1611
1685
1612 Test multiple --include/--exclude/paths
1686 Test multiple --include/--exclude/paths
1613
1687
@@ -1624,6 +1698,9 b' Test multiple --include/--exclude/paths'
1624 (string 'i:e')
1698 (string 'i:e')
1625 (string 'x:b')
1699 (string 'x:b')
1626 (string 'x:e')))
1700 (string 'x:e')))
1701 <filteredset
1702 <spanset- 0:5>,
1703 <matchfiles patterns=['a', 'e'], include=['a', 'e'] exclude=['b', 'e'], default='relpath', rev=None>>
1627
1704
1628 Test glob expansion of pats
1705 Test glob expansion of pats
1629
1706
@@ -1638,6 +1715,8 b' Test glob expansion of pats'
1638 (func
1715 (func
1639 (symbol 'filelog')
1716 (symbol 'filelog')
1640 (string 'aa'))
1717 (string 'aa'))
1718 <filteredset
1719 <spanset- 0:5>, set([0])>
1641
1720
1642 Test --follow on a non-existent directory
1721 Test --follow on a non-existent directory
1643
1722
@@ -1661,6 +1740,11 b' Test --follow on a directory'
1661 (string 'r:')
1740 (string 'r:')
1662 (string 'd:relpath')
1741 (string 'd:relpath')
1663 (string 'p:dir'))))
1742 (string 'p:dir'))))
1743 <filteredset
1744 <filteredset
1745 <spanset- 0:4>,
1746 <generatorsetdesc+>>,
1747 <matchfiles patterns=['dir'], include=[] exclude=[], default='relpath', rev=None>>
1664 $ hg up -q tip
1748 $ hg up -q tip
1665
1749
1666 Test --follow on file not in parent revision
1750 Test --follow on file not in parent revision
@@ -1684,6 +1768,11 b' Test --follow and patterns'
1684 (string 'r:')
1768 (string 'r:')
1685 (string 'd:relpath')
1769 (string 'd:relpath')
1686 (string 'p:glob:*'))))
1770 (string 'p:glob:*'))))
1771 <filteredset
1772 <filteredset
1773 <spanset- 0:5>,
1774 <generatorsetdesc+>>,
1775 <matchfiles patterns=['glob:*'], include=[] exclude=[], default='relpath', rev=None>>
1687
1776
1688 Test --follow on a single rename
1777 Test --follow on a single rename
1689
1778
@@ -1693,6 +1782,9 b' Test --follow on a single rename'
1693 (func
1782 (func
1694 (symbol 'follow')
1783 (symbol 'follow')
1695 (string 'a'))
1784 (string 'a'))
1785 <filteredset
1786 <spanset- 0:3>,
1787 <generatorsetdesc+>>
1696
1788
1697 Test --follow and multiple renames
1789 Test --follow and multiple renames
1698
1790
@@ -1702,6 +1794,9 b' Test --follow and multiple renames'
1702 (func
1794 (func
1703 (symbol 'follow')
1795 (symbol 'follow')
1704 (string 'e'))
1796 (string 'e'))
1797 <filteredset
1798 <spanset- 0:5>,
1799 <generatorsetdesc+>>
1705
1800
1706 Test --follow and multiple filelog heads
1801 Test --follow and multiple filelog heads
1707
1802
@@ -1711,6 +1806,9 b' Test --follow and multiple filelog heads'
1711 (func
1806 (func
1712 (symbol 'follow')
1807 (symbol 'follow')
1713 (string 'g'))
1808 (string 'g'))
1809 <filteredset
1810 <spanset- 0:3>,
1811 <generatorsetdesc+>>
1714 $ cat log.nodes
1812 $ cat log.nodes
1715 nodetag 2
1813 nodetag 2
1716 nodetag 1
1814 nodetag 1
@@ -1721,6 +1819,9 b' Test --follow and multiple filelog heads'
1721 (func
1819 (func
1722 (symbol 'follow')
1820 (symbol 'follow')
1723 (string 'g'))
1821 (string 'g'))
1822 <filteredset
1823 <spanset- 0:5>,
1824 <generatorsetdesc+>>
1724 $ cat log.nodes
1825 $ cat log.nodes
1725 nodetag 3
1826 nodetag 3
1726 nodetag 2
1827 nodetag 2
@@ -1738,6 +1839,11 b' Test --follow and multiple files'
1738 (func
1839 (func
1739 (symbol 'follow')
1840 (symbol 'follow')
1740 (string 'e'))))
1841 (string 'e'))))
1842 <filteredset
1843 <spanset- 0:5>,
1844 <addset
1845 <generatorsetdesc+>,
1846 <generatorsetdesc+>>>
1741 $ cat log.nodes
1847 $ cat log.nodes
1742 nodetag 4
1848 nodetag 4
1743 nodetag 3
1849 nodetag 3
@@ -1751,6 +1857,7 b' Test --follow null parent'
1751 $ testlog -f
1857 $ testlog -f
1752 []
1858 []
1753 []
1859 []
1860 <baseset []>
1754
1861
1755 Test --follow-first
1862 Test --follow-first
1756
1863
@@ -1770,6 +1877,9 b' Test --follow-first'
1770 (func
1877 (func
1771 (symbol 'rev')
1878 (symbol 'rev')
1772 (symbol '6')))
1879 (symbol '6')))
1880 <filteredset
1881 <spanset- 0:7>,
1882 <generatorsetdesc+>>
1773
1883
1774 Cannot compare with log --follow-first FILE as it never worked
1884 Cannot compare with log --follow-first FILE as it never worked
1775
1885
@@ -1778,6 +1888,9 b' Cannot compare with log --follow-first F'
1778 (func
1888 (func
1779 (symbol '_followfirst')
1889 (symbol '_followfirst')
1780 (string 'e'))
1890 (string 'e'))
1891 <filteredset
1892 <spanset- 0:7>,
1893 <generatorsetdesc+>>
1781 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1894 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1782 @ 6 merge 5 and 4
1895 @ 6 merge 5 and 4
1783 |\
1896 |\
@@ -1815,6 +1928,9 b' Test "set:..." and parent revision'
1815 (string 'r:')
1928 (string 'r:')
1816 (string 'd:relpath')
1929 (string 'd:relpath')
1817 (string 'p:set:copied()')))
1930 (string 'p:set:copied()')))
1931 <filteredset
1932 <spanset- 0:7>,
1933 <matchfiles patterns=['set:copied()'], include=[] exclude=[], default='relpath', rev=None>>
1818 $ testlog --include "set:copied()"
1934 $ testlog --include "set:copied()"
1819 []
1935 []
1820 (func
1936 (func
@@ -1823,15 +1939,20 b' Test "set:..." and parent revision'
1823 (string 'r:')
1939 (string 'r:')
1824 (string 'd:relpath')
1940 (string 'd:relpath')
1825 (string 'i:set:copied()')))
1941 (string 'i:set:copied()')))
1942 <filteredset
1943 <spanset- 0:7>,
1944 <matchfiles patterns=[], include=['set:copied()'] exclude=[], default='relpath', rev=None>>
1826 $ testlog -r "sort(file('set:copied()'), -rev)"
1945 $ testlog -r "sort(file('set:copied()'), -rev)"
1827 ["sort(file('set:copied()'), -rev)"]
1946 ["sort(file('set:copied()'), -rev)"]
1828 []
1947 []
1948 <baseset []>
1829
1949
1830 Test --removed
1950 Test --removed
1831
1951
1832 $ testlog --removed
1952 $ testlog --removed
1833 []
1953 []
1834 []
1954 []
1955 <spanset- 0:7>
1835 $ testlog --removed a
1956 $ testlog --removed a
1836 []
1957 []
1837 (func
1958 (func
@@ -1840,6 +1961,9 b' Test --removed'
1840 (string 'r:')
1961 (string 'r:')
1841 (string 'd:relpath')
1962 (string 'd:relpath')
1842 (string 'p:a')))
1963 (string 'p:a')))
1964 <filteredset
1965 <spanset- 0:7>,
1966 <matchfiles patterns=['a'], include=[] exclude=[], default='relpath', rev=None>>
1843 $ testlog --removed --follow a
1967 $ testlog --removed --follow a
1844 []
1968 []
1845 (and
1969 (and
@@ -1852,6 +1976,11 b' Test --removed'
1852 (string 'r:')
1976 (string 'r:')
1853 (string 'd:relpath')
1977 (string 'd:relpath')
1854 (string 'p:a'))))
1978 (string 'p:a'))))
1979 <filteredset
1980 <filteredset
1981 <spanset- 0:5>,
1982 <generatorsetdesc+>>,
1983 <matchfiles patterns=['a'], include=[] exclude=[], default='relpath', rev=None>>
1855
1984
1856 Test --patch and --stat with --follow and --follow-first
1985 Test --patch and --stat with --follow and --follow-first
1857
1986
@@ -1955,6 +2084,7 b' Test old-style --rev'
1955 $ testlog -r 'foo-bar'
2084 $ testlog -r 'foo-bar'
1956 ['foo-bar']
2085 ['foo-bar']
1957 []
2086 []
2087 <baseset [6]>
1958
2088
1959 Test --follow and forward --rev
2089 Test --follow and forward --rev
1960
2090
@@ -2180,6 +2310,9 b' changessincelatesttag with no prior tag'
2180 (func
2310 (func
2181 (symbol 'rev')
2311 (symbol 'rev')
2182 (symbol '6')))
2312 (symbol '6')))
2313 <filteredset
2314 <baseset- [4, 5, 6, 7, 8]>,
2315 <generatorsetasc+>>
2183
2316
2184 Test --follow-first and forward --rev
2317 Test --follow-first and forward --rev
2185
2318
@@ -2190,6 +2323,9 b' Test --follow-first and forward --rev'
2190 (func
2323 (func
2191 (symbol 'rev')
2324 (symbol 'rev')
2192 (symbol '6')))
2325 (symbol '6')))
2326 <filteredset
2327 <baseset- [4, 5, 6, 7, 8]>,
2328 <generatorsetasc+>>
2193 --- log.nodes * (glob)
2329 --- log.nodes * (glob)
2194 +++ glog.nodes * (glob)
2330 +++ glog.nodes * (glob)
2195 @@ -1,3 +1,3 @@
2331 @@ -1,3 +1,3 @@
@@ -2207,6 +2343,9 b' Test --follow and backward --rev'
2207 (func
2343 (func
2208 (symbol 'rev')
2344 (symbol 'rev')
2209 (symbol '6')))
2345 (symbol '6')))
2346 <filteredset
2347 <baseset- [4, 5, 6, 7, 8]>,
2348 <generatorsetdesc+>>
2210
2349
2211 Test --follow-first and backward --rev
2350 Test --follow-first and backward --rev
2212
2351
@@ -2217,6 +2356,9 b' Test --follow-first and backward --rev'
2217 (func
2356 (func
2218 (symbol 'rev')
2357 (symbol 'rev')
2219 (symbol '6')))
2358 (symbol '6')))
2359 <filteredset
2360 <baseset- [4, 5, 6, 7, 8]>,
2361 <generatorsetdesc+>>
2220
2362
2221 Test --follow with --rev of graphlog extension
2363 Test --follow with --rev of graphlog extension
2222
2364
@@ -2238,16 +2380,24 b' Test subdir'
2238 (string 'r:')
2380 (string 'r:')
2239 (string 'd:relpath')
2381 (string 'd:relpath')
2240 (string 'p:.')))
2382 (string 'p:.')))
2383 <filteredset
2384 <spanset- 0:9>,
2385 <matchfiles patterns=['.'], include=[] exclude=[], default='relpath', rev=None>>
2241 $ testlog ../b
2386 $ testlog ../b
2242 []
2387 []
2243 (func
2388 (func
2244 (symbol 'filelog')
2389 (symbol 'filelog')
2245 (string '../b'))
2390 (string '../b'))
2391 <filteredset
2392 <spanset- 0:9>, set([1])>
2246 $ testlog -f ../b
2393 $ testlog -f ../b
2247 []
2394 []
2248 (func
2395 (func
2249 (symbol 'follow')
2396 (symbol 'follow')
2250 (string 'b'))
2397 (string 'b'))
2398 <filteredset
2399 <spanset- 0:4>,
2400 <generatorsetdesc+>>
2251 $ cd ..
2401 $ cd ..
2252
2402
2253 Test --hidden
2403 Test --hidden
@@ -2263,9 +2413,11 b' Test --hidden'
2263 $ testlog
2413 $ testlog
2264 []
2414 []
2265 []
2415 []
2416 <spanset- 0:9>
2266 $ testlog --hidden
2417 $ testlog --hidden
2267 []
2418 []
2268 []
2419 []
2420 <spanset- 0:9>
2269 $ hg log -G --template '{rev} {desc}\n'
2421 $ hg log -G --template '{rev} {desc}\n'
2270 o 7 Added tag foo-bar for changeset fc281d8ff18d
2422 o 7 Added tag foo-bar for changeset fc281d8ff18d
2271 |
2423 |
General Comments 0
You need to be logged in to leave comments. Login now