##// END OF EJS Templates
hgweb: support rendering a sub-topic...
Gregory Szorc -
r27582:8f8f3b13 default
parent child Browse files
Show More
@@ -1271,8 +1271,20 b' def help(web, req, tmpl):'
1271
1271
1272 u = webutil.wsgiui()
1272 u = webutil.wsgiui()
1273 u.verbose = True
1273 u.verbose = True
1274
1275 # Render a page from a sub-topic.
1276 if '.' in topicname:
1277 # TODO implement support for rendering sections, like
1278 # `hg help` works.
1279 topic, subtopic = topicname.split('.', 1)
1280 if topic not in helpmod.subtopics:
1281 raise ErrorResponse(HTTP_NOT_FOUND)
1282 else:
1283 topic = topicname
1284 subtopic = None
1285
1274 try:
1286 try:
1275 doc = helpmod.help_(u, topicname)
1287 doc = helpmod.help_(u, topic, subtopic=subtopic)
1276 except error.UnknownCommand:
1288 except error.UnknownCommand:
1277 raise ErrorResponse(HTTP_NOT_FOUND)
1289 raise ErrorResponse(HTTP_NOT_FOUND)
1278 return tmpl('help', topic=topicname, doc=doc)
1290 return tmpl('help', topic=topicname, doc=doc)
@@ -2707,6 +2707,246 b' Sub-topic indexes rendered properly'
2707 </html>
2707 </html>
2708
2708
2709
2709
2710 Sub-topic topics rendered properly
2711
2712 $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals.changegroups"
2713 200 Script output follows
2714
2715 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2716 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2717 <head>
2718 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2719 <meta name="robots" content="index, nofollow" />
2720 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2721 <script type="text/javascript" src="/static/mercurial.js"></script>
2722
2723 <title>Help: internals.changegroups</title>
2724 </head>
2725 <body>
2726
2727 <div class="container">
2728 <div class="menu">
2729 <div class="logo">
2730 <a href="https://mercurial-scm.org/">
2731 <img src="/static/hglogo.png" alt="mercurial" /></a>
2732 </div>
2733 <ul>
2734 <li><a href="/shortlog">log</a></li>
2735 <li><a href="/graph">graph</a></li>
2736 <li><a href="/tags">tags</a></li>
2737 <li><a href="/bookmarks">bookmarks</a></li>
2738 <li><a href="/branches">branches</a></li>
2739 </ul>
2740 <ul>
2741 <li class="active"><a href="/help">help</a></li>
2742 </ul>
2743 </div>
2744
2745 <div class="main">
2746 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2747 <h3>Help: internals.changegroups</h3>
2748
2749 <form class="search" action="/log">
2750
2751 <p><input name="rev" id="search1" type="text" size="30" /></p>
2752 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2753 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2754 </form>
2755 <div id="doc">
2756 <h1>representation of revlog data</h1>
2757 <h2>Changegroups</h2>
2758 <p>
2759 Changegroups are representations of repository revlog data, specifically
2760 the changelog, manifest, and filelogs.
2761 </p>
2762 <p>
2763 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
2764 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with
2765 the only difference being a header on entries in the changeset
2766 segment. Version &quot;3&quot; adds support for exchanging treemanifests and
2767 includes revlog flags in the delta header.
2768 </p>
2769 <p>
2770 Changegroups consists of 3 logical segments:
2771 </p>
2772 <pre>
2773 +---------------------------------+
2774 | | | |
2775 | changeset | manifest | filelogs |
2776 | | | |
2777 +---------------------------------+
2778 </pre>
2779 <p>
2780 The principle building block of each segment is a *chunk*. A *chunk*
2781 is a framed piece of data:
2782 </p>
2783 <pre>
2784 +---------------------------------------+
2785 | | |
2786 | length | data |
2787 | (32 bits) | &lt;length&gt; bytes |
2788 | | |
2789 +---------------------------------------+
2790 </pre>
2791 <p>
2792 Each chunk starts with a 32-bit big-endian signed integer indicating
2793 the length of the raw data that follows.
2794 </p>
2795 <p>
2796 There is a special case chunk that has 0 length (&quot;0x00000000&quot;). We
2797 call this an *empty chunk*.
2798 </p>
2799 <h3>Delta Groups</h3>
2800 <p>
2801 A *delta group* expresses the content of a revlog as a series of deltas,
2802 or patches against previous revisions.
2803 </p>
2804 <p>
2805 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
2806 to signal the end of the delta group:
2807 </p>
2808 <pre>
2809 +------------------------------------------------------------------------+
2810 | | | | | |
2811 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
2812 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
2813 | | | | | |
2814 +------------------------------------------------------------+-----------+
2815 </pre>
2816 <p>
2817 Each *chunk*'s data consists of the following:
2818 </p>
2819 <pre>
2820 +-----------------------------------------+
2821 | | | |
2822 | delta header | mdiff header | delta |
2823 | (various) | (12 bytes) | (various) |
2824 | | | |
2825 +-----------------------------------------+
2826 </pre>
2827 <p>
2828 The *length* field is the byte length of the remaining 3 logical pieces
2829 of data. The *delta* is a diff from an existing entry in the changelog.
2830 </p>
2831 <p>
2832 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
2833 &quot;3&quot; of the changegroup format.
2834 </p>
2835 <p>
2836 Version 1:
2837 </p>
2838 <pre>
2839 +------------------------------------------------------+
2840 | | | | |
2841 | node | p1 node | p2 node | link node |
2842 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
2843 | | | | |
2844 +------------------------------------------------------+
2845 </pre>
2846 <p>
2847 Version 2:
2848 </p>
2849 <pre>
2850 +------------------------------------------------------------------+
2851 | | | | | |
2852 | node | p1 node | p2 node | base node | link node |
2853 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
2854 | | | | | |
2855 +------------------------------------------------------------------+
2856 </pre>
2857 <p>
2858 Version 3:
2859 </p>
2860 <pre>
2861 +------------------------------------------------------------------------------+
2862 | | | | | | |
2863 | node | p1 node | p2 node | base node | link node | flags |
2864 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
2865 | | | | | | |
2866 +------------------------------------------------------------------------------+
2867 </pre>
2868 <p>
2869 The *mdiff header* consists of 3 32-bit big-endian signed integers
2870 describing offsets at which to apply the following delta content:
2871 </p>
2872 <pre>
2873 +-------------------------------------+
2874 | | | |
2875 | offset | old length | new length |
2876 | (32 bits) | (32 bits) | (32 bits) |
2877 | | | |
2878 +-------------------------------------+
2879 </pre>
2880 <p>
2881 In version 1, the delta is always applied against the previous node from
2882 the changegroup or the first parent if this is the first entry in the
2883 changegroup.
2884 </p>
2885 <p>
2886 In version 2, the delta base node is encoded in the entry in the
2887 changegroup. This allows the delta to be expressed against any parent,
2888 which can result in smaller deltas and more efficient encoding of data.
2889 </p>
2890 <h3>Changeset Segment</h3>
2891 <p>
2892 The *changeset segment* consists of a single *delta group* holding
2893 changelog data. It is followed by an *empty chunk* to denote the
2894 boundary to the *manifests segment*.
2895 </p>
2896 <h3>Manifest Segment</h3>
2897 <p>
2898 The *manifest segment* consists of a single *delta group* holding
2899 manifest data. It is followed by an *empty chunk* to denote the boundary
2900 to the *filelogs segment*.
2901 </p>
2902 <h3>Filelogs Segment</h3>
2903 <p>
2904 The *filelogs* segment consists of multiple sub-segments, each
2905 corresponding to an individual file whose data is being described:
2906 </p>
2907 <pre>
2908 +--------------------------------------+
2909 | | | | |
2910 | filelog0 | filelog1 | filelog2 | ... |
2911 | | | | |
2912 +--------------------------------------+
2913 </pre>
2914 <p>
2915 In version &quot;3&quot; of the changegroup format, filelogs may include
2916 directory logs when treemanifests are in use. directory logs are
2917 identified by having a trailing '/' on their filename (see below).
2918 </p>
2919 <p>
2920 The final filelog sub-segment is followed by an *empty chunk* to denote
2921 the end of the segment and the overall changegroup.
2922 </p>
2923 <p>
2924 Each filelog sub-segment consists of the following:
2925 </p>
2926 <pre>
2927 +------------------------------------------+
2928 | | | |
2929 | filename size | filename | delta group |
2930 | (32 bits) | (various) | (various) |
2931 | | | |
2932 +------------------------------------------+
2933 </pre>
2934 <p>
2935 That is, a *chunk* consisting of the filename (not terminated or padded)
2936 followed by N chunks constituting the *delta group* for this file.
2937 </p>
2938
2939 </div>
2940 </div>
2941 </div>
2942
2943 <script type="text/javascript">process_dates()</script>
2944
2945
2946 </body>
2947 </html>
2948
2949
2710 $ killdaemons.py
2950 $ killdaemons.py
2711
2951
2712 #endif
2952 #endif
General Comments 0
You need to be logged in to leave comments. Login now