开发者

SVN repository size relative to committed binary files

开发者 https://www.devze.com 2023-03-28 01:20 出处:网络
In an attempt to better understand how SVN handles binary files I tried a little experiment.I was hoping to find that SVN would recognize the same binary in different locations and not create multiple

In an attempt to better understand how SVN handles binary files I tried a little experiment. I was hoping to find that SVN would recognize the same binary in different locations and not create multiple copies of the same file. What I found raised more questions than it answered. I'm hoping there's an SVN expert out there who can help me understand this.

Note 1: MyTest.dll is 2,108 kb

Note 2: I realize that SVN is doing some compression behind the s开发者_JS百科cenes, it still doesn't explain the results.

Here's the experiment:

1.) I created a new repo

2.) I added MyTest.dll to trunk & committed -> repo size = 66 k

3.) Added /1/ and /1/MyTest.dll & committed -> repo size = 735 k

4.) Added /2/ and /2/MyTest.dll & committed -> repo size = 2 mb

5.) Added /3/ and /3/MyTest.dll & committed -> repo size = 2.1 mb

6.) Added /4/ and /4/MyTest.dll & committed -> repo size =3.4 mb

Can anyone out there explain why the change in repo size with each commit appears so random relative to the actual content of the commit?

Thanks!


No, it won't search whole repository (which may be gigabytes) to see if the file already was commited.

Only if you svn copy the file within the repository, new copy won't be introduced.


Repo's grow quite large (even if you only work on a small number of files) because all the changes for each commit are saved so that you can always revert to an older file at any time. There's a lot of information that SVN and related tools keeps around for housekeeping and caching/indexing of files as well that tends to take up space. Depending on how many files are changed per commit is usually what the increase in size of the repo will be because these commit "patch" files are created internally so that SVN knows what exactly the changes were which allows for the revert feature to work all the way back to commit 1. It's hard to explain really where a lot of the rest of the space that is being used is being filled with as I use git most of the time and git tends to have sometimes smaller repo's but it might just be internal stuff that SVN uses for its functionality. I hope this helps clear some things up.

0

精彩评论

暂无评论...
验证码 换一张
取 消