97 > return cmdutil._makelogrevset(repo, pats, opts, revs)[0] |
98 > return cmdutil._makelogrevset(repo, pats, opts, revs)[0] |
98 > |
99 > |
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) |
105 > tree = revsetlang.analyze(tree) |
107 > tree = revsetlang.analyze(tree) |
106 > else: |
108 > else: |
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) |
113 > entry[1].append(('', 'print-revset', False, |
116 > entry[1].append(('', 'print-revset', False, |
114 > 'print generated revset and exit (DEPRECATED)')) |
117 > 'print generated revset and exit (DEPRECATED)')) |
1450 glog always reorders nodes which explains the difference with log |
1453 glog always reorders nodes which explains the difference with log |
1451 |
1454 |
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 @@ |
1458 -nodetag 27 |
1462 -nodetag 27 |
1459 -nodetag 25 |
1463 -nodetag 25 |
1472 (symbol 'user') |
1476 (symbol 'user') |
1473 (string 'test')) |
1477 (string 'test')) |
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'! |
1480 abort: unknown revision 'not-a-branch'! |
1493 abort: unknown revision 'not-a-branch'! |
1481 $ testlog -b 35 -b 36 --only-branch branch |
1494 $ testlog -b 35 -b 36 --only-branch branch |
1489 (symbol 'branch') |
1502 (symbol 'branch') |
1490 (string 'branch')) |
1503 (string 'branch')) |
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 |
1497 (list |
1523 (list |
1498 (func |
1524 (func |
1499 (symbol 'keyword') |
1525 (symbol 'keyword') |
1500 (string 'expand')) |
1526 (string 'expand')) |
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] |
1523 $ testlog --prune 31 --prune 32 |
1570 $ testlog --prune 31 --prune 32 |
1524 [] |
1571 [] |
1535 (list |
1582 (list |
1536 (string '32') |
1583 (string '32') |
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. |
1543 |
1605 |
1544 $ cd .. |
1606 $ cd .. |
1545 $ hg init follow |
1607 $ hg init follow |
1546 $ cd follow |
1608 $ cd follow |
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 |
1556 $ hg ci -Am "add a" a aa f |
1620 $ hg ci -Am "add a" a aa f |
1557 $ hg cp a b |
1621 $ hg cp a b |
1622 (string 'p:e') |
1696 (string 'p:e') |
1623 (string 'i:a') |
1697 (string 'i:a') |
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 |
1630 $ expandglobs=`$PYTHON -c "import mercurial.util; \ |
1707 $ expandglobs=`$PYTHON -c "import mercurial.util; \ |
1631 > print(mercurial.util.expandglobs and 'true' or 'false')"` |
1708 > print(mercurial.util.expandglobs and 'true' or 'false')"` |
1682 (symbol '_matchfiles') |
1766 (symbol '_matchfiles') |
1683 (list |
1767 (list |
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 |
1690 $ hg up -q 2 |
1779 $ hg up -q 2 |
1691 $ testlog -f a |
1780 $ testlog -f a |
1692 [] |
1781 [] |
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 |
1699 $ hg up -q tip |
1791 $ hg up -q tip |
1700 $ testlog -f e |
1792 $ testlog -f e |
1701 [] |
1793 [] |
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 |
1708 $ hg up -q 2 |
1803 $ hg up -q 2 |
1709 $ testlog -f g |
1804 $ testlog -f g |
1710 [] |
1805 [] |
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 |
1717 nodetag 0 |
1815 nodetag 0 |
1718 $ hg up -q tip |
1816 $ hg up -q tip |
1719 $ testlog -f g |
1817 $ testlog -f g |
1720 [] |
1818 [] |
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 |
1727 nodetag 0 |
1828 nodetag 0 |
1728 |
1829 |
1768 (func |
1875 (func |
1769 (symbol '_firstancestors') |
1876 (symbol '_firstancestors') |
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 |
1776 $ hg log -G --print-revset --follow-first e |
1886 $ hg log -G --print-revset --follow-first e |
1777 [] |
1887 [] |
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 |\ |
1784 | ~ |
1897 | ~ |
1785 o 5 add another e |
1898 o 5 add another e |
1813 (symbol '_matchfiles') |
1926 (symbol '_matchfiles') |
1814 (list |
1927 (list |
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 |
1821 (symbol '_matchfiles') |
1937 (symbol '_matchfiles') |
1822 (list |
1938 (list |
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 |
1838 (symbol '_matchfiles') |
1959 (symbol '_matchfiles') |
1839 (list |
1960 (list |
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 |
1846 (func |
1970 (func |
1847 (symbol 'ancestors') |
1971 (symbol 'ancestors') |
1850 (symbol '_matchfiles') |
1974 (symbol '_matchfiles') |
1851 (list |
1975 (list |
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 |
1858 $ hg up -q 3 |
1987 $ hg up -q 3 |
1859 $ hg log -G --git --patch b |
1988 $ hg log -G --git --patch b |
2178 (func |
2308 (func |
2179 (symbol 'descendants') |
2309 (symbol 'descendants') |
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 |
2186 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4 |
2319 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4 |
2187 ['6', '8', '5', '7', '4'] |
2320 ['6', '8', '5', '7', '4'] |
2188 (func |
2321 (func |
2189 (symbol '_firstdescendants') |
2322 (symbol '_firstdescendants') |
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 @@ |
2196 -nodetag 6 |
2332 -nodetag 6 |
2197 nodetag 8 |
2333 nodetag 8 |
2205 (func |
2341 (func |
2206 (symbol 'ancestors') |
2342 (symbol 'ancestors') |
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 |
2213 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4 |
2352 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4 |
2214 ['6', '5', '7', '8', '4'] |
2353 ['6', '5', '7', '8', '4'] |
2215 (func |
2354 (func |
2216 (symbol '_firstancestors') |
2355 (symbol '_firstancestors') |
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 |
2223 $ hg --config extensions.graphlog= glog -qfr1 |
2365 $ hg --config extensions.graphlog= glog -qfr1 |
2224 o 1:216d4c92cf98 |
2366 o 1:216d4c92cf98 |