Skip to main content

Posts

Showing posts with the label Subversion

Sound advice for a source code commit frequency

A colleague of mine commented recently in a discussion on how often one should commit their source code: commit on keyup     - always tends to keep everything as up to the minute as possible Classic! and yes it was tongue in cheek advice!

How to install a specific version of a Debian package using apt-get

At work we use a backported version of Subversion as the stable package is 1.1.4 and I wanted to install the latest one we could get a package for which was version 1.3.2. Along with the backported Subversion package is a package that contains a number of useful hook scripts called subversion-tools. When I did an apt-get install subversion-tools Debian wanted to install the 1.1.4 stable release not the 1.3.2 backported release. By doing an apt-cache show subversion-tools I was able to see the two available packages. These are the steps I went through to install the backported version of subversion-tools, although these steps will work when installing any specific version of a Debian package. Before you install a specific version of a package you need it's complete version. This will be displayed when you run: apt-cache showpkg <package name> e.g. apt-cache showpkg subversion-tools > Package: subversion-tools > Versions: > 1.3.2-5~bpo1(/var/lib/dpkg/status) >...

Using cvs2svn to migrate your repository from CVS to Subversion

This week I migrated our codebase from CVS to Subversion! I'd previously downloaded the Tigris cvs2svn migration tool onto my build server, read the documentation and performed a test run of the migration last week so I was pretty confident that I would have no problems. These are the steps that I took to perform the migration: Notes: For simplicity I'll assume that your CVS repository root is /cvs and your Subversion directory is /svn . The cvs2svn tool creates a new Subversion repository when you run the cvs2svn migration tool. Log in to the build server (a Debian Linux box) as root Change directory to /cvs and find the name of the module you want to migrate to a Subversion repository, I'll use the module old in my example. Choose a suitable name for your new Subversion repository (it doesn't have to be the same name as the CVS module) I'll use new in my example. Run the following command, (it's best to redirect it's output to a log file to so you c...

How to restore a deleted and committed directory in CVS

I had to put my CVS administrator hat on this morning when a colleague realised that yesterday he had managed to delete and commit a directory full of files by accident. We needed to roll-back the clock to yesterday afternoon so to speak but CVS doesn't really give you any handy tools to do this. I first logged onto the CVS server and browsed to the relevant directory (on the server the directory and files are not deleted, just marked as so) and took a look inside one of the ,v text files to find the time when the commit happened (where the file's state changed from Exp to dead ). After a bit of searching I found a very clear set of instructions on the Ximbiot CVS Wiki that detailed how to restore a deleted directory . I followed those instructions and brought the directory (and files) back to life again! Technorati Tags: CVS , Andrew Beacock

Using Apache to display a list of available Subversion repositories

If you have setup Apache to be able to serve multiple Subversion repositories from one parent Subversion path then you are probably wondering if there is a way to display the list of repositories available in that parent directory. By default Apache will give you a 403 permissions error reporting: 403 Forbidden You don't have permission to access /parent-subversion-directory on this server. To enable the repository listing you need to use the SVNListParentPath option (see "Listing available repositories in mod_dav_svn (server)" under "Enhancements and Bugfixes" in the 1.3 release notes) in the Apache virtual host setup. Note: this will only work in Subversion 1.3 and higher. Edit your Subversion Apache configuration file to add the SVNListParentPath On line, an example is given below: # Subversion <Location "/svn"> DAV svn SVNParentPath /svn SVNListParentPath On SVNIndexXSLT "/svnindex.xsl" </Location> If yo...

How to switch your working copy when the Subversion repository URL has moved

If you followed my previous post on Supporting multiple Subversion (SVN) repositories with Apache you may have noticed that I moved the repositories from: http://some-url/a http://some-url/b to: http://some-url/svn/team-a http://some-url/svn/team-b If you had a working copy checked out of either of these Subversion repositories then you would have received an error when attempting an update due to the repository being moved since you checked out the code. You need to update your working copy to point to the new repository but maintain any local changes that you might have made - my colleague Guy Francis pointed out that you use the svn switch command to do this. Here is how you update your working copy's repository URL: Change directory so that you are inside the working copy Run svn switch --relocate http://some-url/a http://some-url/svn/team-a . This will go through the whole directory structure updating the source URL to point to the new location, the --relocate option force...

Supporting multiple Subversion (SVN) repositories with Apache

My previous posts about Subversion on Debian Linux ( installing , configuring , backported packages ) showed how I installed and configured my local repository that I use for my home projects. I also used these tutorials when installing Subversion at work. After creating a couple of repositories for different teams (all within the base /svn directory) I noticed that my Apache configuration file was starting to look a little repetitive: # Subversion - team A <Location "/a"> DAV svn SVNPath /svn/team-a SVNIndexXSLT "/svnindex.xsl" </Location> # Subversion - team B <Location "/b"> DAV svn SVNPath /svn/team-b SVNIndexXSLT "/svnindex.xsl" </Location> I plan on creating at least two more repositories for other teams and so this was repetition was starting to bother me. A colleague pointed out that SVNParentPath (scroll about 1/4 down) should be the solution. I rewrote my conf file to be the following...

