Nothing related specifically to mobile development today but a small script that is probably of interest for those that are using Subversion on a Debian Linux powered server and recently upgraded it to the Lenny release (which is obviously our case!)
As a matter of fact, Debian Lenny comes with Subversion server v1.5.1 (compared to the 1.4 used in Etch). The merge support in 1.5 is significantly more powerful than in v1.4 but may requires an update of the whole subversion database. Here is a small script that will perform this task for you quite safely (note that you may prefer use the svnadmin upgrade function, that will be probably quicker for big project but will result in less optimized repositories.
Usage
./migrate.sh <repository>
where repository is the name of the repository to convert (just the name, not including the full path to it).
Example:
./migrate.sh compass
will convert the repository of the compass project (located in
/home/svn/compass directory)
Script
#!/bin/bash
#################################################
###
### migrate.sh
###
### Subversion migration script
### Author: Eric Bustarret (NewLC)
###
### Use at your own risk!!!!
### (and backup your database periodically)
###
#################################################
#Simple parsing of parameters
PROJECT=$1
#################################################
### Global configuration
### (You probably need to adapt SVN_REPOSITORY and
### APACHE_USER to your installation)
#################################################
SVN_REPOSITORYPATH=/home/svn
APACHE_USER=www-data
#################################################
### Script configuration
### (you probably don't need to update anything
### below)
#################################################
SVN_REPOSITORY=$SVN_REPOSITORYPATH/$PROJECT
DUMPDIR=/tmp
TIMESTAMP=`date +%Y-%m-%d`
SVN_DUMPFILE=$DUMPDIR/$TIMESTAMP.$PROJECT.dump
SVN_BACKUP=$SVN_REPOSITORY.backup
################################################
# Do the conversion in 4 steps:
# 1) dump the existing svn database
# 2) move the database to a backup place
# 3) create a new empty svn database
# 4) inject the dump into the new database
# Dump file and backup are not deleted to be able
# to rollback to the existing state if something
# goes wrong during the process
################################################
#check parameter
if [[ ${#PROJECT} = 0 ]]; then
echo "Missing project parameter !"
echo "Usage: $0 <projectname>"
exit 1
fi
#dump repository
cd SVN_REPOSITORYPATH
svnadmin dump $SVN_REPOSITORY > $SVN_DUMPFILE
#move existing repository to backup
\mv $SVN_REPOSITORY $SVN_BACKUP
if [ -d $SVN_REPOSITORY ]; then
echo "SVN repository for $PROJECT could not be backed up. Check your rights"
echo "Dump file created in $SVN_DUMPFILE"
exit 2
fi
#create new repository
svnadmin create --fs-type fsfs $SVN_REPOSITORY
#inject the dump in the new repository
svnadmin load $SVN_REPOSITORY < $SVN_DUMPFILE
#setup rights
#(you may prefer a less permissive scheme here!)
chown -R $APACHE_USER:$APACHE_USER $SVN_REPOSITORY
#cleanup
echo "Process finished"
echo "Check the new database and delete the dumpfile in $SVN_DUMPFILE"