Rafael Piccolo
Rafael Piccolo

Reputation: 2338

How can I measure the disk space growth rate of a Mercurial repository?

I think our repo is growing too fast because of some binary files that are tracked by mercurial. Can I get some kind of statistics like the rate of growth by day, or by week?

One of my tries was exporting the changesets of a day to a folder and check the size, but that's very laborious, isn't there a better way?

Upvotes: 0

Views: 316

Answers (2)

Stephen Rasku
Stephen Rasku

Reputation: 2682

I would just clone your repository as a certain revision (e.g. -r 10) and then pull incrementally (i.e. -r 20, -r 30, etc.). Measure the disk usage of your cloned repo after each step and you can see how it has grown.

This will give you a pretty rough estimate. You can refine it to be more accurate to give you growth per day, week, or whatever by doing an hg log -d in the original repo to get the specific revisions.

Upvotes: 2

Tim Delaney
Tim Delaney

Reputation: 5605

Simplest way would be to just track the total size of the .hg/store directory over time. You might want to do all of .hg, but depending on your extensions you may well have things in there that aren't really part of "the repository" (for example, hg-git will put an entire bare git repository in .hg/git).

Upvotes: 0

Related Questions