aka SVN. A source code version control system to
replace CVS. It is available as source or as binaries for 11 different operating
systems. Subversion fixes many of the infuriating CVS problems e.g.
- Subversion versions not only file contents and file existence, but also
directories, copies, and renames. It versions directories as well as files. This
means you can delete and restore directories. You don’t have to keep dead
empty directories around forever as in CVS. It also means that Subversion keeps
track of the history of the renaming of a file. In CVS renaming looks like the
deletion and creation of a new file with no record of the connection.
- Lack of atomic commit. With Subversion, no part of a commit takes effect until
the entire commit has succeeded. Revision numbers are per-commit, not per-file.
This especially important with flaky dial up connections. Also someone fetching
while you are saving won’t get an inconsistent set of files.
Eclipse is still using CVS, but gradually the world is flipping over to
Subversion. You can monitor the trend looking at which repository the various
open source projects use.
There are five ways to access the Subversion server:
| Ways to Access the Subversion Server |
| Protocol |
Notes |
| file:/// |
Direct repository access (on local disk) |
| http:// |
Access via WebDAV protocol to Subversion-aware Apache server over the
Internet |
| https:// |
Same as http://, but with SSL encryption |
| svn:// |
Access via custom protocol over port 3690 to an svnserve server. Subversion
runs as a Windows service. |
| svn+ssh:// |
Same as svn://, but through an SSH tunnel |
There are also groups who will host your Subversion project for you if you use
one of the official open source licences. See distributing
Java Source for details.
When you install Subversion, it uses three directories:
- C:\Users\user\AppData\Roaming\Subversion for
the configuration files.
- F:\Program Files\CollabNet Subversion Server for the
program files.
- F:\svn_repository for the repository files.
The server has no UI other than the config files. To control it you need some
sort of client, e.g svn, svnadmin, Tortoise SVN.
There is no step-by-step set of instructions to install a simple system. They
want you to understand it in fullness before you use it. Here is an abbreviated
get started instructions:
- Download and install the Subversion server, the appropriate binary. Set it up
for purely local access.
- Download and install Tortoise SVN client.
- Go to F:\svn_repository in my computer.
- Right click to wake up Tortoise, then create the repository files.
- Edit the config file. In particular set up these
fields:
- Go into IntelliJ Idea and use Import into Subversion to make a snapshot of your
development files in subversion. If you don’t have Intellij, do this with
Tortoise.
- Use Tortoise to browse the repository using the URL file:///F:/svn_repository
- Then you must check out to a directory where you can then start editing the
files. You must checkout even though there are no changes from the ones imported.
The catch is this will capture all your files. There is no point in capturing
class files, jars etc since they can easily be recreated from source code. I
have not yet learned to teach Subversion to avoid capturing class files.