##// END OF EJS Templates
hgweb: generate HTML documentation...
Dan Villiom Podlaski Christiansen -
r18747:f5db3092 default
parent child Browse files
Show More
@@ -60,6 +60,8 b' In addition to filters, there are some b'
60
60
61 - sub(pat, repl, expr)
61 - sub(pat, repl, expr)
62
62
63 - rstdoc(text, style)
64
63 Also, for any expression that returns a list, there is a list operator:
65 Also, for any expression that returns a list, there is a list operator:
64
66
65 - expr % "{template}"
67 - expr % "{template}"
@@ -993,11 +993,9 b' def help(web, req, tmpl):'
993 othercommands=othercommands, title='Index')
993 othercommands=othercommands, title='Index')
994
994
995 u = webutil.wsgiui()
995 u = webutil.wsgiui()
996 u.pushbuffer()
997 u.verbose = True
996 u.verbose = True
998 try:
997 try:
999 commands.help_(u, topicname)
998 doc = helpmod.help_(u, topicname)
1000 except error.UnknownCommand:
999 except error.UnknownCommand:
1001 raise ErrorResponse(HTTP_NOT_FOUND)
1000 raise ErrorResponse(HTTP_NOT_FOUND)
1002 doc = u.popbuffer()
1003 return tmpl('help', topic=topicname, doc=doc)
1001 return tmpl('help', topic=topicname, doc=doc)
@@ -9,6 +9,7 b' from i18n import _'
9 import sys, os, re
9 import sys, os, re
10 import util, config, templatefilters, parser, error
10 import util, config, templatefilters, parser, error
11 import types
11 import types
12 import minirst
12
13
13 # template parsing
14 # template parsing
14
15
@@ -287,6 +288,16 b' def label(context, mapping, args):'
287 t = stringify(args[1][0](context, mapping, args[1][1]))
288 t = stringify(args[1][0](context, mapping, args[1][1]))
288 yield runtemplate(context, mapping, compiletemplate(t, context))
289 yield runtemplate(context, mapping, compiletemplate(t, context))
289
290
291 def rstdoc(context, mapping, args):
292 if len(args) != 2:
293 # i18n: "rstdoc" is a keyword
294 raise error.ParseError(_("rstdoc expects two arguments"))
295
296 text = stringify(args[0][0](context, mapping, args[0][1]))
297 style = stringify(args[1][0](context, mapping, args[1][1]))
298
299 return minirst.format(text, style=style)
300
290 methods = {
301 methods = {
291 "string": lambda e, c: (runstring, e[1]),
302 "string": lambda e, c: (runstring, e[1]),
292 "symbol": lambda e, c: (runsymbol, e[1]),
303 "symbol": lambda e, c: (runsymbol, e[1]),
@@ -303,6 +314,7 b' funcs = {'
303 "ifeq": ifeq,
314 "ifeq": ifeq,
304 "join": join,
315 "join": join,
305 "label": label,
316 "label": label,
317 "rstdoc": rstdoc,
306 "sub": sub,
318 "sub": sub,
307 }
319 }
308
320
@@ -27,8 +27,8 b' help'
27
27
28 <div class="title">&nbsp;</div>
28 <div class="title">&nbsp;</div>
29
29
30 <pre>
30 <div id="doc">
31 {doc|escape}
31 {rstdoc(doc, "html")}
32 </pre>
32 </div>
33
33
34 {footer}
34 {footer}
@@ -31,8 +31,8 b''
31 </div>
31 </div>
32
32
33 <h2 class="no-link no-border">branches</h2>
33 <h2 class="no-link no-border">branches</h2>
34 <pre>
34 <div id="doc">
35 {doc|escape}
35 {rstdoc(doc, "html")}
36 </pre>
36 </div>
37
37
38 {footer}
38 {footer}
@@ -31,9 +31,9 b''
31 <div id="hint">find changesets by author, revision,
31 <div id="hint">find changesets by author, revision,
32 files, or words in the commit message</div>
32 files, or words in the commit message</div>
33 </form>
33 </form>
34 <pre>
34 <div id="doc">
35 {doc|escape}
35 {rstdoc(doc, "html")}
36 </pre>
36 </div>
37 </div>
37 </div>
38 </div>
38 </div>
39
39
@@ -1503,65 +1503,65 b' Dish up an empty repo; serve it cold.'
1503 <div id="hint">find changesets by author, revision,
1503 <div id="hint">find changesets by author, revision,
1504 files, or words in the commit message</div>
1504 files, or words in the commit message</div>
1505 </form>
1505 </form>
1506 <pre>
1506 <div id="doc">
1507 <p>
1507 hg add [OPTION]... [FILE]...
1508 hg add [OPTION]... [FILE]...
1508
1509 </p>
1510 <p>
1509 add the specified files on the next commit
1511 add the specified files on the next commit
1510
1512 </p>
1511 Schedule files to be version controlled and added to the repository.
1513 <p>
1512
1514 Schedule files to be version controlled and added to the
1513 The files will be added to the repository at the next commit. To undo an
1515 repository.
1514 add before that, see &quot;hg forget&quot;.
1516 </p>
1515
1517 <p>
1516 If no names are given, add all files to the repository.
1518 The files will be added to the repository at the next commit. To
1517
1519 undo an add before that, see "hg forget".
1518 An example showing how new (unknown) files are added automatically by &quot;hg
1520 </p>
1519 add&quot;:
1521 <p>
1520
1522 If no names are given, add all files to the repository.
1521 $ ls
1523 </p>
1522 foo.c
1524 <p>
1523 $ hg status
1525 Returns 0 if all files are successfully added.
1524 ? foo.c
1526 </p>
1525 $ hg add
1527 <p>
1526 adding foo.c
1527 $ hg status
1528 A foo.c
1529
1530 Returns 0 if all files are successfully added.
1531
1532 options:
1528 options:
1529 </p>
1530 <table>
1531 <tr><th>-I</th><th>--include PATTERN [+]</th><th>include names matching the given patterns</th></tr>
1532 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1533 <tr><td>-S</td><td>--subrepos</td><td>recurse into subrepositories</td></tr>
1534 <tr><td>-n</td><td>--dry-run</td><td>do not perform actions, just print output</td></tr>
1535 </table>
1536 <p>
1537 [+] marked option can be specified multiple times
1538 </p>
1539 <p>
1540 global options:
1541 </p>
1542 <table>
1543 <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
1544 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1545 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1546 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1547 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1548 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1549 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1550 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1551 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1552 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1553 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1554 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1555 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1556 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1557 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1558 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1559 </table>
1560 <p>
1561 [+] marked option can be specified multiple times
1562 </p>
1533
1563
1534 -I --include PATTERN [+] include names matching the given patterns
1564 </div>
1535 -X --exclude PATTERN [+] exclude names matching the given patterns
1536 -S --subrepos recurse into subrepositories
1537 -n --dry-run do not perform actions, just print output
1538
1539 [+] marked option can be specified multiple times
1540
1541 global options:
1542
1543 -R --repository REPO repository root directory or name of overlay bundle
1544 file
1545 --cwd DIR change working directory
1546 -y --noninteractive do not prompt, automatically pick the first choice for
1547 all prompts
1548 -q --quiet suppress output
1549 -v --verbose enable additional output
1550 --config CONFIG [+] set/override config option (use 'section.name=value')
1551 --debug enable debugging output
1552 --debugger start debugger
1553 --encoding ENCODE set the charset encoding (default: ascii)
1554 --encodingmode MODE set the charset encoding mode (default: strict)
1555 --traceback always print a traceback on exception
1556 --time time how long the command takes
1557 --profile print command execution profile
1558 --version output version information and exit
1559 -h --help display help and exit
1560 --hidden consider hidden changesets
1561
1562 [+] marked option can be specified multiple times
1563
1564 </pre>
1565 </div>
1565 </div>
1566 </div>
1566 </div>
1567
1567
@@ -1615,74 +1615,65 b' Dish up an empty repo; serve it cold.'
1615 <div id="hint">find changesets by author, revision,
1615 <div id="hint">find changesets by author, revision,
1616 files, or words in the commit message</div>
1616 files, or words in the commit message</div>
1617 </form>
1617 </form>
1618 <pre>
1618 <div id="doc">
1619 <p>
1619 hg remove [OPTION]... FILE...
1620 hg remove [OPTION]... FILE...
1620
1621 </p>
1622 <p>
1621 aliases: rm
1623 aliases: rm
1622
1624 </p>
1625 <p>
1623 remove the specified files on the next commit
1626 remove the specified files on the next commit
1624
1627 </p>
1625 Schedule the indicated files for removal from the current branch.
1628 <p>
1626
1629 Schedule the indicated files for removal from the current branch.
1627 This command schedules the files to be removed at the next commit. To undo
1630 </p>
1628 a remove before that, see &quot;hg revert&quot;. To undo added files, see &quot;hg
1631 <p>
1629 forget&quot;.
1632 This command schedules the files to be removed at the next commit.
1630
1633 To undo a remove before that, see "hg revert". To undo added
1631 -A/--after can be used to remove only files that have already been
1634 files, see "hg forget".
1632 deleted, -f/--force can be used to force deletion, and -Af can be used to
1635 </p>
1633 remove files from the next revision without deleting them from the working
1636 <p>
1634 directory.
1637 Returns 0 on success, 1 if any warnings encountered.
1635
1638 </p>
1636 The following table details the behavior of remove for different file
1639 <p>
1637 states (columns) and option combinations (rows). The file states are Added
1640 options:
1638 [A], Clean [C], Modified [M] and Missing [!] (as reported by &quot;hg status&quot;).
1641 </p>
1639 The actions are Warn, Remove (from branch) and Delete (from disk):
1642 <table>
1640
1643 <tr><th>-A</th><th>--after</th><th>record delete for missing files</th></tr>
1641 A C M !
1644 <tr><td>-f</td><td>--force</td><td>remove (and delete) file even if added or modified</td></tr>
1642 --------------
1645 <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
1643 none W RD W R
1646 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1644 -f R RD RD R
1647 </table>
1645 -A W W W R
1648 <p>
1646 -Af R R R R
1649 [+] marked option can be specified multiple times
1647
1650 </p>
1648 Note that remove never deletes files in Added [A] state from the working
1651 <p>
1649 directory, not even if option --force is specified.
1652 global options:
1653 </p>
1654 <table>
1655 <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
1656 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1657 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1658 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1659 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1660 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1661 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1662 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1663 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1664 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1665 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1666 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1667 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1668 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1669 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1670 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1671 </table>
1672 <p>
1673 [+] marked option can be specified multiple times
1674 </p>
1650
1675
1651 Returns 0 on success, 1 if any warnings encountered.
1676 </div>
1652
1653 options:
1654
1655 -A --after record delete for missing files
1656 -f --force remove (and delete) file even if added or modified
1657 -I --include PATTERN [+] include names matching the given patterns
1658 -X --exclude PATTERN [+] exclude names matching the given patterns
1659
1660 [+] marked option can be specified multiple times
1661
1662 global options:
1663
1664 -R --repository REPO repository root directory or name of overlay bundle
1665 file
1666 --cwd DIR change working directory
1667 -y --noninteractive do not prompt, automatically pick the first choice for
1668 all prompts
1669 -q --quiet suppress output
1670 -v --verbose enable additional output
1671 --config CONFIG [+] set/override config option (use 'section.name=value')
1672 --debug enable debugging output
1673 --debugger start debugger
1674 --encoding ENCODE set the charset encoding (default: ascii)
1675 --encodingmode MODE set the charset encoding mode (default: strict)
1676 --traceback always print a traceback on exception
1677 --time time how long the command takes
1678 --profile print command execution profile
1679 --version output version information and exit
1680 -h --help display help and exit
1681 --hidden consider hidden changesets
1682
1683 [+] marked option can be specified multiple times
1684
1685 </pre>
1686 </div>
1677 </div>
1687 </div>
1678 </div>
1688
1679
@@ -1736,38 +1727,50 b' Dish up an empty repo; serve it cold.'
1736 <div id="hint">find changesets by author, revision,
1727 <div id="hint">find changesets by author, revision,
1737 files, or words in the commit message</div>
1728 files, or words in the commit message</div>
1738 </form>
1729 </form>
1739 <pre>
1730 <div id="doc">
1731 <p>
1740 Specifying Single Revisions
1732 Specifying Single Revisions
1741
1733 </p>
1742 Mercurial supports several ways to specify individual revisions.
1734 <p>
1743
1735 Mercurial supports several ways to specify individual revisions.
1744 A plain integer is treated as a revision number. Negative integers are
1736 </p>
1745 treated as sequential offsets from the tip, with -1 denoting the tip, -2
1737 <p>
1746 denoting the revision prior to the tip, and so forth.
1738 A plain integer is treated as a revision number. Negative integers are
1747
1739 treated as sequential offsets from the tip, with -1 denoting the tip,
1748 A 40-digit hexadecimal string is treated as a unique revision identifier.
1740 -2 denoting the revision prior to the tip, and so forth.
1749
1741 </p>
1750 A hexadecimal string less than 40 characters long is treated as a unique
1742 <p>
1751 revision identifier and is referred to as a short-form identifier. A
1743 A 40-digit hexadecimal string is treated as a unique revision
1752 short-form identifier is only valid if it is the prefix of exactly one
1744 identifier.
1753 full-length identifier.
1745 </p>
1746 <p>
1747 A hexadecimal string less than 40 characters long is treated as a
1748 unique revision identifier and is referred to as a short-form
1749 identifier. A short-form identifier is only valid if it is the prefix
1750 of exactly one full-length identifier.
1751 </p>
1752 <p>
1753 Any other string is treated as a bookmark, tag, or branch name. A
1754 bookmark is a movable pointer to a revision. A tag is a permanent name
1755 associated with a revision. A branch name denotes the tipmost revision
1756 of that branch. Bookmark, tag, and branch names must not contain the ":"
1757 character.
1758 </p>
1759 <p>
1760 The reserved name "tip" always identifies the most recent revision.
1761 </p>
1762 <p>
1763 The reserved name "null" indicates the null revision. This is the
1764 revision of an empty repository, and the parent of revision 0.
1765 </p>
1766 <p>
1767 The reserved name "." indicates the working directory parent. If no
1768 working directory is checked out, it is equivalent to null. If an
1769 uncommitted merge is in progress, "." is the revision of the first
1770 parent.
1771 </p>
1754
1772
1755 Any other string is treated as a bookmark, tag, or branch name. A bookmark
1773 </div>
1756 is a movable pointer to a revision. A tag is a permanent name associated
1757 with a revision. A branch name denotes the tipmost revision of that
1758 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot;
1759 character.
1760
1761 The reserved name &quot;tip&quot; always identifies the most recent revision.
1762
1763 The reserved name &quot;null&quot; indicates the null revision. This is the revision
1764 of an empty repository, and the parent of revision 0.
1765
1766 The reserved name &quot;.&quot; indicates the working directory parent. If no
1767 working directory is checked out, it is equivalent to null. If an
1768 uncommitted merge is in progress, &quot;.&quot; is the revision of the first parent.
1769
1770 </pre>
1771 </div>
1774 </div>
1772 </div>
1775 </div>
1773
1776
General Comments 0
You need to be logged in to leave comments. Login now