How To Use SVN Repositories
Introduction
Two kinds of source repositories are hosted at opensolaris.org: centralized and distributed. The centralized source management model uses the Subversion (SVN) source control management program. Repositories managed in a distributed fashion will be avaiable via the Mercurial source control management program. This document describes Subversion.
How to install Subversion
Subversion is available via OpenSolaris and Solaris Express (build 62 or later).
How to get commit access to opensolaris.org SVN repositories
Developers with commit rights will access repositories through their opensolaris.org accounts. Commit rights are managed by Project Leaders. If you do not have an account, sign up to acquire one. Additionally, you will have to provide a Secure Shell (SSH) public key.
How to set up an SVN repository
The creation of an SVN repository on opensolaris.org is done through the webpages. You have to be a project leader to create a new repository.
On the main page for a project, there is an item called "SCM Console". This item will lead you to the SCM configuration page. Choose "Create Repository". You will be asked to provide a name for the repository, a notification email address, the repository type (Subversion in this case), and whether anonymous access is allowed or not. Click the "Create" button to add the repository. After the repository has been created successfully, a short summary of the repository name and properties will be shown. You can click the name of the repository in this summary to add/remove committers.
The URL for the repository will be of the format
svn+ssh://user@svn.opensolaris.org/svn/projectname/reponame
Where "projectname" is the name of your project and "reponame" the name of the newly created repository. "user" is an opensolaris.org username.
If you are creating a repository that you want to populate with a pre-existing SVN repository, the repository contents must be manually uploaded at the moment. Please send email to tools-discuss@opensolaris.org:
- Use the subject line: "Repository load request".
- Include details of the dump location.
- Note the name of the repository into which the contents should be loaded.
How to get started with SVN
Let's assume that your opensolaris.org user id is "joe", and that you have been given access to a repository called "repo" in the project "software".
The first thing you should do is to check out a copy of the repository, even if it is still empty. The command to do this would be:
svn co svn+ssh://joe@svn.opensolaris.org/svn/software/repo
This will create a checked out copy of the repository in a directory called "repo", in your current working directory. If you're working with an already populated repository, the checkout command mentioned above will have pulled over a copy of the repository. The best starting point for further steps is to start reading the SVN reference book at the guided tour, and look at the "Initial Checkout" section.
If you just created the repository, it'll be empty, so the first step is obviously to start adding source code. For an existing source tree that is not yet in the repository, the normal way to put it into an SVN repository is to use the import command. Read the the guided tour in the SVN reference book, but ignore references to the svnadmin create command, since you already have an existing repository.
Proxies
If you are behind a firewall that requires that SSH connections be tunnelled through a SOCKS proxy, then your $HOME/.ssh/config file needs to contain a directive like:
Host *.opensolaris.org
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect -h [socks proxy address] %h %p
Sun employees should note that proxying should no longer be used from Sun's internal network. If you have ssh configured to use a proxy, you will eventually start seeing timeouts or other errors as the proxies are being decommissioned.
More Information
For detailed information on SVN, see the SVN reference book.