Is it possible to analyze the size of a SubVersion repository?

The only thing that comes into my mind is this:

  • create a temporary new empty repository

  • svnadmin dump the old repository, filter it to retain just a single project with svndumpfilter, and import it into the new repository

  • look at the size of the new repository, then delete it


I used this recently but changed it slightly to be more accurate

svn list -vR svn://server/repo/somedir | awk '{tmp=match($3,/[0-9]/);if(tmp){sum+=$3; i++}} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'

I used

{tmp=match($3,/[0-9]/) 

instead of if

($3 !="")

as it gives a more accurate file count


If you use the -r option, you can specify a revision.

For example, revision 1000:

svn ls -vR -r 1000

Size of the repository can be found using the following command ..

Though this doesn't produce the exact results all the time, I found this to be helpful most of the times.

svn list -vR svn://server/repo/somedir | awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'.

If you have access to the server terminal you can use du (disk used):

du -sh /var/svn-repos/project-doomsday

that gives you the total amount of space used by that repo on the server, including the usually small database.