Using Subversion, where is “actual” source code stored

svnversion control

I'm just getting used to Subversion and I have a fundamental question about versioning.

I've created my SVN repository on a server "S" hosted in my network. Assuming I "import" code, files, directories, etc. from another computer "A" in the network, it gets added to my server's SVN repository.

I do a checkout from another computer "B" in the network and I can get all the code from the repository and so on.

Assuming I format or destroy PC "A", would my source code still be available through a checkout in B?

If yes, when I actually browse into my repository folder on the server, I don't find a replica of the folder, only the configuration, db, etc. directories. Where is the data physically stored on the server S, if it is there at all? Currently, the directory size of the repository is clearly much smaller than the source code folders.

I think VSS keeps a copy of the actual code in some unrecognizable db format, git has the option of not requiring to do this. Does SVN also maintain a copy of the code somewhere?

Best Answer

When you commit changes to your repository, they will be stored on server S inside your subversion repository. The repository is actually constructed of a series of deltas stored inside the db/revs folder - changes from one version of the repository to the next. As such, the repository on the server will not resemble the structure of your source code. SVN repositories are versioned as a whole - any change within the repository increases the version of the repository.

You can recreate your source code by checking out a clean copy of the repository from the subversion server onto any machine.