Show More
@@ -206,6 +206,11 b' helptable = sorted([' | |||||
206 | internalshelp), |
|
206 | internalshelp), | |
207 | ]) |
|
207 | ]) | |
208 |
|
208 | |||
|
209 | # Maps topics with sub-topics to a list of their sub-topics. | |||
|
210 | subtopics = { | |||
|
211 | 'internals': internalstable, | |||
|
212 | } | |||
|
213 | ||||
209 | # Map topics to lists of callable taking the current topic help and |
|
214 | # Map topics to lists of callable taking the current topic help and | |
210 | # returning the updated version |
|
215 | # returning the updated version | |
211 | helphooks = {} |
|
216 | helphooks = {} | |
@@ -433,11 +438,19 b' def help_(ui, name, unknowncmd=False, fu' | |||||
433 | return rst |
|
438 | return rst | |
434 |
|
439 | |||
435 | def helptopic(name, subtopic=None): |
|
440 | def helptopic(name, subtopic=None): | |
436 | for names, header, doc in helptable: |
|
441 | # Look for sub-topic entry first. | |
437 | if name in names: |
|
442 | header, doc = None, None | |
438 | break |
|
443 | if subtopic and name in subtopics: | |
439 | else: |
|
444 | for names, header, doc in subtopics[name]: | |
440 | raise error.UnknownCommand(name) |
|
445 | if subtopic in names: | |
|
446 | break | |||
|
447 | ||||
|
448 | if not header: | |||
|
449 | for names, header, doc in helptable: | |||
|
450 | if name in names: | |||
|
451 | break | |||
|
452 | else: | |||
|
453 | raise error.UnknownCommand(name) | |||
441 |
|
454 | |||
442 | rst = [minirst.section(header)] |
|
455 | rst = [minirst.section(header)] | |
443 |
|
456 |
@@ -874,6 +874,151 b' internals topic renders index of availab' | |||||
874 | bundles container for exchange of repository data |
|
874 | bundles container for exchange of repository data | |
875 | changegroups representation of revlog data |
|
875 | changegroups representation of revlog data | |
876 |
|
876 | |||
|
877 | sub-topics can be accessed | |||
|
878 | ||||
|
879 | $ hg help internals.changegroups | |||
|
880 | Changegroups | |||
|
881 | ============ | |||
|
882 | ||||
|
883 | Changegroups are representations of repository revlog data, specifically | |||
|
884 | the changelog, manifest, and filelogs. | |||
|
885 | ||||
|
886 | There are 2 versions of changegroups: "1" and "2". From a high-level, they | |||
|
887 | are almost exactly the same, with the only difference being a header on | |||
|
888 | entries in the changeset segment. | |||
|
889 | ||||
|
890 | Changegroups consists of 3 logical segments: | |||
|
891 | ||||
|
892 | +---------------------------------+ | |||
|
893 | | | | | | |||
|
894 | | changeset | manifest | filelogs | | |||
|
895 | | | | | | |||
|
896 | +---------------------------------+ | |||
|
897 | ||||
|
898 | The principle building block of each segment is a *chunk*. A *chunk* is a | |||
|
899 | framed piece of data: | |||
|
900 | ||||
|
901 | +---------------------------------------+ | |||
|
902 | | | | | |||
|
903 | | length | data | | |||
|
904 | | (32 bits) | <length> bytes | | |||
|
905 | | | | | |||
|
906 | +---------------------------------------+ | |||
|
907 | ||||
|
908 | Each chunk starts with a 32-bit big-endian signed integer indicating the | |||
|
909 | length of the raw data that follows. | |||
|
910 | ||||
|
911 | There is a special case chunk that has 0 length ("0x00000000"). We call | |||
|
912 | this an *empty chunk*. | |||
|
913 | ||||
|
914 | Delta Groups | |||
|
915 | ------------ | |||
|
916 | ||||
|
917 | A *delta group* expresses the content of a revlog as a series of deltas, | |||
|
918 | or patches against previous revisions. | |||
|
919 | ||||
|
920 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* | |||
|
921 | to signal the end of the delta group: | |||
|
922 | ||||
|
923 | +------------------------------------------------------------------------+ | |||
|
924 | | | | | | | | |||
|
925 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | | |||
|
926 | | (32 bits) | (various) | (32 bits) | (various) | (32 bits) | | |||
|
927 | | | | | | | | |||
|
928 | +------------------------------------------------------------+-----------+ | |||
|
929 | ||||
|
930 | Each *chunk*'s data consists of the following: | |||
|
931 | ||||
|
932 | +-----------------------------------------+ | |||
|
933 | | | | | | |||
|
934 | | delta header | mdiff header | delta | | |||
|
935 | | (various) | (12 bytes) | (various) | | |||
|
936 | | | | | | |||
|
937 | +-----------------------------------------+ | |||
|
938 | ||||
|
939 | The *length* field is the byte length of the remaining 3 logical pieces of | |||
|
940 | data. The *delta* is a diff from an existing entry in the changelog. | |||
|
941 | ||||
|
942 | The *delta header* is different between versions "1" and "2" of the | |||
|
943 | changegroup format. | |||
|
944 | ||||
|
945 | Version 1: | |||
|
946 | ||||
|
947 | +------------------------------------------------------+ | |||
|
948 | | | | | | | |||
|
949 | | node | p1 node | p2 node | link node | | |||
|
950 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |||
|
951 | | | | | | | |||
|
952 | +------------------------------------------------------+ | |||
|
953 | ||||
|
954 | Version 2: | |||
|
955 | ||||
|
956 | +------------------------------------------------------------------+ | |||
|
957 | | | | | | | | |||
|
958 | | node | p1 node | p2 node | base node | link node | | |||
|
959 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |||
|
960 | | | | | | | | |||
|
961 | +------------------------------------------------------------------+ | |||
|
962 | ||||
|
963 | The *mdiff header* consists of 3 32-bit big-endian signed integers | |||
|
964 | describing offsets at which to apply the following delta content: | |||
|
965 | ||||
|
966 | +-------------------------------------+ | |||
|
967 | | | | | | |||
|
968 | | offset | old length | new length | | |||
|
969 | | (32 bits) | (32 bits) | (32 bits) | | |||
|
970 | | | | | | |||
|
971 | +-------------------------------------+ | |||
|
972 | ||||
|
973 | In version 1, the delta is always applied against the previous node from | |||
|
974 | the changegroup or the first parent if this is the first entry in the | |||
|
975 | changegroup. | |||
|
976 | ||||
|
977 | In version 2, the delta base node is encoded in the entry in the | |||
|
978 | changegroup. This allows the delta to be expressed against any parent, | |||
|
979 | which can result in smaller deltas and more efficient encoding of data. | |||
|
980 | ||||
|
981 | Changeset Segment | |||
|
982 | ----------------- | |||
|
983 | ||||
|
984 | The *changeset segment* consists of a single *delta group* holding | |||
|
985 | changelog data. It is followed by an *empty chunk* to denote the boundary | |||
|
986 | to the *manifests segment*. | |||
|
987 | ||||
|
988 | Manifest Segment | |||
|
989 | ---------------- | |||
|
990 | ||||
|
991 | The *manifest segment* consists of a single *delta group* holding manifest | |||
|
992 | data. It is followed by an *empty chunk* to denote the boundary to the | |||
|
993 | *filelogs segment*. | |||
|
994 | ||||
|
995 | Filelogs Segment | |||
|
996 | ---------------- | |||
|
997 | ||||
|
998 | The *filelogs* segment consists of multiple sub-segments, each | |||
|
999 | corresponding to an individual file whose data is being described: | |||
|
1000 | ||||
|
1001 | +--------------------------------------+ | |||
|
1002 | | | | | | | |||
|
1003 | | filelog0 | filelog1 | filelog2 | ... | | |||
|
1004 | | | | | | | |||
|
1005 | +--------------------------------------+ | |||
|
1006 | ||||
|
1007 | The final filelog sub-segment is followed by an *empty chunk* to denote | |||
|
1008 | the end of the segment and the overall changegroup. | |||
|
1009 | ||||
|
1010 | Each filelog sub-segment consists of the following: | |||
|
1011 | ||||
|
1012 | +------------------------------------------+ | |||
|
1013 | | | | | | |||
|
1014 | | filename size | filename | delta group | | |||
|
1015 | | (32 bits) | (various) | (various) | | |||
|
1016 | | | | | | |||
|
1017 | +------------------------------------------+ | |||
|
1018 | ||||
|
1019 | That is, a *chunk* consisting of the filename (not terminated or padded) | |||
|
1020 | followed by N chunks constituting the *delta group* for this file. | |||
|
1021 | ||||
877 | Test list of commands with command with no help text |
|
1022 | Test list of commands with command with no help text | |
878 |
|
1023 | |||
879 | $ hg help helpext |
|
1024 | $ hg help helpext |
General Comments 0
You need to be logged in to leave comments.
Login now