Contents
Welcome to Trac2SVN, this guide quickly runs through a typical installation. For more detailed instructions, please refer to the other documentation included with this product. For a Linux installation, simply replace all references to c:\Program Files with /opt (or /usr/local if you prefer) and use a terminal window where it refers to 'DOS' below.
Prerequisites
Before you start make sure you have the following setup and available:
- A Trac Server that you can administer
A Subversion Server with authentication enabled
- At least one Client machine
- A machine to run the Trac2SVN Server (if desired, you can use the Trac Server machine).
- Note that the Trac Subversion plugin requires the Subversion repository and the Trac server to live on the same host
Request a License
Unpack the zip file on the machine that you are planning to use as the Trac2SVN Server and run the Clearvision\tools\get_license_info program in a DOS command window. Send the information requested to sales@clearvision-cm.com to apply for a license.
Linux prerequisites
The client executable uses GTK+ on linux, so you might need to install this, for example on CentOS 5 or RHEL 5:
yum install gtk+
(If you see an error with libgmodule.so missing while trying to run the client, then gtk+ is not installed on your system)
Setup Trac
Install XML-RPC Plugin
Trac2SVN requires the XML-RPC plugin for Trac. The plugin and installation instructions are available at http://trac-hacks.org/wiki/XmlRpcPlugin.
Install & Configure Trac2SVN Server
On your Trac2SVN Server machine:
Unpack the zip file into C:\Program Files.
Edit Clearvision\trac2svn\server\trac2svn_server.cfg using Wordpad (not Notepad) and configure the following parameters with values according to your setup.
The trac_server setting must provide the full path to the Trac project you would like to connect to. The trac_query setting defines a Trac-style query in the usual format. The special string CV_CURRENT_USER will be replaced with the user running the query at run time. This allows you to create queries that produce results depending on the user committing a change.
[Trac] trac_query=owner=CV_CURRENT_USER&status!=closed trac_server=http://trac.mycompany.com:8080/myproject [License] company_name=Your Company Plc licence_email=admin@yourcompany.com expiry_date=2009-12-31 users=999 license_key=PLEASE_ADD_YOUR_LICENCE_key_HERE license_certificate=PLEASE_ADD_YOUR_LICENCE_certificate_HERE [Server] server_ip=192.168.1.2 server_port=54326
- open a DOS command window, go to the server directory, then start the server (make it executable first on Linux), eg:
cd c:\Program Files\Clearvision\trac2svn\server trac2svn_server.exe
check the TRAC2SVN.log file in the server directory for any errors (an empty file indicates no errors).
Install & Configure Trac2SVN Clients
On each of the machines that Trac2SVN users will be working:
unpack the zip file into C:\Program Files.
edit Clearvision\trac2svn\client\trac2svn_client.cfg and configure the following parameters with values according to your setup:
[Trac] trac_uid=joe_bloggs trac_password=my_secret_password [Server] server_ip=192.168.1.2 server_port=54326
if your login id is different to your Subversion user id, also set svn_uid, eg:
[Options] svn_uid=joe_bloggs
open a DOS command window in the client directory and start the client (make it executable first on Linux), eg:
cd c:\Program Files\Clearvision\trac2svn\client trac2svn_client.exe
check the TRAC2SVN.log file in the client directory for any errors.
Install & Configure Subversion Hooks
On your Subversion Server machine:
Unpack the zip file into C:\Program Files.
Copy all of the files from Clearvision\trac2svn\subversion_hooks into the hooks directory of your Subversion server.
- On Linux, make all of the hook scripts executable (ie everything except the config file)
Edit the config file (trac2svn_hook.cfg) that is in your Subversion hooks directory and configure the following parameters with values according to your setup, for example, if your Trac2SVN Server is at IP address 192.168.1.2 and is licensed for port 54326:
[Server] server_ip=192.168.1.2 server_port=54326
Test it!
Now that you have:
- Configured Trac for Trac2SVN
- Started a Trac2SVN Server
- Are running at least one Trac2SVN Client
- And have installed all of the Trac2SVN hook programs into your Subversion repository
you are ready to test the system by committing a change to Subversion. On the machine that is running the Trac2SVN Client:
- Check out a working copy from your repository
- Make a change to a file
- Commit that change as the user id you configured for this client (eg joe_bloggs above), eg
svn commit myfile.txt --username joe_bloggs
You should see the Trac2SVN client GUI popup to allow you to select the list of issues that were resolved by this change. Select one and select OK to close the popup window.
Verify Results
To check that Trac2SVN worked fully, open up the ticket you selected and see the comment with a link to the changeset associated with the ticket. Then, check the link back to Trac in Subversion by looking at the 'clearvision:change_id' revprop with this command:
svn proplist -rHEAD --verbose --revprop .
Copyright (c) 2009 Clearvision CM All Rights Reserved Registered in England No. 5643578 VAT Registration No. UK881364801 Registered Address Laurel Farm, Winters Hill, Durley Southampton, SO32 2AH