##// END OF EJS Templates
hgweb: handle a "descend" query parameter in filelog command...
Denis Laxalde -
r31939:604d3150 default
parent child Browse files
Show More
@@ -979,6 +979,9 b' def filelog(web, req, tmpl):'
979 patch = 'patch' in req.form
979 patch = 'patch' in req.form
980 if patch:
980 if patch:
981 lessvars['patch'] = morevars['patch'] = req.form['patch'][0]
981 lessvars['patch'] = morevars['patch'] = req.form['patch'][0]
982 descend = 'descend' in req.form
983 if descend:
984 lessvars['descend'] = morevars['descend'] = req.form['descend'][0]
982
985
983 count = fctx.filerev() + 1
986 count = fctx.filerev() + 1
984 start = max(0, count - revcount) # first rev on this page
987 start = max(0, count - revcount) # first rev on this page
@@ -1007,8 +1010,11 b' def filelog(web, req, tmpl):'
1007 # deactivate numeric nav links when linerange is specified as this
1010 # deactivate numeric nav links when linerange is specified as this
1008 # would required a dedicated "revnav" class
1011 # would required a dedicated "revnav" class
1009 nav = None
1012 nav = None
1010 ancestors = context.blockancestors(fctx, *lrange)
1013 if descend:
1011 for i, (c, lr) in enumerate(ancestors, 1):
1014 it = context.blockdescendants(fctx, *lrange)
1015 else:
1016 it = context.blockancestors(fctx, *lrange)
1017 for i, (c, lr) in enumerate(it, 1):
1012 diffs = None
1018 diffs = None
1013 if patch:
1019 if patch:
1014 diffs = diff(c, linerange=lr)
1020 diffs = diff(c, linerange=lr)
@@ -1049,6 +1055,7 b' def filelog(web, req, tmpl):'
1049 nav=nav,
1055 nav=nav,
1050 symrev=webutil.symrevorshortnode(req, fctx),
1056 symrev=webutil.symrevorshortnode(req, fctx),
1051 entries=entries,
1057 entries=entries,
1058 descend=descend,
1052 patch=patch,
1059 patch=patch,
1053 latestentry=latestentry,
1060 latestentry=latestentry,
1054 linerange=linerange,
1061 linerange=linerange,
@@ -48,7 +48,7 b''
48 log {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
48 log {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
49 {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
49 {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
50 {if(linerange,
50 {if(linerange,
51 ' (following lines {linerange} <a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">back to filelog</a>)')}
51 ' (following lines {linerange}{if(descend, ', descending')} <a href="{url|urlescape}log/{symrev}/{file|urlescape}{sessionvars%urlparameter}">back to filelog</a>)')}
52 </h3>
52 </h3>
53
53
54 <form class="search" action="{url|urlescape}log">
54 <form class="search" action="{url|urlescape}log">
@@ -1501,6 +1501,170 b" filelog with 'linerange' and 'patch'"
1501 </body>
1501 </body>
1502 </html>
1502 </html>
1503
1503
1504 $ hg log -r 'followlines(c, 3:4, startrev=8, descend=True) and follow(c)' -p
1505 changeset: 10:e95928d60479
1506 branch: a-branch
1507 user: test
1508 date: Thu Jan 01 00:00:00 1970 +0000
1509 summary: touch beginning of c
1510
1511 diff -r e1d3e9c5a23f -r e95928d60479 c
1512 --- a/c Thu Jan 01 00:00:00 1970 +0000
1513 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1514 @@ -1,7 +1,7 @@
1515 0
1516 0
1517 b
1518 -c+
1519 +c++
1520
1521 a
1522 a
1523
1524 changeset: 11:fb9bc322513a
1525 branch: a-branch
1526 tag: tip
1527 user: test
1528 date: Thu Jan 01 00:00:00 1970 +0000
1529 summary: touching beginning and end of c
1530
1531 diff -r e95928d60479 -r fb9bc322513a c
1532 --- a/c Thu Jan 01 00:00:00 1970 +0000
1533 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1534 @@ -1,6 +1,6 @@
1535 0
1536 0
1537 -b
1538 +b-
1539 c++
1540
1541 a
1542 @@ -8,4 +8,4 @@
1543
1544 d
1545 e+
1546 -f
1547 +f+
1548
1549 $ (get-with-headers.py localhost:$HGPORT 'log/8/c?linerange=3:4&descend=')
1550 200 Script output follows
1551
1552 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1553 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1554 <head>
1555 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1556 <meta name="robots" content="index, nofollow" />
1557 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1558 <script type="text/javascript" src="/static/mercurial.js"></script>
1559
1560 <title>test: c history</title>
1561 <link rel="alternate" type="application/atom+xml"
1562 href="/atom-log/tip/c" title="Atom feed for test:c" />
1563 <link rel="alternate" type="application/rss+xml"
1564 href="/rss-log/tip/c" title="RSS feed for test:c" />
1565 </head>
1566 <body>
1567
1568 <div class="container">
1569 <div class="menu">
1570 <div class="logo">
1571 <a href="https://mercurial-scm.org/">
1572 <img src="/static/hglogo.png" alt="mercurial" /></a>
1573 </div>
1574 <ul>
1575 <li><a href="/shortlog/8">log</a></li>
1576 <li><a href="/graph/8">graph</a></li>
1577 <li><a href="/tags">tags</a></li>
1578 <li><a href="/bookmarks">bookmarks</a></li>
1579 <li><a href="/branches">branches</a></li>
1580 </ul>
1581 <ul>
1582 <li><a href="/rev/8">changeset</a></li>
1583 <li><a href="/file/8">browse</a></li>
1584 </ul>
1585 <ul>
1586 <li><a href="/file/8/c">file</a></li>
1587 <li><a href="/diff/8/c">diff</a></li>
1588 <li><a href="/comparison/8/c">comparison</a></li>
1589 <li><a href="/annotate/8/c">annotate</a></li>
1590 <li class="active">file log</li>
1591 <li><a href="/raw-file/8/c">raw</a></li>
1592 </ul>
1593 <ul>
1594 <li><a href="/help">help</a></li>
1595 </ul>
1596 <div class="atom-logo">
1597 <a href="/atom-log/tip/c" title="subscribe to atom feed">
1598 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed" />
1599 </a>
1600 </div>
1601 </div>
1602
1603 <div class="main">
1604 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1605 <h3>
1606 log c @ 8:<a href="/rev/5c6574614c37">5c6574614c37</a>
1607 <span class="branchname">a-branch</span>
1608 (following lines 3:4, descending <a href="/log/8/c">back to filelog</a>)
1609 </h3>
1610
1611 <form class="search" action="/log">
1612
1613 <p><input name="rev" id="search1" type="text" size="30" /></p>
1614 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1615 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1616 </form>
1617
1618 <div class="navigate">
1619 <a href="/log/8/c?descend=&linerange=3%3A4&revcount=30">less</a>
1620 <a href="/log/8/c?descend=&linerange=3%3A4&revcount=120">more</a>
1621 | </div>
1622
1623 <table class="bigtable">
1624 <thead>
1625 <tr>
1626 <th class="age">age</th>
1627 <th class="author">author</th>
1628 <th class="description">description</th>
1629 </tr>
1630 </thead>
1631 <tbody class="stripes2">
1632 <tr>
1633 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1634 <td class="author">test</td>
1635 <td class="description">
1636 <a href="/rev/e95928d60479">touch beginning of c</a>
1637 <span class="branchname">a-branch</span>
1638 </td>
1639 </tr>
1640
1641 <tr>
1642 <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1643 <td class="author">test</td>
1644 <td class="description">
1645 <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
1646 <span class="branchhead">a-branch</span> <span class="tag">tip</span>
1647 </td>
1648 </tr>
1649
1650
1651 </tbody>
1652 </table>
1653
1654 <div class="navigate">
1655 <a href="/log/8/c?descend=&linerange=3%3A4&revcount=30">less</a>
1656 <a href="/log/8/c?descend=&linerange=3%3A4&revcount=120">more</a>
1657 |
1658 </div>
1659
1660 </div>
1661 </div>
1662
1663
1664
1665 </body>
1666 </html>
1667
1504
1668
1505 rss log
1669 rss log
1506
1670
General Comments 0
You need to be logged in to leave comments. Login now