Subversion FAQ

This is a (very) basic guide to Subversion, the source code management tool used to control the GNOME repository, targeted both at new contributors and contributors used to the former system, CVS.

For a more in-depth guide, see http://developer.gnome.org/tools/svn.html.

Getting Started

There are some different ways of accessing the GNOME source code repository listed below. As you may be able to notice, they are almost identical to their CVS equivalents, providing the same functionality.

Online Browsing

Online browsing has been available for a long time and although it is not too useful for development, it is useful for people only taking a look, or those who prefer its interface, or any other reason someone may have. It is now available at http://svn.gnome.org/viewcvs/, and works just like it used to before the migration to Subversion.

Anonymous Checkout

With AnonymousCVS, people who did not have accounts could set their 'CVSROOT' environment variable to :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome, where anoncvs.gnome.org was one of the GNOME CVS mirrors. This is, of course, also available with Subversion.

Below is an example:

$ svn checkout http://svn.gnome.org/svn/gnome-terminal/trunk gnome-terminal
A    gnome-terminal/AUTHORS
A    gnome-terminal/configure.in
A    gnome-terminal/src

What is being done above is checking out the good old gnome-terminal module. Now, some explanations about the command line. svn is the Subversion command line client tool, which you will use for most (if not all) of the operations. checkout is the command (action) you want to perform, and can be used interchangeably with co in case you want something shorter to type. http://svn.gnome.org/svn/gnome-terminal/trunk is the URL for what I want to check out. Breaking it into pieces:

Finally, the last gnome-terminal is the local path to which it will be checked out. If the current directory were /home/gnomedev, the contents of http://svn.gnome.org/svn/gnome-terminal/trunk would have been put in /home/gnomedev/gnome-terminal.

Developer checkout

Exactly as per anonymous checkout, but use a 'svn+ssh' URL, like the following:

svn+ssh://yourlogin@svn.gnome.org/svn/modulename/trunk

If things don't work, check the SSH connection first. It must be using at least one of the SSH keys for your GNOME account in the LDAP server.

$ ssh -v yourlogin@svn.gnome.org
...

The output of this may give you a clue. If the output doesn't make any sense to you, cut and paste a copy to svnmaster@gnome.org, and we'll attempt to help you interpret the output, check any potential server side issues and assist you as appropriate.

SSH newbies: If you see an message such as the following, it is a perfectly normal part of the SSH connection. It just means that your SSH client has never connected to this SSH server before and it would like you to confirm that the identification string (fingerprint) the server is presenting is authentic (i.e. not an imposter/man-in-the-middle attack). Most normal people will just say 'yes' here, and it will add a line to your ~/.ssh/known_hosts file, so that on the next connection it will know from the known_hosts file and won't need to ask for confirmation. Some people (not many) even bother to check the fingerprint. It is currently as below.

The authenticity of host 'svn.gnome.org (82.211.81.213)' can't be established.
RSA key fingerprint is 0a:c8:87:02:4a:0f:5e:18:c8:e5:9a:9e:40:00:8c:f6.
Are you sure you want to continue connecting (yes/no)? 

Jhbuild

If you are a developer who already has an account you should use:

repos['svn.gnome.org'] = "svn+ssh://yourlogin@svn.gnome.org/svn/"

If you want to check out anonymously you should use:

repos['svn.gnome.org'] = "svn://anonymous@svn.gnome.org/svn/"

Possible errors

svn: MKACTIVITY of '/svn/...': 403 Forbidden (http://svn.gnome.org)

You are trying to commit something to an anonymous checkout. Use the developer checkout instead (svn+ssh://). You can use 'svn switch' to convert an existing checkout - no need to re-checkout. The following example of the use of the 'svn switch' command will convert your anonymous checkout to a developer checkout. (Make sure to change yourmodule and yourlogin, the command should be on a single line):

$ svn switch --relocate http://svn.gnome.org/svn/yourmodulename svn+ssh://yourlogin@svn.gnome.org/svn/yourmodulename

svn: Can't write to connection: Broken pipe

If you get this error, disable ControlMaster for svn.gnome.org. Example

# this is ~/.ssh/config
Host svn.gnome.org
    # User <your_user_name>
    Compression yes
    CompressionLevel 3
    ControlMaster no

Note that you should set User to your GNOME username. This would allow you to use svn+ssh://svn.gnome.org/svn/$MODULE/trunk $MODULE.

svn: REPORT of '/svn/build/!svn/vcc/default': 400 Bad Request (http://svn.gnome.org)

You are getting this error because you are behind a proxy server which is blocking svn http extensions. Ask your network administrator to allow svn extensions in the proxy server. In squid, it's enough to add this line in squid.conf:

extension_methods REPORT MERGE MKACTIVITY CHECKOUT

Migrating from CVS

Could someone write some simple idiot-proof instructions on how to switch from working with CVS to SVN? For example, will I need to check everything out all over again, or is there a way of switching what I currently have locally? -- JoachimNoreiko

Why Subversion?

After the transition was ready to happen and was announced, some people enquired why we were switching from CVS, and why switching specifically to Subversion. Below is an attempt to list most of the reasons that led to the choice of Subversion as a replacement for CVS after nearly 10 years.

First of all, Subversion is an SCM designed to be an easy replacement for CVS, while addressing some of its shortcomings. With this, we get rid of most limitations we had been facing and working around for a long time, while not changing the way of thinking considerably, resulting in a migration that impacts contributors the least possible, while also benefiting all of them.

SubversionFAQ (last edited 2009-03-28 10:55:25 by AndreKlapper)