SVN: Relocate all subdirectories

I had to change the location of a SVN server for quite some working copies since we migrated from Subversion 1.4.6 to 1.7.1 and change the protocol from svn to http.

  1. for dir in $(ls); do
  2. if [ -d $dir ]; then
  3. echo "Processing $dir";
  4. cd $dir;
  5. url=$(svn info| grep URL | grep "svn://" | sed 's#URL: svn://old-server/path/to/##');
  6.  
  7. if [ "x$url" == "x" ]; then
  8. cd ..;
  9. continue;
  10. fi;
  11.  
  12. echo $url;
  13. svn relocate http://new-server/new/path/to/$url;
  14. cd ..;
  15. fi
  16. done

This snippet helped a lot automate the task.

Technorati Tags:Technorati Tags:

Trackback URL for this post:

http://www.schnuckelig.eu/trackback/172
Your rating: None Average: 2 (1 vote)