How much grow a repository
Martin Geisler
mg at aragost.com
Wed Feb 15 12:32:57 UTC 2012
"Gaunet Sylvain (ASTEK)" <Sylvain.Gaunet at cnes.fr> writes:
> Hello,
>
> I would like to know how grow a repository in order to understand what
> spaces could I liberate if I delete some versions.
You cannot really delete changesets (versions) in Mercurial. You can
only append data to a repository. This implies that you can remove the
most recent changesets (like everything after version X), but you cannot
easily delete (or collapse) older revisions.
> The space taken is the delta compressed between the two versions ?
>
> I could approximatively calculate it by doing this :
> diff -r SRC-1.0 SRC-2.2 | gzip - > DIFF; du -ms DIFF
>
> So the spaces I could liberate is like :
> Hg diff -r 1.0 -r 2.0 | gzip - > DIFF; du -ms DIFF
>
> Is it approximatively correct ? it seems to be.
Things like renamed files would confuse the diff computation above. I
would suggest comparing repositories instead. Prepare two clones with
the 1.0 and 2.2 sources:
hg clone -U -r 1.0 . ../foo-1.0
hg clone -U -r 2.0 . ../foo-2.0
then compare the size of the foo-1.0/.hg and foo-2.0/.hg directories.
That tells you exactly what the deltas between 1.0 and 2.0 cost you in
terms of disk space.
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://www.aragost.com/mercurial/customer-projects/
More information about the Mercurial
mailing list