Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does mercurial compress files in repository?

Tags:

mercurial

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.

like image 599
Valentin V Avatar asked Aug 13 '09 07:08

Valentin V


People also ask

What does hg commit do?

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. When all heads of a branch are closed, the branch will be considered closed.

What does hg update do?

Update sets the working directory's parent revision to the specified changeset (see hg help parents). If the changeset is not a descendant or ancestor of the working directory's parent and there are uncommitted changes, the update is aborted.


2 Answers

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.

like image 56
Martin v. Löwis Avatar answered Sep 28 '22 16:09

Martin v. Löwis


You might find Mercurial author Matt Mackall's paper on the revlog format interesting.

like image 43
Steve Losh Avatar answered Sep 28 '22 15:09

Steve Losh