Hello there. Are you confused about subversion or SVN? Lets first see what exactly this SVN or Subversion is. SVN is version control system used to keep tracks for software version source code. Great thing about SVN is that its Open Source, which means it is free. But being free is not the only merit of subversion. The main reason for bringing SVN to existence was to manage source files and directories. In order to keep copies of every change made to source file, subversion is used. SNV is a version control system that means all version are tracked and copies are maintained. Well, one can argue that why would we need it when we can simply create a back up for each file. Before subversion was created, that was the only way to keeping all the chronicle copies of source code files. For the time being, it was a good solution to save previous data and gain rollback ability if something goes wrong, but those were simpler times too. There would be a small team of programmers working in a small room perhaps. Communication wasn’t really a problem. With the time passing, the process of programing grew complex. Software began to grow more complex. Numbers of programmers involved in a project also increased. Soon enough even the location of those programmers began to scatter and synchronization began to suffer. A need of a tool that could synchronize arose. Today no matter where you go, every company is using such synchronization tool.

Before we see how powerful SVN is, let’s take a look at the history of SVN. It was developed by CollabNet, Inc in 2000. CollabNet were trying to find an alternate or replacement to Concurrent Versions System (CVS). CVS was also a version control system but there were some visible limitations.
Some of them were as below.

  • The revisions were created by commit per file instead of whole project. If you have 5 files and you commit them all, you will have 5 revisions instead of 1
  • CVS would not version any file or directory name change
  • CVS would not version symbolic links
  • CVS would not allow atomic commits.

So CollabNet found themselves in need of a better version control system. CollabNet hired Karl and Ben Collins for this project of new version control system. With all the traditional strength of CVS but none of its obvious flaws, Subversion or SVN was released on 31st August 2001. Even after going through all that trouble and making all that efforts, CollabNet decided to keep SVN free. You are free to download, modify and redistribute SVN on your own accords.

 

SVN Basic architecture
SVN Basic architecture

Now let’s see how SVN works in terms of version controlling. SVN keeps all its files stored on a server available to all who has access to them. Since everything is on a single server, everyone can get same latest updated copy and unless it’s a human mistake, nothing can go wrong. Everyone can work on same code and project can move on smoothly. Generally, the SVN system holds 3 main directories. Branches, Tags and Trunk. Branches is the directory where the source files resides for working. Any complete or work in progress codes resides in this directory. in Tags directories, all the version files resides which are tested and are in working condition or in other words, they compile without errors. This version files are like milestones. they represent a completed state of a segment of the project. Finally the trunk, which is the most important part, holds the completely compilable source code of whole project that may not be able generate desirable result but is able to run without any errors. Branches directory has workspace for each coder working on the project but they all share same Trunk. All of their codes gets merged in the trunk. SVN is a smart system and is able to merge code from different coders, but this merging can sometimes generate conflicts, although nothing that can not be solved. SVN is great tool to keep your source code synchronized and updated.

 

SVN workstyle

SVN workstyle

Finally, we will go through few of the SVN’s major points.

  • Atomic Commits – That means when SVN commits, it commits all of the changes or none of them. That way there is no chance of data correction.
  • Directory version – Unlike CVS, SVN tracks not only files but also directories as well.
  • Version metadata – It not only source but also tracks down the meta data as well which are properties, keys and value.
  • Full revision – SVN retains full revision for every file renamed, copied, moved or deleted
  • Reversed checkouts – SVN can lock files that can not be merged

Well, that’s it for now. I hope I was able to help you understand basic structure and working style of SVN. Please feel free to leave a comment or any suggestion.