tags:

views:

656

answers:

3

Hi,

I have two branches : X and Y. I want to replace a Y's subdirectory (y1) by its equivalent from X (x1).

For the time being, I do the following : copy x1 to Y, remove y1, rename (move) x1 to y1 :

a) svn copy https://path/to/branches/X/x1 https://path/to/branches/Y/
b) svn delete https://path/to/branches/Y/y1
c) svn move https://path/to/branches/Y/x1 https://path/to/branches/Y/y1

I think it is quite ugly...

How could I do it in a smarter way ?

+3  A: 

If you really want to replace the directory, you can do that with two operations:

svn delete https://path/to/branches/Y/y1
svn copy https://path/to/branches/X/x1 https://path/to/branches/Y/y1

If Y/y1 is really already an older copy of X/y1, you shouldn't replace it all the time, but instead merge all changes since the last merge into it.

Martin v. Löwis
+1  A: 

Why not just two steps:

a) svn delete https://path/to/branches/Y/y1
b) svn copy https://path/to/branches/X/x1 https://path/to/branches/Y/y1
Avi
A: 

check out branch Y to a fresh working copy, and put yourself there.

svn co https://path/to/branches/Y Y
cd Y

merge the changes necessary to trasform Y/y1 to X/x1 into Y/y1

svn merge https://path/to/branches/Y/y1 https://path/to/branches/X/x1 y1

commit this

svn commit -m "Y/y1 now has the same contents as X/x1"

If y1 has a different name from x1 (not clear form your description), do a rename:

svn mv y1 x1
svn commit -m "Y/y1 now named Y/x1"

But, you know if your workflow requires you to do subtree merges like this (or worse the sort of tree surgery advocated by other posters), you're probably Doing It Wrong.

bendin