Problems with Trac and backported Subversion on Debian Linux

After installing the backported package of Subversion last week and importing a pre-existing codebase into it I decided that now was a good time to put Trac on the server. Following my previously blogged Trac installation & configuration guides I was able to get Trac up and running fairly smoothly with one small problem: the "Browse Source" button was failing reporting some issue with "svn" being an unknown repository type. After some searching and thinking I realised that this was most probably due to conflict between the newer backported version of Subversion and the older Python Subversion bindings libraries. Here's how I resolved this issue: apt-get remove python2.3-subversion apt-get install python-subversion Refreshed my browser and everything worked correctly! Technorati Tags: Andrew Beacock , Trac , Subversion , Python , Backports , Debian

Installing Subversion 1.3.2 using Backports on Debian (Sarge) Linux

Following on from my previous posts about installing Subversion from source, here are some notes on how to do it using backported Debian packages . Add the following lines to your sources.list file in /etc/apt: # backports deb http://www.backports.org/debian sarge-backports main contrib non-free Update your Apt sources list: apt-get update Uninstall any old Subversion packages: apt-get remove subversion apt-get remove libsvn0 Install Subversion with 1.3.2 as a specific version (this causes the backported version to override the stable version): apt-get install libsvn0=1.3.2-5~bpo1 apt-get install subversion=1.3.2-5~bpo1 Check that the installed Subversion is the right one by using svn --version you should get something like: svn, version 1.3.2 (r19776) compiled Aug 12 2006, 12:05:49 ... Install the Apache2 Subversion modules: apt-get install libapache2-svn=1.3.2-5~bpo1 Follow my instructions on Configuring Subversion (svn) on Linux (Debian Stable) . There you go! Technorati Ta...

Upgrading Subversion (svn) to 1.3.2 on Linux (Debian Stable)

I upgraded my Subversion repository tonight from 1.2.1 to 1.3.2 and it was an absolute breeze! I followed the Subversion installation instructions that I've blogged about before (using the newly downloaded 1.3.2) ignoring the bit about installing Apache. Ran through the usual Linux make, make install stuff, restarted Apache and accessed the repository browser webpage which displayed the updated version number at the bottom. Couldn't have been simpler! Technorati Tags: Subversion , Debian , Linux , Andrew Beacock

Creating a dummy Debian package for Subversion (svn)

Since I've installed Subversion , I've been looking around for a good wiki and ticket management system so that I can get the whole 'development environment' setup on my home server. I installed Wikipedia 's MediaWiki at work, after our Instiki wiki came unstuck and left me with a whole load of nothing after it decided to stop writing archives to disk for about 5 weeks! MediaWiki is a little heavyweight for what I need, so I started to look around. I noticed on the Ruby on Rails website that they had a pretty simple ticket system , and after some investigation it turned out to the the open source Python-based Trac . Trac also has a rather pretty Subversion repository browser so it seemed perfect for the small home projects that I want to develop. I went to 'apt-get' Trac on my Debian Stable server, only to find that it wanted to install Subversion as a dependency even though I had a later version installed from source. The Debian package management sys...

Configuring Subversion (svn) on Linux (Debian Stable)

My last post documented how to install Subversion. This post will cover the resulting configuration of Apache, plus the creation of the initial repository. When you install Subversion, it adds two LoadModule lines to /etc/apache2/httpd.conf . This is not wanted as the Debian version of Apache2 installs things slightly differently from the default Apache (httpd.conf is not used, all this configuration now lives in apache2.conf, plus the loading of modules is done differently). edit /etc/apache2/httpd.conf and remove the 2 uncommented LoadModule lines. Debian loads modules a little differently that the default Apache2. It lists the available modules as individual configuration files within a mods-available directory, then enables these by linking to them from a mods-enabled directory. We need to create the two required module configuration files that are required by Subversion (we just removed them from /etc/apache2/httpd.conf !): cd /etc/apache2/mods-available echo "LoadM...

Installing Subversion (svn) on Linux (Debian Stable)

This post details my recent install of Subversion 1.2.1 on Debian Stable . The Debian packaged version of Subversion is currently only 1.1.4, but I wanted to install the latest version as it supports full WebDAV autoversioning & has the FSFS repository back end as the default. I wanted to access Subversion via the WebDAV protocol , this requires Apache2 . As Debian Stable only recently included the apache2 package, I had to update to that version first. Note: all these commands were run as the root user. Install Apache2: apt-get install apache2 That installs the web server and all the required packages, it does not start Apache by default, you need to edit /etc/default/apache2 and change NO_START to 0 , then run /etc/init.d/apache2 start to get the basic web server running. When you build Subversion from source, it requires the apxs2 tool to be able to build and install the Subversion extension modules. This is hidden away in the apache2-threaded-dev package, it's n...