Skip to content

Subversion

Aim: Explain the use of Subversion at Nikhef and how to enable it in HDLworks EASE

Target Audience: Users of Subversion who can not migrate to Gitlab.

Introduction

Subversion is a legacy version control system; some applications at Nikhef still use it because for one reason or another they cannot migrate to Git.

If you found this page because you were looking for a version control system for your work, see Gitlab instead.

Subversion (or svn) is supported on all platforms and by most developer tools and environments, including HDLworks EASE. The instructions below describe how to set up access to the service on Windows and Linux.

Instructions

CT Subversion service

The CT Subversion service can be found at

svn+ssh://svn.nikhef.nl

It currently offers the svn+ssh protocol only, for both internal and external users. There is also read-only support using viewvc:

http://svn.nikhef.nl/viewvc
Finally, read-only access to the Subversion repositories is available from within the Nikhef networks via

http://svn.nikhef.nl/ro/et

Access for different users and groups

Access to the CT Subversion service is controlled using special subversion accounts for each project or group. For example, for the Electronics Technology (ET) group a special user etsvn was created. Those members of the ET group that require access need to have a special LDAP attribute set, which the Helpdesk can do for you. The attribute is:

etSubversionUsers

Non-Nikhef employees can also get access to the CT Subversion service as long as a Nikhef employee will sponsor them. These external users will then receive a very limited account (called an affiliate account), which will grant them access to the Subversion service only.

Platform support

  • Windows
  • Linux

Installation

The most commonly used Subversion client for Windows is TortoiseSVN. It is freely available and it in turns makes use of the freely available PuTTY SSH client.

In order to set up Subversion access we need to

install PuTTY Download the latest version of PuTTY and extract all files into a single directory. It is easiest if this directory is added to the Windows PATH. In this example the files were extracted to C:\Utils

generate a PuTTY Privatekey file using PuTTYGen.exe An SSH public/private key-pair is by far the easiest method to access the CT Subversion service (as well as some other CT services!).

  • For this, we need to set up such a public/private key-pair once. This is done using the PUTTYGEN.EXE executable. Launch it:

  • Click on the 'Generate' button and move the mouse

  • Once the generation is complete, fill in the description, choose a passphrase (password) and save the PuTTY private key by clicking on 'Save Private key'.

In this example the PuTTY private key was saved as 'etsvn.ppk' - If you wish to use this same SSH key on Linux, export it as an OpenSSH private key as well (Conversions->Export OpenSSH key):

In this example the OpenSSH private key was saved as 'etsvn' . Similarly the public key was saved by clicking on the 'Save Public key' button.

Notes - PuTTY does not need the OpenSSH public or private key files. - Leave the PUTTYGEN application running, we will need it later on.

configure the PuTTY Pageant (the Windows ssh agent) The PuTTY Pageant (PAGEANT.EXE) is (roughly) the Windows equivalent of the Linux ssh-agent process. Launch it, after which is normally nestles itself into the Windows taskbar.

  • Open it by right-clicking on it:

and select the 'Add key' menu item. - A prompt will pop up, asking you to select the PuTTY private key file:

Note: it is possible to specify keys on the command-line or inside a short-cut icon so that one or more keys are automatically loaded when the Pageant start. - Enter the passphrase for the PuTTY private key:

  • If the key was loaded successfully it will appear as if nothing happened. Right-click on the Pageant icon again and select 'View keys' to bring up the keys loaded into the Pageant:

In this example, the second key marked 'ET SVN Access' is the key that was generated in the previous step of this example.

add the SSH key to your Nikhef SSO account (also for external users!) In order to use your SSH key with the CT Subversion service you must add your SSH public key to your Nikhef SSO account. This can be done as follows: - Browse to

https://sso.nikhef.nl

  • Click on 'Change your configuration' then log in using your SSO credentials:

  • After successfully logging in, first switch back to the PUTTYGEN application and select the 'Public key for pasting in OpenSSH authorized_keys file':

Use Ctrl+C to copy the public key. - Now paste (Ctrl+V) this key into the SSO 'chsh' page, fill in your SSO password again and click OK:

Note as you can see in the example above it does not really matter if you remove the comment string (ET SVN Access) or not.

  • Your SSH key is now being processed. It can take up to ten minutes before the CT Subversion service picks up this new key:

install TortoiseSVN TortoiseSVN is available for both 32bit and 64bit Windows.

Download the latest version of TortoiseSVN and install it just like any other Windows package (Note: you will need Administrator privileges for this!)

  • Run the install package:

  • Make sure the command line tools are also installed:

This is needed for EASE for Windows.

configure TortoiseSVN to use svn+ssh using PuTTY If TortoiseSVN is properly installed then there is only one step required to make use of the PuTTY key generated and loaded previously.

