问题
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.
回答1:
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.
回答2:
You might find Mercurial author Matt Mackall's paper on the revlog format interesting.
回答3:
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.
来源:https://stackoverflow.com/questions/1270470/how-does-mercurial-compress-files-in-repository