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 <a href="http://new-server/new/path/to/">http://new-server/new/path/to/</a>$url; 
  14.         cd ..; 
  15.     fi 
  16. done

This snippet helped a lot automate the task.

Development:

Themen:

Syndicate

Subscribe to Syndicate