Tired of typing the same formulaic SVK commands over and over again whenever I need to mirror another repository to my system (especially in the wake of several successive laptop failures), I whipped up this little bash script. I have christened it svk-init.

#!/bin/sh

source=$1;
short=$2;

svk mirror $source //$short/main
svk sync //$short/main
svk cp //$short/main //$short/local -m "Creating //$short/local"
svk co //$short/local ~/src/$short

The first parameter is the URL to mirror from, the second is a short name for the project. Usage goes something like this:

$ ./svk-init svn+ssh://somehost/var/svn/functional functional

When the script completes, I’ll be left with a working copy in my ~/src/functional/ directory.

Eventually, I’d like to make the short name optional, having the script deduce one for me if the second parameter is left unspecified.