From MozillaWiki
Jump to: navigation, search
Ambox outdated.png THIS PAGE MAY BE OUTDATED
This article is in parts, or in its entirety, outdated. Hence, the information presented on this page may be incorrect, and should be treated with due caution until this flag has been lifted. Help by editing the article, or discuss its contents on the talk page.

Subversion (SVN) is the version control system used on most of the Mozilla websites. The Mozilla repository is available at There is also an alternative view which provides RSS feeds and other information at

Repository Structure

The repository is laid out, generally, as follows:



  • $project is the project name (defined later)
  • trunk is the "root branch"/trunk

Remora/Addons3 is being developed in /addons; Mozilla Labs projects will go in labs/$projectName.

The goal is to not pollute the / namespace with too many individual projects.

How to get an account

SVN account for general access

File an IT ticket with your username on the SVN server and which project you’re working on.

Follow the procedure to gain access to commit.

How to connect


  • Install Mac OSX Developer Tools (XCode)
  • use svn from the command line using command line arguments
  • if you want to use ssh, make sure your ssh key is installed in ~/.ssh

Instructions coming soon for non-Developers. Mac OS Developer Tools comes with subversion, but a self-service system with instructions for Non-Developers is in the works.


Get PuTTY and TortoiseSVN.

  • Don’t just download the PuTTY exe, use the installer package - it contains Pageant which you need and PuTTYgen which you may need to convert your SSH key.

Fire up Pageant. Right click on the icon in your system tray and click "add key." browse too your private key and select it.

Right click on the icon in your system tray and select "new session."

  • Host name =
  • Port = 22
  • Protocol = SSH

Connection -> Data

  • Auto-login username = your email address

Connection -> SSH -> Auth

  • Browse to your private key for authentication

Go back to session, enter a name for your session (mozillasvn is good) and click save.

Click Open to test the connection. You should get something like:

Using username "yourname@youremail.tld".
Authenticating with public key "name-of-your-key" from agent
Last login: last login date

If you get that far, things are good, type exit and terminate the connection.

TortoiseSVN -> settings -> Network. Make it an empty box where it asks you to specify the SSH client. I’m not sure why I did this, but it works for me.

SVN checkout from svn+ssh://nameofyourputtysession/addons/

(I think this needs to be:

svn+ssh://nameofyourputtysession/projects/<your project>

--Johnjbarton 12:03, 14 July 2008 (PDT))

If this doesn’t work, hop on IRC and we’ll see what we can do for you. If you work out more solutions, please add them to this page.


Install a package that works for you. If you’re on debian or ubuntu ‘apt-get install subversion’ will handle all this for you.

  • You could simply use your LDAP username/password to checkin/checkout to svn over https. If you'd rather use ssh, then the following entries in your ~/.ssh/config file will make life easy. Replace with your e-mail address.
~ $cat ~/.ssh/config 
~ $

How to Use SVN

Subversion is designed so that a conversion from CVS is as painless as possible. This is a short introduction to some basic commands - please read the "Notes" section below for more useful links.

checkout (co)


Usage: svn co source dest

SVN bases its repositories on URLs, so to check out code, you’ll need a URL. For example, to checkout the code for or anonymously you could type:

svn co
svn co

or if you have an account with an SSH key:

svn co svn+ssh://yourusername(see note below)
svn co svn+ssh://yourusername(see note below)

Your username is usually your email address. In case you experience errors when using more than one ‘@’ sign in the repository URL, make sure you encode the @ sign in the email address as %40.

or if you want to use https:

svn co
svn co

You'll be prompted for your username and password.

commit (ci)


Usage: svn commit [file [file...]]

By checking out over ssh, you’ll be able to commit your changes.

Once your code is checked out, you can commit your changes back to the repository. This command takes an optional list of files or directories to commit, if you only want to commit some changes. An example:

svn commit

If you’d like to add a comment and commit all in one line, you can try this command:

svn commit -m "Commit message here"



Usage: svn diff [file [file...]] > patch

If you do not have an account, you can still make a patch to submit in a bug.

This command takes a list of files or directories. An example:

svn diff . > wholedir.patch



Usage: svn status [file [file...]]

Regarding commands, this is one of the largest differences from CVS. Instead of having to update your tree to check the status of files, SVN has this command which will list the differences without affecting your files. See the status documentation page for what the letters mean.

svn status



Usage: svn update [file [file...]]

This will pull any new changes from the repository and merge them into your local files.

svn update


This is a really brief overview, and if you’d like further reading, please check out the following:

As of April 2007, webdav is available over https.

How to browse the repositories through the Web

Viewvc can be quite useful for browsing sources and seeing changes.

See also

  • Mercurial, Mozilla's version control system for the source code of most of its software products.
  • Template:SVN to create a link to a version in Subversion