Is it possible to determine the Working Copy size before checkout?
I would like to see if the working copy will fit onto my hard drive and don't want to waste time and bandwith.
So my question is: Is it possible to determine th开发者_开发技巧e size of the working copy before checkout?
I do have access to the repository, but its filesize does not say anything.
The working copy will be a little larger than twice the size of the respective files in the repository, because it stored the pristine version of each in the .svn
subdirectories. (It stores other admin data too, like properties, but this should not amount to much.)
You want some way of listing the files in the repository (from the subtree you want to check out), with their size, and summing it up. I do not think the svn
command line tool does this directly, but it will do it for each file:
svn ls -v -R file:///d:/svn/edmund/fs/trunk
2891 edmund Oct 23 2009 ./
2867 edmund 140 Aug 14 2009 Makefile
2883 Edmund 12869 Oct 15 2009 block.c
2883 Edmund 9817 Oct 15 2009 file.c
2883 Edmund 7572 Oct 15 2009 fs-internal.h
2884 edmund 6845 Oct 16 2009 fs.c
2891 edmund 1407 Oct 23 2009 fs.h
2891 edmund Oct 23 2009 linux/
2867 edmund 208 Aug 14 2009 linux/Makefile
2891 edmund 6684 Oct 23 2009 linux/main.c
2882 edmund 4822 Oct 15 2009 notes.txt
2891 edmund 7408 Oct 23 2009 operations.c
2891 edmund 3834 Oct 23 2009 special.c
2880 edmund Oct 01 2009 test/
2869 edmund 695 Aug 16 2009 test/Makefile
2880 edmund 11220 Oct 01 2009 test/operations-test.c
2877 edmund 3826 Aug 20 2009 test/tree-test.c
2883 Edmund 23413 Oct 15 2009 tree.c
2883 Edmund Oct 15 2009 win/
2883 Edmund 28590 Oct 15 2009 win/main.c
You could sum these manually, or pipe to a scriptlet that will sum all the values in columns 12-26 (e.g.).
Using TortoiseSVN I can see the size of files in the repo. but not of directories. That might help.
Because of my reputation I cannot comment Edmund's answer.
I usually use below pipe to calculate the size of content in some path (in this case trunk/project) on our Subversion server:
svn ls -vR file:///path/to/repo/trunk/project | awk '{if ($3 != "") sum+=$3; i++} END {printf "\n%s: %.0f\n%s: %.0f %s","files qty",i,"wc size",sum/1024/1024/1024,"GB"}'
But in case of a working copy you must also include the size of the .svn directory that a checkout will also produce. In my case a fresh working copy puts twice that much to .svn. So for 10GB of content I plan 20GB of disk space for a working copy plus some for future needs.
You cannot know the size before hand. If you know someone who has checked it out then you could ask them..
精彩评论