Shifting SVN dirs around

Matt Lawrence matt.lawrence at virgin.net
Fri Feb 15 10:38:49 GMT 2008


Simon Wistow wrote:
> Currently I have my SVN repo set up so that trunk is
>
> 	/simon/<program name>/ 
>
> and releases are
>
> 	/simon-releases/<program name>/<version>
>
> and I've been pondering changing it to the more standard
>
> 	/simon/<program name>/trunk
>                          /releases/<version>  # or /tags
>                          /branches
>
> and I've been trying to think of a way to automate it. The best I can 
> come up with is something along the lines of this (in pseudo code)
>
>
> Is this a completely crazy? Is there a better way of doing this?
>
>
>   
No need to move each subdir of /simon individually

	foreach $name (@all_programs) {

                      svn mkdir /tmp/$name{,/branches}

		svn mv    /simon/$name /tmp/$name/trunk
		# svn mv    /tmp/$name   /simon/$name
		# svn mv    /simon-releases/$name /simon/$name/releases
		# svn mkdir /simon/$name/branches
		svn mv    /simon-releases/$name /tmp/$name/releases

	}

svn rm /simon
svn mv /tmp /simon

Matt



More information about the london.pm mailing list