Thorough RevlogNG Format Specification
Benoit Boissinot
benoit.boissinot at ens-lyon.org
Thu Nov 5 04:50:35 CST 2009
On Wed, Nov 04, 2009 at 07:05:16PM +0100, William Ledoux wrote:
> Hi everyone,
>
> I am doing a C++ program that directly read the RevlogNG files (eg.
> 00changelog.i) and I did not find an exhaustive RevlogNG Format
> Specification. I have several questions:
>
> * I found by looking at revlog.py, that sometimes, the data may be
> compressed, and that you could notice it by looking at the first char of the
> data. [1]
> So I used zlib to decompress the data when the first char was 'x', but *I
> did not understand what the 'u' compression type was for*.
u+text -> text is already uncompressed
x+text -> decompress(x+text) with zlib
\0+text -> \0+text is already uncompressed
>
> * I found that the changelog data should provides the following pieces of
> information in this order: "nodeid, user, date, branch, modified files,
> comment" [2]
> But, when decompressing, * I sometimes have some bytes instead of the
> committer name*, *and I did not manage to find what this bytes **are **
> exactly** standing for*.
> I found that the first one was often one of 0x53 0x55 0x57 0x47 0x37 which
> seems like a bifield (?), and that 0x55 seemed to mean that the user was the
> same as the previous node.
> The same thing also happens sometimes between modified file names.
> Am I on the right track ? Is there a documentation somewhere describing this
> compression ?
Hum, do you handle the binary patching? The closest thing I could think
of is the dict found between the date and the modified files.
>
> * About the first bytes of the files, I found that the four bytes are used
> to store the RevlogNG version, and some flags [3].
> I think that the first word (bigendian) is for the version and the second
> (bigendian) is for the flags, and that one flag is "inline" [4]
> I also found that "inline" means that small RevlogNG index and data are
> compacted into a single .i file instead of a .d file for data and a .i file
> for headers. [5]
Unsure what your question is.
>
> Could all these pieces of information that I found here and there be added
> to the RevlogNG Wiki page in order to ease some future work ?
Please feel free to expand/correct the RevlogNG page when appropriate,
it's a wiki. If you're unsure, you can ask for a review here or on IRC.
regards,
Benoit
--
:wq
More information about the Mercurial
mailing list