Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine total size of SVN directory/trunk

Tags:

svn

download

size

Is there a way to count/calculate the total size of a svn directory if you were to checkout a revision?

I have limited internet downloads so I need to know how big something is before I go and download it.

Thank you.

like image 847
Adam M-W Avatar asked Nov 16 '09 07:11

Adam M-W


People also ask

How do I find the size of a file in svn?

Name. svnlook filesize — Print the size (in bytes) of a versioned file.

What does .svn folder contain?

svn folder, the . svn folder contains a folder titled pristine which contains copies of your current project. I have no use for these copies which take up a ton of space, and reducing the size of my project will also reduce the time it takes to compile.

How do I check svn repository?

Check out files from Subversion repositoryIn the Get from Version Control dialog, click Add Repository Location and specify the repository URL. Click Check Out. In the dialog that opens, specify the destination directory where the local copy of the repository files will be created, and click OK.

What is checkout depth in svn?

SVN checkout has a handy --depth with the following options (from the documentation): --depth empty : Include only the immediate target of the operation, not any of its file or directory children. --depth files : Include the immediate target of the operation and any of its immediate file children.


2 Answers

This is my modification to the answer. It reports how many files are below a certain directory in svn and the total size.

svn list -vR svn://svn/repo/subdir|awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/(1024*1024)" MB" "\nnumber of files= " i/1000 " K"}' 
like image 61
Nico Hailey Avatar answered Sep 21 '22 04:09

Nico Hailey


Using the below, you can determine the size of individual files.

svn list --verbose --recursive http://svn/repo/path 

Maybe you can look around this command to find a way?

like image 22
Dan McGrath Avatar answered Sep 19 '22 04:09

Dan McGrath