What is Subversion?
Subversion (svn) is a revision control software, or version control system (VCS), that is "essential for the organization of a project and helps developers collaborate". It is a centralized model, with a reference copy of the code in a central repository on the KNMI server. The repository keeps track of code changes with revision numbers, so you can always retrieve, compare and/or merge different revisions (versions) of the code.
Developers and end users get first an initial copy of the code on their client machine (this is known as checkout). Then, in a typical workflow, a developer modifies his/her copy, and once satisfied with his/her changes, he/she commits (checkin) these changes to the central repository, so all others developpers can benefit from the new code by updating their copy. To benefit from changes that others have checked in, you simply update your copy.
Workflow can be more elaborate with branching, merging, and resolving conflicts.
It is important to keep in mind that a VCS is no substitute for communication. In the contrary, user communication is a critical factor in avoiding conflict, and sharing development.
A word of caution about terminology : the notion of project for svn refers to an ensemble of files and directories below a top directory. In TM5, we have projects that are code variations/extensions on top of the base code. Since you can checkout a subset of an svn project, you can end up with several svn projects and several TM5 projects with more or less overlap. To avoid confusion, we use here the word project only to refer to the TM5 projects.
For more introductory material, you can check the "software carpentry" entry on VCS: Software Carpentry VC notes.
For learning subversion, we can recommend the SVN Red Book.
Getting access to the repository
To get access, you need a username and password that can be obtained after contacting one of our administrators. These credentials will let you
- visit the repository through a web interface, and
- use the subversion software to get a copy of the code, and commit your own code to the repository
At some location, subversion accesses internet over a proxy. Ask your administrator for details on how to set up your connection. Next is the example of the ECMWF gateway.
Proxy set up: example of ecgate at ECMWF
To access the subversion server at KNMI from the 'ecgate' computer at ECMWF, first check if the following file exists:
If not, run 'svn help' to create one. Add the following lines at the end of the file (in the [global] section) :
http-proxy-host = proxy.ecmwf.int http-proxy-port = 3333
First time connection to KNMI-SVN server
The first time you try to use svn (for example on ECMWF ecgate machine), you may get an "error" like :
Error validating server certificate for 'https://svn.knmi.nl:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: svn.knmi.nl - Valid: from Nov 30 00:00:00 2009 GMT until Nov 29 23:59:59 2012 GMT - Issuer: TERENA, NL - Fingerprint: ab:47:53:94:cb:de:7b:5......... (R)eject, accept (t)emporarily or accept (p)ermanently?
You must accept permanently. Then enter your password. However, the server may first assume that your KNMI-SVN user id is the same as your client id (ECMWF id for example). So it will not work, and will ask a second time, now asking for both user id and password. Enter your KNMI-SVN ones, and you are all set.
You can have a look at the TM5 code in the repository through a user-friendly web interface:
or through the development portal:
If you click on any of the 5 (or 10) last commits, you can get a related diff, highlighted with colors. This is also available for all commits through the "Timeline" link (or "view all revisions" button).
Following the "browser" link, you can navigate the tree structure of the entire TM5 repository.
- the web interface is convenient for peeking at the code and the
latest commits, but is NOT used to get a copy of the code or run any svn command.
- the web interface  is only for your browser!
Scripts, and svn commands entered at the shell prompt, must use https://svn.knmi.nl/svn/TM5 (note the switch from usvn to svn) when the repository URL is needed.