Remote repositories

Since [r140] you can use Retrospectiva together with remote repositories. This is a short HOWTO about setting-up Retrospectiva with a repository stored at Google-Code.

Requirements

  • Subversion v1.4 (or greater)
  • Retrospectiva development version (trunk), [r140] or higher

First of all, Retrospectiva is generally incapable of handling remote repositories. This has one reason: remote requests simply take too long. Each time someone is accessing a repository node in your Retrospectiva installation, Retrospectiva would have to make a HTTP request to a remote repository, which is (of course) much, much slower than accessing a repository stored on the local hard drive.

Nevertheless, there still exists a simple way to use Retrospectiva with a remote repository. The following description is only an example which is based on my own personal setup.

Since my small web-server (the one which is hosting Retrospectiva) in not very reliable, I decided to outsource the code repository of Retrospectiva to Google Code to enhance the availability. To be able to use Retrospectiva with this remote repository, I use a tool called svnsync (comes bundled with subversion v1.4 or higher) to a maintain a private mirror of this repository on the hard disk of my web-server. Retrospectiva wraps the svnsync functionality in a Task to keep the local mirror up-to-date.

Create a repository mirror

Let’s assume that the remote repository URL is http://retrospectiva.googlecode.com/svn and the local repository should be stored in the following path: /var/svn/retrospectiva. First of all we need to create the new local repository using the following command:

svnadmin create /var/svn/retrospectiva

To enable synchronization we need to enable the pre-revprop-change hook by executing

cat <<'EOF' > /var/svn/retrospectiva/hooks/pre-revprop-change
#!/bin/sh
exit 0
EOF

and then we need to make it executable

chmod +x /var/svn/retrospectiva/hooks/pre-revprop-change

Please note that this is a very basic approach, so please refer to the Subversion documentation if you have special requirements for your hooks.

Now the only thing left to do is to initialize the repository for remote synchronization by calling

svnsync init file:///var/svn/retrospectiva http://retrospectiva.googlecode.com/svn

Configure Retrospectiva to perform the synchronization automatically

First of all, login as an administrator and go to Admin/Setup. In the Repositories section you need to define the path Retrospectiva should look for svnsync (usually /usr/bin/svnsync).

Next, go to Admin/Repositories, select (or create your repository), point the path to your local repository (in my case: /var/svn/retrospectiva) and check the Use svnsync check box. Optionally you can also specify additional parameters for svnsync (e.g. username/password options, etc.).

Last, go to Admin/Tasks and make sure the interval for the Sync repositories task is set-up correctly.

That’s it!