1620 $ hg log -r 0 --template '{if(rev, desc)}\n' |
1620 $ hg log -r 0 --template '{if(rev, desc)}\n' |
1621 {rev} |
1621 {rev} |
1622 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' |
1622 $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' |
1623 test 0 |
1623 test 0 |
1624 |
1624 |
|
1625 $ hg branch -q 'text.{rev}' |
|
1626 $ echo aa >> aa |
|
1627 $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' |
|
1628 |
|
1629 $ hg log -r 1 --template '{fill(desc, "20", author, branch)}' |
|
1630 {node|short}desc to |
|
1631 text.{rev}be wrapped |
|
1632 text.{rev}desc to be |
|
1633 text.{rev}wrapped (no-eol) |
|
1634 $ hg log -r 1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}' |
|
1635 bcc7ff960b8e:desc to |
|
1636 text.1:be wrapped |
|
1637 text.1:desc to be |
|
1638 text.1:wrapped (no-eol) |
|
1639 |
|
1640 $ hg log -r 1 --template '{sub(r"[0-9]", "-", author)}' |
|
1641 {node|short} (no-eol) |
|
1642 $ hg log -r 1 --template '{sub(r"[0-9]", "-", "{node|short}")}' |
|
1643 bcc-ff---b-e (no-eol) |
|
1644 |
|
1645 $ cat >> .hg/hgrc <<EOF |
|
1646 > [extensions] |
|
1647 > color= |
|
1648 > [color] |
|
1649 > mode=ansi |
|
1650 > text.{rev} = red |
|
1651 > text.1 = green |
|
1652 > EOF |
|
1653 $ hg log --color=always -r 1 --template '{label(branch, "text\n")}' |
|
1654 \x1b[0;31mtext\x1b[0m (esc) |
|
1655 $ hg log --color=always -r 1 --template '{label("text.{rev}", "text\n")}' |
|
1656 \x1b[0;32mtext\x1b[0m (esc) |
|
1657 |
1625 Test branches inside if statement: |
1658 Test branches inside if statement: |
1626 |
1659 |
1627 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' |
1660 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' |
1628 no |
1661 no |