Home > Articles > Programming > Java

Mastering Subversion in the Eclipse IDE

  • Print
  • + Share This
CVS is cool, but Subversion is cooler. If you're using Eclipse, though, you couldn't take advantage of Subversion until recently. With the advent of Subclipse, Subversion can finally be used to its full effect from within your Eclipse IDE environment.
Like this article? We recommend

Introduction to SCM and Subversion

Software configuration management (SCM) is the fine art of keeping source code warm and safe, sharing it with other team members, and protecting it from our own blunders. With a good SCM process, you can easily keep track of releases and new development branches, which makes it much easier to identify and fix bugs in shipped products.

A large number of SCM tools are available, both open source and commercial, such as StarTeam, Perforce, BitKeeper, and ClearCase. In the open source world, the de facto SCM standard is Concurrent Versions System (CVS), which is used around the world for thousands of open source and commercial projects. However, CVS has a number of deep-rooted flaws, which make it less than perfect for modern development projects:

  • Essentially designed for text files, CVS handles binary files very poorly. Binary files are transmitted and stored in their totality at each commit, which represents a waste of both bandwidth and disk space.
  • In CVS, you can’t move files and directories. Your only option is basically to delete and re-add them, losing all the file history in the process.
  • CVS has no notion of atomic commits. Say you commit 10 files to the server, and the commit operation stops halfway through the process. (This can happen quite easily if someone commits a file at the same time, or even if your network fails or your PC reboots.) In this case, the server will have recorded only half of your modifications, leaving the code base in a potentially unstable state.

Subversion is a relatively recent open source SCM tool that was designed from the ground up to overcome the limitations of CVS. It is a finely designed tool with many new features adapted to modern development:

  • Commits are atomic. The repository is not updated unless all the committed files can be incorporated correctly in a new revision, and each new revision is made up of only the changes in a single commit. (No one else’s changes can slip in unnoticed.)
  • Subversion uses a cunning binary diff on both text and binary files, which optimizes both network traffic and repository disk space.
  • In Subversion, each revision represents a copy of the entire directory tree at a point in time. Files and directories can be moved around without limitation.
  • Subversion stores only the delta between each version, which saves disk space, and also means that tagging a new version or creating a new branch is virtually instantaneous.
  • You can access a Subversion repository in a variety of ways, depending on your needs: using HTTP or HTTPS with WebDAV, using the fast proprietary svn: protocol, or directly via the local file system.
  • + Share This
  • 🔖 Save To Your Account