Merging Subversion repositories with path renaming
I had quite a few small projects in their own repositories that I wished to merge into one, with the projects name as the top-level directory.
svndumpfilter does not support this operation, but with a little sed magic I was able to achieve the right result.
Here is the script. As is typical, use at your own risk. Works for me, but YMMV.
#!/bin/sh INPUT="archabs bpkg cly fwc genpasswd libcrash manage op pm2tgz pycrash todo todo2" OUTPUT="/srv/svn/merged" for repo in $INPUT; do name=`basename $repo` svn mkdir -m "Base path for $name" file://$OUTPUT/$name || exit 1 svnadmin dump $repo | \ sed -e "s,^\\(Node-path\\|Node-copyfrom-path\\): ,\\1: $name/," | \ svnadmin load $OUTPUT || exit 1 done
Note: It makes the assumption that there are no lines in your code starting with Node-path: or Node-copyfrom-path:. If there are such lines I would not use this script.