A system environment variable needs to be set, so that the TortoiseSVN subversion tools will pick up the right SSH executable. Adding a Windows environment variable is different for each version of Windows, here are the screenshots for the nearly-obsolete Windows XP:

  • right click on the 'My Computer' icon and select 'Properties'
  • click on the tab 'Advanced' and then select the button 'Environment variables':

  • A new window will pop up. Click on 'New' to add a new environment variable:

IMPORTANT NOTES - The name of the environment variable is case sensitive: SVN_SSH - The value of the environment variable is full path to the TortoisePlink.exe executable, with Windows backslashes ('\') convert to forward slashes ('/')! - Do not use the PuTTY PLINK.EXE executable as you will see DOS boxes pop up many times every time you check in or check out code from subversion

  • After clicking OK the list of user environment variables is updated:

TortoiseSVN is now configured to use svn+ssh!

Test everything - Make sure the PuTTY pageant is running and that the right Privatekey is loaded - Open the Windows explorer and create a new directory where you want to check out a project - Right-click on this directory and select 'SVN Checkout'. If this option is not present then you did not install the TortoiseSVN Explorer integration - Check out the project of your choice:

The URL: of the repository for ET users is

svn+ssh://etsvn@svn.nikhef.nl/<project name>
- Click OK and watch magic happen - If the checkout went OK you will see the following screen:

  • Your Windows explorer screen will now show that the directory is managed using Tortoise SVN:

  • Next, open a command prompt and verify that a checkout on the command line also works:

Setting up Subversion on Linux is quite easy; just make sure the package 'subversion' is installed and/or that the command 'svn' can be found in the system's path.

SSH access using an OpenSSH public/private key-pair is much more common on Linux, but it depends on your Linux distribution how well it is integrated into your desktop environment.

Generate an OpenSSH public/private key-pair - To generate a new OpenSSH public/private key-pair, use the following command. More information on SSH can be found on the dedicated documentation page

$ ssh-keygen -b 1024 -t rsa -C "ET SVN Access" -f ~/.ssh/etsvn
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/janjust/.ssh/etsvn.
Your public key has been saved in /home/janjust/.ssh/etsvn.pub.
The key fingerprint is:
14:27:0b:36:e8:07:89:a4:dd:0a:87:62:b1:2e:6b:92 ET SVN Access
The key's randomart image is:
+--[ RSA 1024]----+
| o.. o+ o .      |
| ++.+. o =       |
|=oo...  o        |
|+o .. ..         |
|...  .  S        |
|.o               |
|E.               |
|o                |
|                 |
+-----------------+
- To use this key, make sure that the ssh-agent process is running and then type

$ ssh-add ~/.ssh/etsvn
Enter passphrase for /home/janjust/.ssh/etsvn:
Identity added: /home/janjust/.ssh/etsvn (/home/janjust/.ssh/etsvn)
- You can verify that the key is loaded using

$ ssh-add -l
1024 61:0e:91:ad:8c:41:6b:c0:66:b0:68:d6:b2:e8:7a:af /user/janjust/.ssh/id_rsa (RSA)
1024 14:27:0b:36:e8:07:89:a4:dd:0a:87:62:b1:2e:6b:92 /home/janjust/.ssh/etsvn (RSA)
- Find the OpenSSH public key

$ cat ~/.ssh/etsvn.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA5WyUdm+ZOJfShgaEB/zDO5LqWzSyl95N738HBnN1p0McAz
zK5Gr9oRH0BmnFjjCIgsHBw6B+0gTuimOMMo5i2FWWbipLURxtVr4pCOZlET4/hoegey+fUomS2bsgLbRw
ni6LnrEWcb61p564PvdyWLA8TwoM8FbwbeNMieaQf/c= ET SVN Access

Add the SSH key to your SSO account Add this new SSH public key to your SSO login information. Screenshots on how to achieve this are listed under the Windows tab. The same procedure applies to Linux and macOS.
Test subversion access Now verify that you can check out a Subversion project using the new key

$ svn co svn+ssh://etsvn@svn.nikhef.nl/project3
Checked out revision 0.

Usage

Setting up a new Subversion repository

Setting up a new Subversion repository is quite easy:

  • log in on the subversion server svn.nikhef.nl (this is restricted to special users)

  • choose or use a common directory where the Subversion repositories for your group are located, e.g. for the Electronics Group the directory

/project/et/svn
is used.

  • make sure you have write access in this directory

  • now go to this directory and create a new repository:

$ cd /project/et/svn
$ svnadmin create <NameOfRepository>
where <NameOfRepository> is the name for your new Subversion repository

  • make sure that the directory is group-writable so that the Subversion generic user account (e.g. etsvn for the Electronics Group) has access:
$ chmod -R g+w /project/etc/svn/<NameOfRepository>

Setting up a new Git repository

Setting up a new Git repository is similarly easy:

  • log in on the git/subversion server svn.nikhef.nl (this is restricted to special users)

  • choose or use a common directory where the Subversion repositories for your group are located, e.g. for the Electronics Group the directory

    /project/et/git
    
    is used.

  • make sure you have write access in this directory

  • now go to this directory and create a new directory:

$ cd /project/et/git
$ mkdir <NameOfRepository.git>
where <NameOfRepository.git> is the name for your new Git repository

  • change to this directory and create a new Git repository
$ cd /project/et/git/<NameOfRepository.git>
$ git init --bare
  • make sure that the directory is group-writable so that the Git generic user account (e.g. etgit for the Electronics Group) has access:
$ chmod -R g+w /project/etc/git/<NameOfRepository.git>

Adding access control

As owner of the repository you can control access to the repository. You can allow or restrict access to different parts of projects within a Subversion repository. The files

<NameOfRepository>/conf/svnserve.conf
<NameOfRepository>/conf/authz[.txt]
are used to control access. It is easier (mostly for Windows users) to add an extension to the authz file so that it is easier to edit on Windows. For this, the svnserve.conf file needs a minor modification:

#### Uncomment the line below to use the default authorization file.
authz-db = authz.txt
A modified version of this file can be found in

/project/et/svn/svnserve.conf
The authz.txt file can now be edited using any text editor.

Integration with other software

Subversion support is available in many applications, which is one of the main reasons to offer Subversion as a version control system next to tools like 'git'.

Enabling Subversion support in Ease

Ease is an HDL Entry tool by HDL Works. It is currently used by the ET group for design and verification purposes.

It is possible to add versioning to an Ease project, using either CVS or Subversion. This page explains how to set up Subversion versioning support for both EASE on Windows and EASE on Linux.

For this example EASE v8.0rev8 on Windows XP was used. A newer version of Windows should be used, of course, but here an older version is used to show that it can also support Subversion versioning.

Enable Subversion support First, if you have not already done so, configure Subversion support in Ease: - Go to menu Options->User Options - Click on the item Versioning in the list on the left. A new window will pop up: - Enable the tick mark in front of 'Configure for Subversion support' - Click 'OK'

Start or load a project Now, make sure a project is loaded or start a new project. If not, then the required menu option for setting up Subversion access is not enabled (You don't want to ask how long it took to figure this one out).

  • Once a project is loaded, the menu option File->Subversion->Create Project should now be available. Choose this option. Ease will now ask you which Subversion repository to use for your new project. If you need to set up a new Subversion repository, then do that first. See Setting up a new Subversion repository for details.

  • For the Subversion repository, fill in

svn+ssh://etsvn@svn.nikhef.nl/<NameOfSvnRepo>
and choose a name for your project (in the screenshot below MyWinProject was chosen):

Note: Do not add a slash at the end of the Subversion repository path

  • Ease will now set up the necessary files in the Subversion project. If all goes well it will ask for the name of the workspace to save the project in:

  • Once the project is set up and saved the status window will show the following message in the console part of the screen:

Checking the status You can verify that an Ease project is managed using Subversion by looking at the window title bar and by hovering over the project name:

For this example EASE v7.4rev9 on Linux was used. A newer version is available (see the Windows tab) but here an older version is used to show that it also supports Subversion versioning.

Enable Subversion support First, if you have not already done so, configure Subversion support in Ease: - Go to menu Options->User Options - Click on the item Versioning in the list on the left. A new window will pop up: - Enable the tick mark in front of 'Configure for Subversion support' - Click 'OK'

Start or load a project Now, make sure a project is loaded or start a new project. If not, then the required menu option for setting up Subversion access is not enabled (You don't want to ask how long it took to figure this one out).

  • Once a project is loaded, the menu option File->Subversion->Create Project should now be available. Choose this option. Ease will now ask you which Subversion repository to use for your new project. If you need to set up a new Subversion repository, then do that first. See Setting up a new Subversion repository for details.

  • For the Subversion repository, fill in

svn+ssh://etsvn@svn.nikhef.nl/<NameOfSvnRepo>
and choose a name for your project (in the screenshot below NewProject was chosen):

Note: Do not add a slash at the end of the Subversion repository path, as both Ease 7 and Ease 8 will coredump with

ease: subversion/libsvn_subr/path.c:368: svn_path_dirname: Assertion `svn_path_is_canonical(path, pool)' failed.
Aborted (core dumped)

  • Ease will now set up the necessary files in the Subversion project. If all goes well it will ask for the name of the workspace to save the project in:

  • Once the project is set up and saved the status window will show the following message:

Checking the status You can verify that an Ease project is managed using Subversion by looking at the window title bar and by hovering over the project name:

Troubleshooting

Troubleshooting Subversion support in Ease can be quite a hassle. Here's a list of things to try:

  • first check that (password-less) svn access is working. See the Installation section for details

  • launch Ease from a terminal or console window. Check for any messages on this console window when trying to create a new Subversion project

  • On Windows, check how many plink.exe processes are running. If this number is high (or increasing) then most likely there's a problem with either the PuTTY link and/or with the command line svn tools.