I'm seeing that mercurial efficiently compresses the files in repository
(repo/.hg/store/data)
Does anybody know what kind of compression is used for repository files?
Thanks.
I'm seeing that mercurial efficiently compresses the files in repository
(repo/.hg/store/data)
Does anybody know what kind of compression is used for repository files?
Thanks.
Initial versions of files are compressed using deflate (same algorithm as zip), but for updated files, Mercurial stores only a (binary) diff against a previous version.
It also tries to do the right thing: When a deflated JPEG turns out bigger than the original, it will not store it "compressed", for example.
There are two levels of compression in Mercurial repositories: delta storage, and zlib compression.
In addition, various other parts employ also compression. For example, bundles can be compressed with both gzip and bzip2, as can archive tarballs - but I don't think you were asking for these.
You might find Matt's paper on the revlog format interesting: http://mercurial.selenic.com/wiki/Presentations?action=AttachFile&do=view&target=ols-mercurial-paper.pdf