11

After reading many introductions, starting guides, and documentation on SVN, I still cannot figure out where is my versioning data stored. I mean physically. I have over EDIT [1/2 GB] of code checked in, and the repo is just a few MB large. This is still Voodoo for me. And, as a coder, I don't really believe in Magic.

EDIT : A contributor stated that not all the code was stored in the repo, is that true ? I mean, if I delete my local working copy I still can get back my source code for the repository... If so, I still can't understand how such a compression can occur on my code...

EDIT 2 : When I import the code into repository I have the message "50MB uploaded" and the actual repo is much smaller. Compression Algos must be involved.

BTW, It's funny to read some answers and see how many people DO Indeed believe in Magic, and use SVN without REALLY Knowing what goes on behind the scenes...

Mehdi LAMRANI
  • 11,289
  • 14
  • 88
  • 130
  • 8
    Do you really have 10 GB of code? That is a HUGE amount of code, likely larger than all the source code that goes into MS Windows. I simply don't believe that size. – abelenky Jan 17 '11 at 19:56
  • Physical location is wherever the computer is located on which the database resides... – JasCav Jan 17 '11 at 19:58
  • 3
    I'm surprised by how many people have this answer wrong. The .svn folder is NOT where the server stores its files (because that is local to the machine - nobody else would be able to check out that information), and, while SVN only stores the diffs (assuming FSFS), it has to store the originals SOMEWHERE. – JasCav Jan 17 '11 at 20:02
  • @abelenky: svn isn't just for code files. You can add anything thing in the repository, which if the OP is adding images or installers can get up to pretty big size, but yeah 10GB is still hugh. – VoodooChild Jan 17 '11 at 20:03
  • @abelenky : The project is a huge framework including 100+ big projects. But yet, Sorry for the 10GB, 70% of it is Visual Studio Performance Report Data that is of course unversioned – Mehdi LAMRANI Jan 17 '11 at 20:34
  • 2
    My guess, 70% is perf data, the other 29.99% is in 'obj' and 'bin' directories. leaving you with the 10mb of actual code checked in ;) – csharptest.net Jan 17 '11 at 20:52
  • @csharptest-net : Hell you're right ! Dumb Me... A WindDirStat Tool Analysis confirmed that. Would you post your comment as an answer so I mark it answered ? And could you confirm that Subversion does not only saves diffsin the repo but original code too, as JasCav commented it ? – Mehdi LAMRANI Jan 17 '11 at 20:58
  • @JasCav : So original code AND diffs are stored in the repo huh ? Makes Sense... But I have the message 50MB uploaded after importing code and the repo is smaller... – Mehdi LAMRANI Jan 17 '11 at 21:01
  • 3
    @Mika - SVN uses a lot of compression algorithms and various techniques and does not necessarily store your data byte for byte within the repository. That may be why you are seeing a difference in size. – JasCav Jan 17 '11 at 21:03
  • @JasCav : Would you please compile your comments (including your answer to fardjad) and quote csharptest's comment too in an Answer so I mark it as answered ? – Mehdi LAMRANI Jan 17 '11 at 22:06
  • @Mika Jacobi - Added as an answer, per your request. – JasCav Jan 17 '11 at 22:14

7 Answers7

7

It depends on what you're using for your Subversion server. I use VisualSVN Server, and it saves the repository files in c:\Repositories.

jrummell
  • 42,637
  • 17
  • 112
  • 171
6

Putting this as an answer, per Mika's request:

I'm surprised by how many people have this answer wrong. The .svn folder is NOT where the server stores its files (because that is local to the machine - nobody else would be able to check out that information), and, while SVN only stores the diffs (assuming FSFS), it has to store the originals SOMEWHERE.

Of course, as @csharptest.net said: "My guess, 70% is perf data, the other 29.99% is in 'obj' and 'bin' directories. leaving you with the 10mb of actual code checked in." So you're not actually checking in all that information anyway. Most of it never enters the repository. In addition, SVN uses a lot of compression algorithms and various techniques and does not necessarily store your data byte for byte within the repository. That may be why you are seeing a difference in size.

If you're interested in reading more of how SVN works, read about it at this Stackoverflow answer.

Hope that helps!

Community
  • 1
  • 1
JasCav
  • 34,458
  • 20
  • 113
  • 170
3

Your svn repository is stored in a folder in the filesystem, it should contain sub-folders like: conf, dav, db, hooks, locks. These folders make up the repository.

There's an svnadmin tool you can use to manage the repository.

Craig
  • 4,323
  • 2
  • 29
  • 32
1

It's stored in the filesystem. Exactly where depends on how the system was set up. Also, when you create a new repository, it can be anywhere on your filesystem. Your install will have a default location, but creating a new repo can be done anywhere, do you may have to look around to find the actual path.

This is done in the command line version like so:

svnadmin create d:/path_to_repository 

In the above example, the repository is stored in "d:/path_to_repository "

Also, when looking at the mount of code you have in your local machine, are you filtering out content that does not go into the server? You should have a global ignore list to exclude items that have no business in source control. (user-changed content, usually compiled projects, etc.) You may be overestimating the actual size of your repository.

David
  • 72,686
  • 18
  • 132
  • 173
1

Why don't you check out a new working copy, build there, and verify that everything still works? We can all write answers here and guess how many % might be where, but in the end, you should still check that everything that needs to be added to Subversion is.

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
  • You are right. And before asking I usually assert this kind if things, and yes, I had checked out on another developer workstation and everything works just fine. – Mehdi LAMRANI Jan 17 '11 at 22:03
0

I realize this is an older thread, but after reading it, I thought I'd throw in my $.02.

Contributing factors to a large local file set in a working copy are:

  • As mentioned, the working copy meta/state-data lives in the hidden (by default) .svn directories. While the meta data is pretty small, for each file in the working copy, there is a working copy baseline. This will simply double the disk space consumed for any file that lives in the repository.

  • If your repository includes any copied paths (typical in the case of branches or tags) you could end up with many times the physical space used. This is because the real space used in an SVN repository for a "logical" copy is tiny. It's really just a pointer back to a particular revision of the source path. You could duplicate your entire repository with a copy operation that results in new repository data of only a few hundred bytes (this is also why any copy operation takes the same, short amount of time). Yet, when you check out or update the working copy it could be twice as big as before you copied it. This is typically why one would use a switch operation to change a working copy over to a branch or tag of a logically copied path instead of recursively checking out an entire repository from its root.

I too have been very impressed by how compactly SVN stores and transfer its repository data.

Peter
  • 1,488
  • 2
  • 17
  • 23
-2

Hidden .svn folder in each versioned folder.

Maciek
  • 19,435
  • 18
  • 63
  • 87
  • 2
    @Eric Gagnon: the .svn is for state tracking on client and is not the svn repository itself. – tawman Jan 17 '11 at 20:02
  • 2
    @Eric - Because that is not the repository. It's metadata, but not the actual repository files. (I am not the downvoter in either case, but the answer is incorrect.) – JasCav Jan 17 '11 at 20:03
  • Ok... I thought that's what Mika was asking for ("Subversion Database" and "versioning data"). I just misunderstood the question then. – Hilydrow Jan 17 '11 at 20:06
  • yes, you're all correct - if the OP would like to see how it works behind scenes then they might wish to install an svn server - such as Visual SVN server (easy to manage + free) and see for themselves :) – Maciek Jan 17 '11 at 21:57