[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Need to restructure repo folders: Problem: SVN COPY is recursive

From: Bob Archer <Bob.Archer_at_amsi.com>
Date: Fri, 15 Mar 2013 19:26:52 +0000

> Hi folks,
>
> We are changing our folder structure in the SVN repository and need to "map"
> content from old folders to the new folders.  I was investigating the use of SVN
> COPY but the command is recursive, which leads to problems for us.
> For example, let's say our structure looks like:
>
> Original Folders
> \a
> \a\b
> \a\b\c
>
> And we are moving to a new structure where content from \a is copied to \d, \b
> to \e and \c also to \e:
> New Folders
> \d
> \d\e
>
> I can't do a SVN COPY of \b to \e because I would get:
> \d\e\c
> The only solution I can think of is to script a copy process on a file-by-file basis
> by first getting a list of files in folder \c, then SVN COPY each file individually
> into folder \e.  Repeat for all folders. I can this in PERL but it seems like a long
> journey to get to the result.
>
> What am I missing?  Is my approach flawed?

That's pretty common because after all, a does contain folder b so when you copy a it is going to copy b.

All you have to do is work bottom up....

copy \a\b\c \e
copy \a\b \e

Then of course you would have to remove \c from \e. Also, the svn copy command doesn't have advanced options like your shell does to copy files exclusive of folders and stuff.

Hth,
BOb

> Note that we want to keep the original structure in place as well as have the
> new one which is why I am playing with COPY instead of MOVE or SWITCH.
Received on 2013-03-15 20:27:25 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.