1501 |
1501 |
1502 $ cat > helphook1.py <<EOF |
1502 $ cat > helphook1.py <<EOF |
1503 > from mercurial import help |
1503 > from mercurial import help |
1504 > |
1504 > |
1505 > def rewrite(ui, topic, doc): |
1505 > def rewrite(ui, topic, doc): |
1506 > return doc + '\nhelphook1\n' |
1506 > return doc + b'\nhelphook1\n' |
1507 > |
1507 > |
1508 > def extsetup(ui): |
1508 > def extsetup(ui): |
1509 > help.addtopichook('revisions', rewrite) |
1509 > help.addtopichook(b'revisions', rewrite) |
1510 > EOF |
1510 > EOF |
1511 $ cat > helphook2.py <<EOF |
1511 $ cat > helphook2.py <<EOF |
1512 > from mercurial import help |
1512 > from mercurial import help |
1513 > |
1513 > |
1514 > def rewrite(ui, topic, doc): |
1514 > def rewrite(ui, topic, doc): |
1515 > return doc + '\nhelphook2\n' |
1515 > return doc + b'\nhelphook2\n' |
1516 > |
1516 > |
1517 > def extsetup(ui): |
1517 > def extsetup(ui): |
1518 > help.addtopichook('revisions', rewrite) |
1518 > help.addtopichook(b'revisions', rewrite) |
1519 > EOF |
1519 > EOF |
1520 $ echo '[extensions]' >> $HGRCPATH |
1520 $ echo '[extensions]' >> $HGRCPATH |
1521 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
1521 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
1522 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
1522 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
1523 $ hg help revsets | grep helphook |
1523 $ hg help revsets | grep helphook |
1640 > |
1640 > |
1641 > This paragraph is never omitted, too (for extension) |
1641 > This paragraph is never omitted, too (for extension) |
1642 > ''' |
1642 > ''' |
1643 > from __future__ import absolute_import |
1643 > from __future__ import absolute_import |
1644 > from mercurial import commands, help |
1644 > from mercurial import commands, help |
1645 > testtopic = """This paragraph is never omitted (for topic). |
1645 > testtopic = b"""This paragraph is never omitted (for topic). |
1646 > |
1646 > |
1647 > .. container:: verbose |
1647 > .. container:: verbose |
1648 > |
1648 > |
1649 > This paragraph is omitted, |
1649 > This paragraph is omitted, |
1650 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
1650 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
1651 > |
1651 > |
1652 > This paragraph is never omitted, too (for topic) |
1652 > This paragraph is never omitted, too (for topic) |
1653 > """ |
1653 > """ |
1654 > def extsetup(ui): |
1654 > def extsetup(ui): |
1655 > help.helptable.append((["topic-containing-verbose"], |
1655 > help.helptable.append(([b"topic-containing-verbose"], |
1656 > "This is the topic to test omit indicating.", |
1656 > b"This is the topic to test omit indicating.", |
1657 > lambda ui: testtopic)) |
1657 > lambda ui: testtopic)) |
1658 > EOF |
1658 > EOF |
1659 $ echo '[extensions]' >> $HGRCPATH |
1659 $ echo '[extensions]' >> $HGRCPATH |
1660 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
1660 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
1661 $ hg help addverboseitems |
1661 $ hg help addverboseitems |